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
The Azure portal takes these role IDs and assigns them to the managed identity during a policy assignment. When the portal is not used, role assignments need to be implemented explicitly:
When using the portal, Azure Policy automatically grants the managed identity the listed roles once assignment starts. When using an Azure software development kit (SDK), the roles must manually be granted to the managed identity. Remediate non-compliant resources with Azure Policy.
In terraform, I need to "repeat" the role definitions in my code (e.g. by using data elements) in order to create the role assignments according to the policy definition. This is inconvenient, redundant and error prone. It would nice, if the azurerm_policy_definition resource would expose the role IDs of the definition as an argument.
Then it would be possible to write a "generic" role assignment using the policy definition's role definitions.
I'm going to lock this issue because it has been closed for 30 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.
Is there an existing issue for this?
Community Note
Description
The JSON specification of an Azure policy definition contains a set of roles required for remediation (e.g. deployIfNotExists):
The Azure portal takes these role IDs and assigns them to the managed identity during a policy assignment. When the portal is not used, role assignments need to be implemented explicitly:
In terraform, I need to "repeat" the role definitions in my code (e.g. by using
data
elements) in order to create the role assignments according to the policy definition. This is inconvenient, redundant and error prone. It would nice, if theazurerm_policy_definition
resource would expose the role IDs of the definition as an argument.Then it would be possible to write a "generic" role assignment using the policy definition's role definitions.
New or Affected Resource(s)/Data Source(s)
azurerm_policy_definition
Potential Terraform Configuration
References
The text was updated successfully, but these errors were encountered: