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
resource "azurerm_resource_group" "loganalytics" {
name = var.resourcegroups.loganalytics
location = var.location
}
resource "azurerm_resource_group" "automationaccount" {
resource "azurerm_resource_group" "Identity" {
name = "RG-TF-VM-Identity"
location = "southeastasia"
tags = {
environment = "Production"
CreatedBy = "Suparuek P"
resource "azurerm_resource_group" "rg1" {
name = "tf-rg1"
location = "uksouth"
tags = {
environment = "Terraform RG1"
resource "azurerm_resource_group" "db" {
name = var.db_rg_name
location = var.location
}
resource "azurerm_resource_group" "web" {
resource "azurerm_resource_group" "db" {
name = var.db_rg_name
location = var.location
}
resource "azurerm_resource_group" "web" {
resource "azurerm_resource_group" "db" {
name = var.db_rg_name
location = var.location
}
resource "azurerm_resource_group" "web" {
resource "azurerm_resource_group" "db" {
name = var.db_rg_name
location = var.location
}
resource "azurerm_resource_group" "web" {
resource "azurerm_resource_group" "db" {
name = var.db_rg_name
location = var.location
}
resource "azurerm_resource_group" "web" {
Parameters
-
id
optional computed - string -
location
required - string -
name
required - string -
tags
optional - map from string to string -
timeouts
single block
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.