Open prosaied opened 3 days ago
hello @prosaied
this is a known problem and it was fixed in PR https://github.com/Azure/terraform-azurerm-aks/pull/410
the variable create_role_assignment_network_contributor
is deprecated and will go away in a future version.
Please migrate to the new network_contributor_role_assigned_subnet_ids
variable.
Is there an existing issue for this?
Greenfield/Brownfield provisioning
greenfield
Terraform Version
1.5.4
Module Version
9.0.0
AzureRM Provider Version
3.109.0
Affected Resource(s)/Data Source(s)
azurerm_kubernetes_cluster_node_pool
Terraform Configuration Files
tfvars variables values
Debug Output/Panic Output
Expected Behaviour
When the variable create_role_assignment_network_contributor is set to true, it should create and iterate over resources.
Actual Behaviour
On the first run, you will encounter an invalid for_each loop if the variable create_role_assignment_network_contributor is set to true. To avoid this, set the variable to false initially. After the cluster is created, you can then set it to true, and it will work fine. Additionally, any changes to the VNet resource can also cause this error.
We are currently using version 7.3.2 of the "Azure/aks/azurerm" module in our environments. Both new and old deployments use this version, but the issue persists regardless of the deployment time. Notably, this bug still exists in version 9.0.0.
Steps to Reproduce
No response
Important Factoids
No response
References
No response