-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.interfaces.tf
More file actions
40 lines (33 loc) · 1.24 KB
/
Copy pathmain.interfaces.tf
File metadata and controls
40 lines (33 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
module "avm_interfaces" {
source = "Azure/avm-utl-interfaces/azure"
version = "0.2.0"
lock = var.lock
managed_identities = {
system_assigned = try(var.managed_identities.system_assigned, false)
user_assigned_resource_ids = try(var.managed_identities.user_assigned_resource_ids, [])
}
role_assignment_definition_scope = "/subscriptions/${data.azapi_client_config.current.subscription_id}"
role_assignments = var.role_assignments
}
resource "azapi_resource" "role_assignments" {
for_each = module.avm_interfaces.role_assignments_azapi
name = each.value.name
parent_id = azapi_resource.container_app.id
type = each.value.type
body = each.value.body
}
resource "azapi_resource" "lock" {
count = var.lock != null ? 1 : 0
name = module.avm_interfaces.lock_azapi.name != null ? module.avm_interfaces.lock_azapi.name : "lock-${azapi_resource.container_app.name}"
parent_id = azapi_resource.container_app.id
type = module.avm_interfaces.lock_azapi.type
body = module.avm_interfaces.lock_azapi.body
}
moved {
from = azurerm_management_lock.this[0]
to = azapi_resource.lock[0]
}
moved {
from = azurerm_role_assignment.this
to = azapi_resource.role_assignments
}