terraform-azurerm-caf-enterprise-scale
terraform-azurerm-caf-enterprise-scale copied to clipboard
Problems importing subscriptions
Community Note
- Please vote on this issue by adding a 👍 reaction to the original issue to help the community and maintainers prioritize this request
- Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
- If you are interested in working on this issue or have submitted a pull request, please leave a comment
Versions
terraform: 1.7.0
azure provider: AzureRM 3.88.0, AzApi v1.12
module: Azure/caf-enterprise-scale/azurerm v4.2.0 or 5.0.3
Description
Describe the bug
We had an existing deployment with strict_subscription_association = true. This was done with 4.2.0 version of the module. We tried to disable strict association, because we used LZ-VENDING also but was unable to import the three subscriptions (identity, connectivity and management). Version 5.0.3 gave the same error.
I tried to import the associations but was unable to do anything.
Steps to Reproduce
- Have existing environment (first deployed with 4.2.0 with the default value of strict sub association = true).
- Started using LZ-VENDING (made multiple subs under online) and tried to run this again
- Terraform wanted to affect MG association with the management, connectivity and identity subs
- Tried to execute 'terraform import' to the subs but was unable to do it. See error from description!
- Tried command like the one below, but I got error at the end
- Tried updating module to 5.0.3 but got the same error
terraform import module.enterprise_scale[0].azurerm_management_group_subscription_association.enterprise_scale["/providers/Microsoft.Management/managementGroups/cloud-connectivity/subscriptions/b12c2937-3458-4cf1-b749-331efd25c201"] /providers/Microsoft.Management/managementGroups/cloud-connectivity/subscriptions/b12c2937-3458-4cf1-b749-331efd25c201