Skip to content
This repository is currently being migrated. It's locked while the migration is in progress.

Terraform Azure module to create an allowed regions custom policy

Notifications You must be signed in to change notification settings

evry/tf-module-azure-policy-allowed-region

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Terraform Azure module to create an allowed regions custom policy

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages