generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 36
/
Copy pathmain.secrets.tf
32 lines (27 loc) · 1012 Bytes
/
main.secrets.tf
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
module "secrets" {
source = "./modules/secret"
for_each = var.secrets
key_vault_resource_id = azurerm_key_vault.this.id
name = each.value.name
value = var.secrets_value[each.key]
content_type = each.value.content_type
expiration_date = each.value.expiration_date
not_before_date = each.value.not_before_date
tags = each.value.tags
role_assignments = each.value.role_assignments
depends_on = [
azurerm_private_endpoint.this,
time_sleep.wait_for_rbac_before_secret_operations
]
}
resource "time_sleep" "wait_for_rbac_before_secret_operations" {
count = length(var.role_assignments) != 0 && length(var.secrets) != 0 ? 1 : 0
create_duration = var.wait_for_rbac_before_secret_operations.create
destroy_duration = var.wait_for_rbac_before_secret_operations.destroy
triggers = {
role_assignments = jsonencode(var.role_assignments)
}
depends_on = [
azurerm_role_assignment.this
]
}