From af2f3b7866e4cc88a8be7d3bab8017a0677d17c1 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Fri, 17 May 2024 20:13:17 +0000 Subject: [PATCH] fixed according to comments --- quickstart/101-ai-studio/dependent.tf | 5 +-- quickstart/101-ai-studio/hub.tf | 6 +-- quickstart/101-ai-studio/main.tf | 6 +++ quickstart/101-ai-studio/project.tf | 3 +- quickstart/101-ai-studio/variables.tf | 57 ++++++++++++++------------- 5 files changed, 41 insertions(+), 36 deletions(-) diff --git a/quickstart/101-ai-studio/dependent.tf b/quickstart/101-ai-studio/dependent.tf index 50958e43..14481aca 100644 --- a/quickstart/101-ai-studio/dependent.tf +++ b/quickstart/101-ai-studio/dependent.tf @@ -1,6 +1,6 @@ resource "azurerm_resource_group" "default" { - name = "azapi-template-rg-${var.names}" + name = "rg-${var.names}" location = var.location } @@ -24,7 +24,7 @@ resource "azurerm_key_vault" "default" { // AzAPI AIServices resource "azapi_resource" "AIServicesResource"{ - type = "Microsoft.CognitiveServices/accounts@2024-04-01-preview" + type = "Microsoft.CognitiveServices/accounts@2023-10-01-preview" name = "${var.names}AIServicesResource" location = azurerm_resource_group.default.location parent_id = azurerm_resource_group.default.id @@ -45,7 +45,6 @@ resource "azapi_resource" "AIServicesResource"{ } }) - schema_validation_enabled = false response_export_values = ["*"] } diff --git a/quickstart/101-ai-studio/hub.tf b/quickstart/101-ai-studio/hub.tf index e0389340..565ca7c1 100644 --- a/quickstart/101-ai-studio/hub.tf +++ b/quickstart/101-ai-studio/hub.tf @@ -1,5 +1,5 @@ resource "azapi_resource" "hub" { - type = "Microsoft.MachineLearningServices/workspaces@2024-04-01" + type = "Microsoft.MachineLearningServices/workspaces@2024-04-01-preview" name = "my-ai-hub" location = azurerm_resource_group.default.location parent_id = azurerm_resource_group.default.id @@ -20,7 +20,7 @@ resource "azapi_resource" "hub" { containerRegistry = azurerm_container_registry.default.id */ - //Optional: To enable Customer Managed Keys, the corresponding + /*Optional: To enable Customer Managed Keys, the corresponding encryption = { status = var.encryption_status keyVaultProperties = { @@ -28,9 +28,9 @@ resource "azapi_resource" "hub" { keyIdentifier = var.cmk_keyvault_key_uri } } + */ } kind = "hub" }) - schema_validation_enabled = false } \ No newline at end of file diff --git a/quickstart/101-ai-studio/main.tf b/quickstart/101-ai-studio/main.tf index ed091aa3..0ac01faa 100644 --- a/quickstart/101-ai-studio/main.tf +++ b/quickstart/101-ai-studio/main.tf @@ -1,5 +1,11 @@ terraform { + required_version = ">= 1.0" + required_providers { + azurerm = { + source = "hashicorp/azurerm" + version = ">= 3.0, < 4.0" + } azapi = { source = "azure/azapi" } diff --git a/quickstart/101-ai-studio/project.tf b/quickstart/101-ai-studio/project.tf index 2bcec10b..96aee1cc 100644 --- a/quickstart/101-ai-studio/project.tf +++ b/quickstart/101-ai-studio/project.tf @@ -1,5 +1,5 @@ resource "azapi_resource" "project" { - type = "Microsoft.MachineLearningServices/workspaces@2024-04-01" + type = "Microsoft.MachineLearningServices/workspaces@2024-04-01-preview" name = "my-ai-project" location = azurerm_resource_group.default.location parent_id = azurerm_resource_group.default.id @@ -16,5 +16,4 @@ resource "azapi_resource" "project" { } kind = "project" }) - schema_validation_enabled = false } \ No newline at end of file diff --git a/quickstart/101-ai-studio/variables.tf b/quickstart/101-ai-studio/variables.tf index b83c3120..f739c12d 100644 --- a/quickstart/101-ai-studio/variables.tf +++ b/quickstart/101-ai-studio/variables.tf @@ -1,28 +1,29 @@ -// Names and Try are used for naming conventions in hub.tf and depende -variable "names" { - type = string - description="This variable is used to name the hub, project, and dependent resources." - default = "tftemplate" -} - -variable "location" { - type = string - description = "This is the location for all resources" - default = "East US 2" -} - -variable "sku" { - 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" - default = "S0" -} - -//Optional: For Customer Managed Keys, uncomment this part AND the corresponding section in hub.tf -variable "cmk_keyvault_key_uri" { - description = "Key vault uri to access the encryption key." -} - -variable "encryption_status" { - description = "Indicates whether or not the encryption is enabled for the workspace." - default = "Enabled" -} +// Names and Try are used for naming conventions in hub.tf and depende +variable "names" { + type = string + description="This variable is used to name the hub, project, and dependent resources." + default = "tftemplate" +} + +variable "location" { + type = string + description = "This is the location for all resources" + default = "East US 2" +} + +variable "sku" { + 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" + default = "S0" +} + +/*Optional: For Customer Managed Keys, uncomment this part AND the corresponding section in hub.tf +variable "cmk_keyvault_key_uri" { + description = "Key vault uri to access the encryption key." +} + +variable "encryption_status" { + description = "Indicates whether or not the encryption is enabled for the workspace." + default = "Enabled" +} +*/ \ No newline at end of file