This module creates a custom policy in Azure.
Name | Description | Type | Default | Required |
---|---|---|---|---|
allowed_regions | A list of allowed Azure regions/locations. E.g West Europe will only allowd resources to be created in region/location West Europe | string | - | yes |
location | The default region/location to put the resources in | string | West Europe |
no |
name_prefix | Variable value fetched from environmental variable when running terraform | string | - | yes |
scope_of_policy_assignment | The Scope at which the Policy Assignment should be applied. This can either be the Subscription (e.g. /subscriptions/00000000-0000-0000-000000000000) or a Resource Group (e.g./subscriptions/00000000-0000-0000-000000000000/resourceGroups/myResourceGroup). | string | - | yes |
module "allowed-regions-policy" {
source = "git::https://github.com/evry/tf-module-azure-policy-allowed-region.git?ref=VERSION"
name_prefix = "${var.name_prefix}"
allowed_regions = "westeurope"
scope_of_policy_assignment = "/subscriptions/${data.azurerm_client_config.current_subscription.subscription_id}
}
terraform destroy -target=module.allowed-regions-policy