Azure/terraform-azurerm-lz-vending

bug: Error: could not read properties for Management Group "alztest-sandboxes"

cyb3n3tic opened this issue ยท 1 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

module "caf-enterprise-scale" {
source = "Azure/caf-enterprise-scale/azurerm"
version = "4.2.0"
module "lz_vending" {
source = "Azure/lz-vending/azurerm"
version = "=3.4.1"

Description

I am trying to configure LZ-Vending to move an existing subscription to the Sandbox managementgroup - I have essentially copied the code from Example 5 but on TF Plan I am receiving the error below:

โ”‚ Error: could not read properties for Management Group "alztest-sandboxes"
โ”‚
โ”‚ with module.lz_vending.module.subscription[0].azurerm_management_group_subscription_association.this[0],
โ”‚ on .terraform/modules/lz_vending/modules/subscription/main.tf line 13, in resource "azurerm_management_group_subscription_association" "this":
โ”‚ 13: resource "azurerm_management_group_subscription_association" "this"

Steps to Reproduce

Landing zones have been successfully deployed using caf-enterprise-scale
I am now adding an additional tf file for lz-vending

module "lz_vending" {
source = "Azure/lz-vending/azurerm"
version = "3.4.1"

location = "uksouth"

subscription variables.

subscription_id = "xxxxxxxxxxxxxxxxxxxxxxxxxx"

network_watcher_resource_group_enabled = true

management group association variables.

subscription_management_group_association_enabled = true
subscription_management_group_id = "alztest-sandboxes"

virtual network variables

virtual_network_enabled = true
virtual_networks = {
vnet1 = {
name = "spoke"
address_space = ["192.168.3.0/24"]
resource_group_name = "rg-networking"
hub_peering_enabled = true
hub_network_resource_id = local.hub_networks_by_location["uksouth"].id
}
}
}

Appreciate some guidance please

Couldn't fix this so reset the dev environment and started again!