diff --git a/code/infra/function.tf b/code/infra/function.tf index 2309064..61e897e 100644 --- a/code/infra/function.tf +++ b/code/infra/function.tf @@ -8,7 +8,7 @@ resource "azapi_resource" "function" { type = "SystemAssigned" } - body = jsonencode({ + body = { kind = "functionapp,linux,container" properties = { clientAffinityEnabled = false @@ -171,12 +171,14 @@ resource "azapi_resource" "function" { webSocketsEnabled = false } } - }) + } schema_validation_enabled = false - # ignore_body_changes = [ # Required when app settings are managed in a separate process - # "properties.siteConfig.appSettings" - # ] + # lifecycle { + # ignore_changes = [ + # body.properties.siteConfig.appSettings, # Required when app settings are managed in a separate process + # ] + # } depends_on = [ module.key_vault.key_vault_setup_completed, module.storage_account.storage_setup_completed, diff --git a/code/infra/network.tf b/code/infra/network.tf index e66efed..c5e75a2 100644 --- a/code/infra/network.tf +++ b/code/infra/network.tf @@ -1,9 +1,9 @@ resource "azapi_resource" "subnet_function" { - type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" + type = "Microsoft.Network/virtualNetworks/subnets@2024-03-01" name = "FunctionSubnet" parent_id = data.azurerm_virtual_network.virtual_network.id - body = jsonencode({ + body = { properties = { addressPrefix = var.subnet_cidr_function delegations = [ @@ -26,15 +26,15 @@ resource "azapi_resource" "subnet_function" { serviceEndpointPolicies = [] serviceEndpoints = [] } - }) + } } resource "azapi_resource" "subnet_private_endpoints" { - type = "Microsoft.Network/virtualNetworks/subnets@2022-07-01" + type = "Microsoft.Network/virtualNetworks/subnets@2024-03-01" name = "PeSubnet" parent_id = data.azurerm_virtual_network.virtual_network.id - body = jsonencode({ + body = { properties = { addressPrefix = var.subnet_cidr_private_endpoints delegations = [] @@ -50,7 +50,7 @@ resource "azapi_resource" "subnet_private_endpoints" { serviceEndpointPolicies = [] serviceEndpoints = [] } - }) + } depends_on = [ azapi_resource.subnet_function diff --git a/code/infra/terraform.tf b/code/infra/terraform.tf index e893906..de705d6 100644 --- a/code/infra/terraform.tf +++ b/code/infra/terraform.tf @@ -4,11 +4,11 @@ terraform { required_providers { azurerm = { source = "hashicorp/azurerm" - version = "4.6.0" + version = "4.8.0" } azapi = { source = "azure/azapi" - version = "1.15.0" + version = "2.0.1" } time = { source = "hashicorp/time"