Azure Base Resource Group

This page shows how to write Terraform for Base Resource Group and write them securely.

azurerm_resource_group (Terraform)

The Resource Group in Base can be configured in Terraform with the resource name azurerm_resource_group. The following sections describe 8 examples of how to use the resource and its parameters.

Example Usage from GitHub

main.tf#L5
resource "azurerm_resource_group" "loganalytics" {
  name     = var.resourcegroups.loganalytics
  location = var.location
}

resource "azurerm_resource_group" "automationaccount" {
rg.tf#L16
resource "azurerm_resource_group" "Identity" {
  name     = "RG-TF-VM-Identity"
  location = "southeastasia"
  tags = {
    environment = "Production"
    CreatedBy = "Suparuek P"
main.tf#L3
resource "azurerm_resource_group" "rg1" {
  name     = "tf-rg1"
  location = "uksouth"

    tags = {
        environment = "Terraform RG1"
RESOURCES-GROUP.tf#L1
resource "azurerm_resource_group" "db" {
  name     = var.db_rg_name
  location = var.location
}

resource "azurerm_resource_group" "web" {
RESOURCES-GROUP.tf#L1
resource "azurerm_resource_group" "db" {
  name     = var.db_rg_name
  location = var.location
}

resource "azurerm_resource_group" "web" {
RESOURCES-GROUP.tf#L1
resource "azurerm_resource_group" "db" {
  name     = var.db_rg_name
  location = var.location
}

resource "azurerm_resource_group" "web" {
RESOURCES-GROUP.tf#L1
resource "azurerm_resource_group" "db" {
  name     = var.db_rg_name
  location = var.location
}

resource "azurerm_resource_group" "web" {
RESOURCES-GROUP.tf#L1
resource "azurerm_resource_group" "db" {
  name     = var.db_rg_name
  location = var.location
}

resource "azurerm_resource_group" "web" {

Review your Terraform file for Azure best practices

Shisho Cloud, our free checker to make sure your Terraform configuration follows best practices, is available (beta).

Parameters

Explanation in Terraform Registry

Manages a Resource Group. -> Note: Azure automatically deletes any Resources nested within the Resource Group when a Resource Group is deleted. -> Version 2.72 and later of the Azure Provider include a Feature Toggle which can error if there are any Resources left within the Resource Group at deletion time. This Feature Toggle is disabled by default but will become enabled by default in 3.0, and is intended to avoid the unintentional destruction of resources managed outside of Terraform (for example, provisioned by an ARM Template). See the Features block documentation for more information on Feature Toggles within Terraform.

Azure Resource Manager Example

Azure Resource Manager code does not have the related resource.

Frequently asked questions

What is Azure Base Resource Group?

Azure Base Resource Group is a resource for Base of Microsoft Azure. Settings can be wrote in Terraform.

Where can I find the example code for the Azure Base Resource Group?

For Terraform, the johankardell/azure, supiwmi/infa and mibrahimmalik/terraform_cloud source code examples are useful. See the Terraform Example section for further details.

security-icon

Automate config file reviews on your commits

Fix issues in your infrastructure as code with auto-generated patches.