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

@ -17,7 +17,7 @@ variable "sku" {
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."
} }
@ -26,3 +26,4 @@ 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"
} }
*/