Skip to content

Commit

Permalink
Merge pull request #2 from schubergphilis/mgmt-group-csp-assoc
Browse files Browse the repository at this point in the history
feat: add MGMT Group Association for CSP
  • Loading branch information
Dennisvandermeulen authored Nov 28, 2024
2 parents df6564e + 6e2581d commit dadaff9
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ No modules.
| Name | Type |
|------|------|
| [azapi_resource.subscription](https://registry.terraform.io/providers/azure/azapi/2.0.1/docs/resources/resource) | resource |
| [azurerm_management_group_subscription_association.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/resources/management_group_subscription_association) | resource |
| [restful_operation.subscription](https://registry.terraform.io/providers/magodo/restful/0.14.0/docs/resources/operation) | resource |
| [azurerm_billing_mca_account_scope.this](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/billing_mca_account_scope) | data source |
| [azurerm_client_config.current](https://registry.terraform.io/providers/hashicorp/azurerm/latest/docs/data-sources/client_config) | data source |
Expand Down
2 changes: 1 addition & 1 deletion examples/csp/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
azapi = {
source = "azure/azapi"
version = "1.15.0"
version = "2.0.1"
}
}
}
Expand Down
2 changes: 1 addition & 1 deletion examples/ea/terraform.tf
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ terraform {
}
azapi = {
source = "azure/azapi"
version = "1.15.0"
version = "2.0.1"
}
}
}
Expand Down
6 changes: 6 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,9 @@ data "azurerm_subscriptions" "this" {
display_name_contains = var.name
depends_on = [restful_operation.subscription, azapi_resource.subscription]
}

resource "azurerm_management_group_subscription_association" "this" {
count = var.channel == "csp" ? 1 : 0
management_group_id = var.parent_management_group_id
subscription_id = data.azurerm_subscriptions.this.subscriptions[0].id
}

0 comments on commit dadaff9

Please sign in to comment.