-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Open
Description
Community Note
- Please vote on this issue by adding a π reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Description
New or Affected Resource(s)
- azurerm_subscription_policy_assignment
Potential Terraform Configuration
data "azurerm_subscription" "current" {}
resource "azurerm_policy_definition" "example" {
name = "only-deploy-in-westeurope"
policy_type = "Custom"
mode = "All"
policy_rule = <<POLICY_RULE
{
"if": {
"not": {
"field": "location",
"equals": "westeurope"
}
},
"then": {
"effect": "Deny"
}
}
POLICY_RULE
}
resource "azurerm_user_assigned_identity" "test" {
name = "acctest%d"
resource_group_name = azurerm_resource_group.test.name
location = azurerm_resource_group.test.location
}
resource "azurerm_subscription_policy_assignment" "example" {
name = "example"
policy_definition_id = azurerm_policy_definition.example.id
subscription_id = azurerm_subscription.current.id
identity {
type = "UserAssigned"
identity_id = azurerm_user_assigned_identity.test.id
}
}
Current behaviour
Currently only system managed identity can able to pass as a parameter
References
- Azure Portal can able to support this feature
tom-ditlev, TheLeftMoose, LP0101, p1johnson, Mahir-Isikli and 10 more