terraform-azurerm-caf-enterprise-scale icon indicating copy to clipboard operation
terraform-azurerm-caf-enterprise-scale copied to clipboard

Problems importing subscriptions

Open JyrkiHei opened this issue 1 year ago • 2 comments

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.

image

I tried to import the associations but was unable to do anything.

Steps to Reproduce

  1. Have existing environment (first deployed with 4.2.0 with the default value of strict sub association = true).
  2. Started using LZ-VENDING (made multiple subs under online) and tried to run this again
  3. Terraform wanted to affect MG association with the management, connectivity and identity subs
  4. Tried to execute 'terraform import' to the subs but was unable to do it. See error from description!
  5. Tried command like the one below, but I got error at the end
  6. 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

Screenshots

Additional context

JyrkiHei avatar Jan 25 '24 00:01 JyrkiHei