Common Azure terraform module to create a Resource Group with optional lock.
Module version | Terraform version | AzureRM version |
---|---|---|
>= 4.x.x | 0.13.x | >= 2.0 |
>= 3.x.x | 0.12.x | >= 2.0 |
>= 2.x.x | 0.12.x | < 2.0 |
< 2.x.x | 0.11.x | < 2.0 |
This module is optimized to work with the Claranet terraform-wrapper tool
which set some terraform variables in the environment needed by this module.
More details about variables set by the terraform-wrapper
available in the documentation.
module "azure-region" {
source = "claranet/regions/azurerm"
version = "x.x.x"
azure_region = var.azure_region
}
module "rg" {
source = "claranet/rg/azurerm"
version = "x.x.x"
location = module.azure-region.location
client_name = var.client_name
environment = var.environment
stack = var.stack
}
Name | Description | Type | Default | Required |
---|---|---|---|---|
client_name | Client name/account used in naming | string |
n/a | yes |
custom_rg_name | Optional custom resource group name | string |
"" |
no |
environment | Project environment | string |
n/a | yes |
extra_tags | Extra tags to add | map(string) |
{} |
no |
location | Azure region to use | string |
n/a | yes |
lock_level | Specifies the Level to be used for this RG Lock. Possible values are Empty (no lock), CanNotDelete and ReadOnly. | string |
"" |
no |
name_prefix | Optional prefix for the generated name | string |
"" |
no |
stack | Project stack name | string |
n/a | yes |
Name | Description |
---|---|
resource_group_id | Resource group generated id |
resource_group_location | Resource group location (region) |
resource_group_name | Resource group name |
Terraform Azure RG documentation: terraform.io/docs/providers/azurerm/r/resource_group.html
Terraform Lock management documentation: terraform.io/docs/providers/azurerm/r/management_lock.html