Azure Management Group Subscription Association
This page shows how to write Terraform for Management Group Subscription Association and write them securely.
azurerm_management_group_subscription_association (Terraform)
The Group Subscription Association in Management can be configured in Terraform with the resource name azurerm_management_group_subscription_association
. The following sections describe 2 examples of how to use the resource and its parameters.
Example Usage from GitHub
resource "azurerm_management_group_subscription_association" "add_subscription_to_mg" {
management_group_id = var.management_group_id
subscription_id = azurerm_subscription.create_subscription.id
resource "azurerm_management_group_subscription_association" "mg_sub" {
for_each = toset(local.subscription_ids)
management_group_id = azurerm_management_group.mgmt_group.id
subscription_id = data.azurerm_subscription.sub[each.key].id
}
Parameters
-
id
optional computed - string -
management_group_id
required - string -
subscription_id
required - string -
timeouts
single block
Explanation in Terraform Registry
Manages a Management Group Subscription Association. !> Note: When using this resource, configuring
subscription_ids
on theazurerm_management_group
resource is not supported.
Azure Resource Manager Example
Azure Resource Manager code does not have the related resource.
Frequently asked questions
What is Azure Management Group Subscription Association?
Azure Management Group Subscription Association is a resource for Management of Microsoft Azure. Settings can be wrote in Terraform.
Where can I find the example code for the Azure Management Group Subscription Association?
For Terraform, the chaitanyagm/terraform_code and claranet/terraform-azurerm-management-group source code examples are useful. See the Terraform Example section for further details.