Skip to content
This repository has been archived by the owner on Jan 15, 2025. It is now read-only.
This repository is currently being migrated. It's locked while the migration is in progress.

Latest commit

 

History

History
28 lines (23 loc) · 1.39 KB

File metadata and controls

28 lines (23 loc) · 1.39 KB

Module for assigning allowed regions policy

This module creates a custom policy in Azure.

Using this module

Inputs

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

Example usage of this module

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}
}

Example for destroying the module

terraform destroy -target=module.allowed-regions-policy