From 54841abb6af95359229952072d14759f2a69f36b Mon Sep 17 00:00:00 2001 From: lolorol Date: Fri, 20 May 2022 04:14:29 +0000 Subject: [PATCH] Update to azurerm_resource_group_template_deployment --- .../compute_instance/compute_instance.tf | 12 +++++++++--- .../app_config/settings/app_config_setting.tf | 10 ++++++++-- modules/webapps/ase/module.tf | 16 +++++++++++----- 3 files changed, 28 insertions(+), 10 deletions(-) diff --git a/modules/analytics/machine_learning/compute_instance/compute_instance.tf b/modules/analytics/machine_learning/compute_instance/compute_instance.tf index 2a0c90c154..2ba7b18fa5 100644 --- a/modules/analytics/machine_learning/compute_instance/compute_instance.tf +++ b/modules/analytics/machine_learning/compute_instance/compute_instance.tf @@ -11,15 +11,21 @@ resource "azurecaf_name" "ci" { use_slug = var.global_settings.use_slug } +# Part of migration from 2.99.0 to 3.7.0 +moved { + from = azurerm_template_deployment.mlci + to = azurerm_resource_group_template_deployment.mlci +} + # create compute instance -resource "azurerm_template_deployment" "mlci" { +resource "azurerm_resource_group_template_deployment" "mlci" { name = azurecaf_name.ci.result resource_group_name = var.resource_group_name - template_body = file(local.arm_filename) + template_content = file(local.arm_filename) - parameters_body = jsonencode(local.parameters_body) + parameters_content = jsonencode(local.parameters_body) deployment_mode = "Incremental" diff --git a/modules/databases/app_config/settings/app_config_setting.tf b/modules/databases/app_config/settings/app_config_setting.tf index cadccf8635..16932dfdbe 100644 --- a/modules/databases/app_config/settings/app_config_setting.tf +++ b/modules/databases/app_config/settings/app_config_setting.tf @@ -8,14 +8,20 @@ resource "azurecaf_name" "settings" { use_slug = var.global_settings.use_slug } +# Part of migration from 2.99.0 to 3.7.0 +moved { + from = azurerm_template_deployment.settings + to = azurerm_resource_group_template_deployment.settings +} + # create app config settings resource "azurerm_template_deployment" "settings" { name = azurecaf_name.settings.result resource_group_name = var.resource_group_name - template_body = file(local.arm_filename) + template_content = file(local.arm_filename) - parameters_body = jsonencode(local.parameters_body) + parameters_content = jsonencode(local.parameters_body) deployment_mode = "Incremental" diff --git a/modules/webapps/ase/module.tf b/modules/webapps/ase/module.tf index 31bbe80d75..0dcf32ddcf 100644 --- a/modules/webapps/ase/module.tf +++ b/modules/webapps/ase/module.tf @@ -8,14 +8,20 @@ resource "azurecaf_name" "ase" { use_slug = var.global_settings.use_slug } -resource "azurerm_template_deployment" "ase" { +# Part of migration from 2.99.0 to 3.7.0 +moved { + from = azurerm_template_deployment.ase + to = azurerm_resource_group_template_deployment.ase +} + +resource "azurerm_resource_group_template_deployment" "ase" { name = azurecaf_name.ase.result resource_group_name = var.resource_group_name - template_body = file(local.arm_filename) + template_content = file(local.arm_filename) - parameters_body = jsonencode(local.parameters_body) + parameters_content = jsonencode(local.parameters_body) deployment_mode = "Incremental" @@ -30,7 +36,7 @@ resource "azurerm_template_deployment" "ase" { resource "null_resource" "destroy_ase" { triggers = { - resource_id = lookup(azurerm_template_deployment.ase.outputs, "id") + resource_id = jsondecode(azurerm_resource_group_template_deployment.ase.output_content).id.value } provisioner "local-exec" { @@ -47,7 +53,7 @@ resource "null_resource" "destroy_ase" { } data "azurerm_app_service_environment" "ase" { - depends_on = [azurerm_template_deployment.ase] + depends_on = [azurerm_resource_group_template_deployment.ase] name = azurecaf_name.ase.result resource_group_name = var.resource_group_name