Skip to content

maythamfahmi/terraform-azurerm-resource-group

 
 

Repository files navigation

Terraform module to create Azure Resource Group

This module creates Azure Resource Group. It also has the option to create a lock on the Resource Group scope. This module also validates the name according to the Azure Resource naming restrictions.

NOTE: To use the lock level option the service principal must have the "Owner" or "User Access Administrator" roles.

Usage

provider "azurerm" {
  features {}
}

module "rg" {
  source = "../../"

  name     = "rgdemo"
  location = "North Europe"

  tags = {
    ManagedBy   = "Terraform"
    Environment = "sandbox"
  }
}

Requirements

Name Version
terraform >= 0.13.0
azurerm >= 2.41.0

Providers

Name Version
azurerm >= 2.41.0

Modules

No Modules.

Resources

Name
azurerm_management_lock
azurerm_resource_group

Inputs

Name Description Type Default Required
location The Azure Region where the Resource Group should exist.
Changing this forces a new Resource Group to be created.
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 The Name which should be used for this Resource Group.
Changing this forces a new Resource Group to be created.
string n/a yes
tags A mapping of tags which should be assigned to the Resource Group. map(string) {} no

Outputs

Name Description
id The Resource Group id.
location The Resource Group location.
name The Resource Group name.
tags The Resource Group tags.

Run tests

cd test/
go test -v

pre-commit hooks

This repository uses pre-commit.

To install execute:

pre-commit install --install-hooks -t commit-msg

To run the hooks you need to install:

References

About

Terraform module to create Azure Resource Group

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Go 63.7%
  • HCL 36.3%