resource "azurerm_resource_group" "this" {
name = var.name
location = var.location
tags = var.tags
}
resource "azurerm_management_lock" "rg_lock" {
count = var.lock_level != null && var.lock_level != "" ? 1 : 0
name = "lock-${var.name}"
scope = azurerm_resource_group.this.id
lock_level = var.lock_level
notes = "Resource Group '${var.name}' is locked with '${var.lock_level}' level."
}
No requirements.
No modules.
Name |
Description |
Type |
Default |
Required |
location |
The location (region) the resource should be put in, e.g. uksouth |
string |
n/a |
yes |
lock_level |
The name of the lock_level, can only be CanNotDelete or Readonly |
string |
null |
no |
name |
The name of the resource |
string |
n/a |
yes |
tags |
The tags assigned to the resource |
map(string) |
n/a |
yes |
Name |
Description |
rg_id |
Resource group generated id |
rg_location |
Resource group location (region) |
rg_lock_id |
The id of the resource group lock |
rg_lock_level |
The lock-level of the resource group lock |
rg_name |
The name of the resource group |
rg_tags |
The tags of the resource group |