generated from Azure/terraform-azurerm-avm-template
-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathmain.dapr_component.tf
44 lines (40 loc) · 1.3 KB
/
main.dapr_component.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
33
34
35
36
37
38
39
40
41
42
43
44
resource "azapi_resource" "dapr_components" {
for_each = var.dapr_components
type = "Microsoft.App/managedEnvironments/daprComponents@2023-05-01"
name = each.key
parent_id = azapi_resource.this_environment.id
body = jsonencode({
properties = {
componentType = each.value.component_type
ignoreErrors = each.value.ignore_errors
initTimeout = each.value.init_timeout
secretStoreComponent = each.value.secret_store_component
scopes = each.value.scopes
version = each.value.version
metadata = each.value.metadata != null ? [
for m in each.value.metadata : {
name = m.name
secretRef = m.secret_name
value = m.value
}
] : null
secrets = each.value.secret != null ? [
for s in each.value.secret : {
identity = s.identity
keyVaultUrl = s.key_vault_secret_id
name = s.name
value = s.value
}
] : null
}
})
dynamic "timeouts" {
for_each = each.value.timeouts == null ? [] : [each.value.timeouts]
content {
create = timeouts.value.create
delete = timeouts.value.delete
read = timeouts.value.read
update = timeouts.value.update
}
}
}