Skip to content

Commit

Permalink
Update to azurerm_resource_group_template_deployment
Browse files Browse the repository at this point in the history
  • Loading branch information
LaurentLesle authored May 20, 2022
1 parent e0aa230 commit 54841ab
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
10 changes: 8 additions & 2 deletions modules/databases/app_config/settings/app_config_setting.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
16 changes: 11 additions & 5 deletions modules/webapps/ase/module.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand All @@ -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" {
Expand All @@ -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
Expand Down

0 comments on commit 54841ab

Please sign in to comment.