@@ -3,7 +3,6 @@ data "azurerm_resource_group" "rg" {
33}
44
55resource "azapi_resource" "container_app" {
6- for_each = { for app in var . container_apps : app . name => app }
76 type = " Microsoft.App/containerApps@2023-05-01"
87 schema_validation_enabled = false
98 name = var. name
@@ -18,38 +17,38 @@ resource "azapi_resource" "container_app" {
1817 body = jsonencode ({
1918 properties = {
2019 configuration = {
21- activeRevisionsMode = try (each . value . revision_mode , " Single" )
22- dapr = try (each . value . dapr , null )
23- ingress = try (each . value . ingress , null )
24- maxInactiveRevisions = try (each . value . maxInactiveRevisions , null )
25- registries = try (each . value . registries , null )
26- secrets = try (each . value . secrets , null )
27- service = try (each . value . service , null )
20+ activeRevisionsMode = try (var . container_apps . revision_mode , " Single" )
21+ dapr = try (var . container_apps . dapr , null )
22+ ingress = try (var . container_apps . ingress , null )
23+ maxInactiveRevisions = try (var . container_apps . maxInactiveRevisions , null )
24+ registries = try (var . container_apps . registries , null )
25+ secrets = try (var . container_apps . secrets , null )
26+ service = try (var . container_apps . service , null )
2827 }
2928 environmentId = var.container_app_environment_resource_id
30- template = each.value .template
29+ template = var.container_apps .template
3130 workloadProfileName = var.workload_profile_name
3231 }
3332 })
3433
3534 response_export_values = [" identity" ]
3635}
3736
38- # resource "azurerm_management_lock" "this" {
39- # count = var.lock.kind != "None" ? 1 : 0
40- # name = coalesce(var.lock.name, "lock-${var.name}")
41- # scope = azapi_resource.container_app.id
42- # lock_level = var.lock.kind
43- # }
37+ resource "azurerm_management_lock" "this" {
38+ count = var. lock . kind != " None" ? 1 : 0
39+ name = coalesce (var. lock . name , " lock-${ var . name } " )
40+ scope = azapi_resource. container_app . id
41+ lock_level = var. lock . kind
42+ }
4443
45- # resource "azurerm_role_assignment" "this" {
46- # for_each = var.role_assignments
47- # scope = azapi_resource.container_app.id
48- # role_definition_id = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? each.value.role_definition_id_or_name : null
49- # role_definition_name = strcontains(lower(each.value.role_definition_id_or_name), lower(local.role_definition_resource_substring)) ? null : each.value.role_definition_id_or_name
50- # principal_id = each.value.principal_id
51- # condition = each.value.condition
52- # condition_version = each.value.condition_version
53- # skip_service_principal_aad_check = each.value.skip_service_principal_aad_check
54- # delegated_managed_identity_resource_id = each.value.delegated_managed_identity_resource_id
55- # }
44+ resource "azurerm_role_assignment" "this" {
45+ for_each = var. role_assignments
46+ scope = azapi_resource. container_app . id
47+ role_definition_id = strcontains (lower (each. value . role_definition_id_or_name ), lower (local. role_definition_resource_substring )) ? each. value . role_definition_id_or_name : null
48+ role_definition_name = strcontains (lower (each. value . role_definition_id_or_name ), lower (local. role_definition_resource_substring )) ? null : each. value . role_definition_id_or_name
49+ principal_id = each. value . principal_id
50+ condition = each. value . condition
51+ condition_version = each. value . condition_version
52+ skip_service_principal_aad_check = each. value . skip_service_principal_aad_check
53+ delegated_managed_identity_resource_id = each. value . delegated_managed_identity_resource_id
54+ }
0 commit comments