-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathresource-location-initiative.tf
27 lines (24 loc) · 1 KB
/
resource-location-initiative.tf
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
resource "azurerm_policy_definition" "resource_location" {
name = "resource-location"
policy_type = "Custom"
mode = "All"
display_name = "Resource Location"
management_group_name = var.definition_management_group
policy_rule = file("${path.module}/policies/resource-location/policy-rule.json")
parameters = file("${path.module}/policies/resource-location/policy-parameters.json")
}
resource "azurerm_policy_set_definition" "resource_location" {
name = "resource-location"
policy_type = "Custom"
display_name = "Resource Location"
management_group_name = var.definition_management_group
parameters = file("${path.module}/initiative-parameters.json")
policy_definition_reference {
policy_definition_id = azurerm_policy_definition.resource_location.id
parameter_values = jsonencode({
allowedLocations = {
value = "[parameters('allowedLocations')]"
}
})
}
}