fixed according to comments

This commit is contained in:
github-actions[bot] 2024-05-17 20:13:17 +00:00 committed by lonegunmanb
parent 6d7c599850
commit 9df50ca6b2
5 changed files with 41 additions and 36 deletions

View File

@ -1,6 +1,6 @@
resource "azurerm_resource_group" "default" { resource "azurerm_resource_group" "default" {
name = "azapi-template-rg-${var.names}" name = "rg-${var.names}"
location = var.location location = var.location
} }
@ -24,7 +24,7 @@ resource "azurerm_key_vault" "default" {
// AzAPI AIServices // AzAPI AIServices
resource "azapi_resource" "AIServicesResource"{ resource "azapi_resource" "AIServicesResource"{
type = "Microsoft.CognitiveServices/accounts@2024-04-01-preview" type = "Microsoft.CognitiveServices/accounts@2023-10-01-preview"
name = "${var.names}AIServicesResource" name = "${var.names}AIServicesResource"
location = azurerm_resource_group.default.location location = azurerm_resource_group.default.location
parent_id = azurerm_resource_group.default.id parent_id = azurerm_resource_group.default.id
@ -45,7 +45,6 @@ resource "azapi_resource" "AIServicesResource"{
} }
}) })
schema_validation_enabled = false
response_export_values = ["*"] response_export_values = ["*"]
} }

View File

@ -1,5 +1,5 @@
resource "azapi_resource" "hub" { resource "azapi_resource" "hub" {
type = "Microsoft.MachineLearningServices/workspaces@2024-04-01" type = "Microsoft.MachineLearningServices/workspaces@2024-04-01-preview"
name = "my-ai-hub" name = "my-ai-hub"
location = azurerm_resource_group.default.location location = azurerm_resource_group.default.location
parent_id = azurerm_resource_group.default.id parent_id = azurerm_resource_group.default.id
@ -20,7 +20,7 @@ resource "azapi_resource" "hub" {
containerRegistry = azurerm_container_registry.default.id containerRegistry = azurerm_container_registry.default.id
*/ */
//Optional: To enable Customer Managed Keys, the corresponding /*Optional: To enable Customer Managed Keys, the corresponding
encryption = { encryption = {
status = var.encryption_status status = var.encryption_status
keyVaultProperties = { keyVaultProperties = {
@ -28,9 +28,9 @@ resource "azapi_resource" "hub" {
keyIdentifier = var.cmk_keyvault_key_uri keyIdentifier = var.cmk_keyvault_key_uri
} }
} }
*/
} }
kind = "hub" kind = "hub"
}) })
schema_validation_enabled = false
} }

View File

@ -1,5 +1,11 @@
terraform { terraform {
required_version = ">= 1.0"
required_providers { required_providers {
azurerm = {
source = "hashicorp/azurerm"
version = ">= 3.0, < 4.0"
}
azapi = { azapi = {
source = "azure/azapi" source = "azure/azapi"
} }

View File

@ -1,5 +1,5 @@
resource "azapi_resource" "project" { resource "azapi_resource" "project" {
type = "Microsoft.MachineLearningServices/workspaces@2024-04-01" type = "Microsoft.MachineLearningServices/workspaces@2024-04-01-preview"
name = "my-ai-project" name = "my-ai-project"
location = azurerm_resource_group.default.location location = azurerm_resource_group.default.location
parent_id = azurerm_resource_group.default.id parent_id = azurerm_resource_group.default.id
@ -16,5 +16,4 @@ resource "azapi_resource" "project" {
} }
kind = "project" kind = "project"
}) })
schema_validation_enabled = false
} }

View File

@ -1,28 +1,29 @@
// Names and Try are used for naming conventions in hub.tf and depende // Names and Try are used for naming conventions in hub.tf and depende
variable "names" { variable "names" {
type = string type = string
description="This variable is used to name the hub, project, and dependent resources." description="This variable is used to name the hub, project, and dependent resources."
default = "tftemplate" default = "tftemplate"
} }
variable "location" { variable "location" {
type = string type = string
description = "This is the location for all resources" description = "This is the location for all resources"
default = "East US 2" default = "East US 2"
} }
variable "sku" { variable "sku" {
type = string type = string
description = "The sku name of the Azure Analysis Services server to create. Choose from: B1, B2, D1, S0, S1, S2, S3, S4, S8, S9. Some skus are region specific. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-overview#availability-by-region" description = "The sku name of the Azure Analysis Services server to create. Choose from: B1, B2, D1, S0, S1, S2, S3, S4, S8, S9. Some skus are region specific. See https://docs.microsoft.com/en-us/azure/analysis-services/analysis-services-overview#availability-by-region"
default = "S0" default = "S0"
} }
//Optional: For Customer Managed Keys, uncomment this part AND the corresponding section in hub.tf /*Optional: For Customer Managed Keys, uncomment this part AND the corresponding section in hub.tf
variable "cmk_keyvault_key_uri" { variable "cmk_keyvault_key_uri" {
description = "Key vault uri to access the encryption key." description = "Key vault uri to access the encryption key."
} }
variable "encryption_status" { variable "encryption_status" {
description = "Indicates whether or not the encryption is enabled for the workspace." description = "Indicates whether or not the encryption is enabled for the workspace."
default = "Enabled" default = "Enabled"
} }
*/