You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
╷
│ Error: Invalid for_each argument
│
│ on .terraform/modules/aks/role_assignments.tf line 25, in resource "azurerm_role_assignment""network_contributor":
│ 25: for_each = var.create_role_assignment_network_contributor && (var.client_id == ""|| var.client_secret == "") ? local.subnet_ids : []
│ ├────────────────
│ │ local.subnet_ids is empty set of dynamic
│ │ var.client_id is "cefe3104-8d58-43b9-b08c-1e3bda686b84"
│ │ var.client_secret has a sensitive value
│ │ var.create_role_assignment_network_contributor is false
│
│ Sensitive values, or values derived from sensitive values, cannot be used as for_each arguments. If used, the sensitive value could be exposed as a resource instance key.
╵
Expected Behaviour
The usage of a sensitive value for client_secret should not result in an error.
Is there an existing issue for this?
Greenfield/Brownfield provisioning
greenfield
Terraform Version
1.10.4
Module Version
9.3.0
AzureRM Provider Version
3.117
Affected Resource(s)/Data Source(s)
azurerm_role_assignment.network_contributor
Terraform Configuration Files
tfvars variables values
Debug Output/Panic Output
Expected Behaviour
The usage of a sensitive value for
client_secret
should not result in an error.Actual Behaviour
Terraform returns an error.
Steps to Reproduce
Important Factoids
No response
References
According to this article, we just have to add the
nonsensitive
function around the value here:terraform-azurerm-aks/role_assignments.tf
Line 25 in edb3f20
This shouldn't result in any loss of safety, as the sensitive value is only used as a condition. I've created a PR for this:
client_secret
#629The text was updated successfully, but these errors were encountered: