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
I am trying to use the PIM Assignment - Resource Group module with for_each and lookups in TF. The use case is so that we can set a security group as a variable, then have that security group be granted RBAC roles, and in this case, the PIM assignment as well.
When I run terraform plan, I get the following error:
│ Error: Module module.pim_assignment_2 contains provider configuration
│
│ Providers cannot be configured within modules using count, for_each or depends_on.
How should we utilize the module to create one PIM assignment in a for_each situation?
The text was updated successfully, but these errors were encountered:
Hi @MohnJadden , could you try out the branch linked to this issue, to see if removing the provider configuration helps for this? I know there is a limitation here somewhere in Terraform when using for_each and count, though, but try it out.
That seems to have resolved the issue - I did have to tweak main.tf to use [each.key] instead of .name since I'm using arrays, but the original issue was resolved with this build. Thank you!
I am trying to use the PIM Assignment - Resource Group module with for_each and lookups in TF. The use case is so that we can set a security group as a variable, then have that security group be granted RBAC roles, and in this case, the PIM assignment as well.
The main.tf portion is as follows:
When I run terraform plan, I get the following error:
How should we utilize the module to create one PIM assignment in a for_each situation?
The text was updated successfully, but these errors were encountered: