diff --git a/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/connections.tf b/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/connections.tf index 7b77ae22f..697d9e911 100644 --- a/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/connections.tf +++ b/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/connections.tf @@ -5,7 +5,7 @@ resource "azapi_resource" "ai_studio_hub_connections" { name = each.key parent_id = azapi_resource.ai_studio_hub.id - body = jsonencode({ + body = { properties = { authType = each.value.auth_type category = each.value.category @@ -15,8 +15,7 @@ resource "azapi_resource" "ai_studio_hub_connections" { target = each.value.target metadata = each.value.metadata } - - }) + } response_export_values = [] schema_validation_enabled = false # Can be reverted once this is closed: https://github.com/Azure/terraform-provider-azapi/issues/524 diff --git a/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/main.tf b/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/main.tf index 4103f86e0..6790739c0 100644 --- a/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/main.tf +++ b/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/main.tf @@ -20,7 +20,7 @@ resource "azapi_resource" "ai_studio_hub" { } } - body = jsonencode({ + body = { kind = "Hub" properties = { applicationInsights = var.application_insights_id @@ -53,12 +53,14 @@ resource "azapi_resource" "ai_studio_hub" { name = "Basic" tier = "Basic" } - }) + } response_export_values = [] schema_validation_enabled = false # Can be reverted once this is closed: https://github.com/Azure/terraform-provider-azapi/issues/524 locks = [] - ignore_body_changes = ["properties.managedNetwork"] ignore_casing = false ignore_missing_property = true + lifecycle { + ignore_changes = ["body.properties.managedNetwork"] + } } diff --git a/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/outboundrules.tf b/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/outboundrules.tf new file mode 100644 index 000000000..9b4e5f246 --- /dev/null +++ b/quickstart/301-ai-studio-secure-e2e/modules/aistudiohub/outboundrules.tf @@ -0,0 +1,14 @@ +resource "azapi_resource_action" "ai_studio_hub_provision_managed_network" { + count = var.ai_studio_hub_provision_managed_network ? 1 : 0 + + type = "Microsoft.MachineLearningServices/workspaces@2024-04-01" + resource_id = azapi_resource.ai_studio_hub.id + + action = "provisionManagedNetwork" + method = "POST" + body = { + includeSpark = true + } + + response_export_values = [] +} diff --git a/quickstart/301-ai-studio-secure-e2e/modules/aistudiooutboundrules/main.tf b/quickstart/301-ai-studio-secure-e2e/modules/aistudiooutboundrules/main.tf index 830ca7ed5..c9c2efe0a 100644 --- a/quickstart/301-ai-studio-secure-e2e/modules/aistudiooutboundrules/main.tf +++ b/quickstart/301-ai-studio-secure-e2e/modules/aistudiooutboundrules/main.tf @@ -2,7 +2,7 @@ resource "azapi_update_resource" "ai_studio_hub_outbound_rules" { type = "Microsoft.MachineLearningServices/workspaces@2024-04-01" resource_id = var.ai_studio_hub_id - body = jsonencode({ + body = { properties = { managedNetwork = { isolationMode = "AllowOnlyApprovedOutbound" @@ -13,7 +13,7 @@ resource "azapi_update_resource" "ai_studio_hub_outbound_rules" { } } } - }) + } response_export_values = [] locks = [] @@ -29,9 +29,9 @@ resource "azapi_resource_action" "ai_studio_hub_provision_managed_network" { action = "provisionManagedNetwork" method = "POST" - body = jsonencode({ + body = { includeSpark = true - }) + } response_export_values = [] depends_on = [] diff --git a/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/connections.tf b/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/connections.tf index 565b54145..1c80f25df 100644 --- a/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/connections.tf +++ b/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/connections.tf @@ -5,7 +5,7 @@ resource "azapi_resource" "ai_studio_project_connection" { name = each.key parent_id = azapi_resource.ai_studio_project.id - body = jsonencode({ + body = { properties = { authType = each.value.auth_type category = each.value.category @@ -15,8 +15,7 @@ resource "azapi_resource" "ai_studio_project_connection" { target = each.value.target metadata = each.value.metadata } - - }) + } response_export_values = [] schema_validation_enabled = false # Can be reverted once this is closed: https://github.com/Azure/terraform-provider-azapi/issues/524 diff --git a/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/main.tf b/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/main.tf index b34250d16..a978f706f 100644 --- a/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/main.tf +++ b/quickstart/301-ai-studio-secure-e2e/modules/aistudioproject/main.tf @@ -9,14 +9,14 @@ resource "azapi_resource" "ai_studio_project" { identity_ids = [] } - body = jsonencode({ + body = { kind = "Project" properties = { description = "AI Studio Project - ${var.ai_studio_project_name}" friendlyName = title(replace(var.ai_studio_project_name, "-", " ")) hubResourceId = var.ai_studio_hub_id } - }) + } response_export_values = [] schema_validation_enabled = false # Can be reverted once this is closed: https://github.com/Azure/terraform-provider-azapi/issues/524