Skip to content

claranet/terraform-azurerm-rg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Azure Resource Group

Changelog Notice Apache V2 License TF Registry

Common Azure terraform module to create a Resource Group with optional lock.

Naming

Resource naming is based on the Microsoft CAF naming convention best practices. Legacy naming is available by setting the parameter use_caf_naming to false. We rely on the official Terraform Azure CAF naming provider to generate resource names.

Global versioning rule for Claranet Azure modules

Module version Terraform version AzureRM version
>= 7.x.x 1.3.x >= 3.0
>= 6.x.x 1.x >= 3.0
>= 5.x.x 0.15.x >= 2.0
>= 4.x.x 0.13.x / 0.14.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

Contributing

If you want to contribute to this repository, feel free to use our pre-commit git hook configuration which will help you automatically update and format some files for you by enforcing our Terraform code module best-practices.

More details are available in the CONTRIBUTING.md file.

Usage

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
}

Providers

Name Version
azurecaf ~> 1.2.26
azurerm >= 1.32

Modules

No modules.

Resources

Name Type
azurerm_management_lock.resource_group_level_lock resource
azurerm_resource_group.main_rg resource
azurecaf_name.rg data source

Inputs

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
default_tags_enabled Option to enable or disable default tags. bool true 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
name_suffix Optional suffix for the generated name string "" no
stack Project stack name. string n/a yes
use_caf_naming Use the Azure CAF naming provider to generate default resource name. custom_rg_name override this if set. Legacy default name is used if this is set to false. bool true no

Outputs

Name Description
resource_group_id Resource group generated id
resource_group_location Resource group location (region)
resource_group_name Resource group name

Related documentation

Azure Lock management documentation: docs.microsoft.com/en-us/azure/azure-resource-manager/management/lock-resources