Azure / terraform-azurerm-caf-enterprise-scale

Azure landing zones Terraform module
https://aka.ms/alz/tf
MIT License
856 stars 565 forks source link

Invalid index error #17

Closed diesher closed 4 years ago

diesher commented 4 years ago

I am trying to deploy the customized module and keep getting following error message:

` 64: archetype_definition = local.archetype_definitions[local.archetype_id] |---------------- | local.archetype_definitions is object with 13 attributes | local.archetype_id is "customer_online"

The given key does not identify an element in this collection value. The custom landing zone declaration looks like this:

------------------------------------------------------

customer-web-prod = {
  display_name               = "Prod Web Applications"
  parent_management_group_id = "cirr-landing-zones"
  subscription_ids           = []
  archetype_config = {
    archetype_id = "customer_online"
    parameters   = {}
    access_control = {}
  }
}

`

Can anyone help me solve this?

Thank you!

turbut commented 4 years ago

Did you created custom archetype template in the library called "customer_online" ? Otherwise you could use: archetype_id = "es_demo_online"

diesher commented 4 years ago

Did you created custom archetype template in the library called "customer_online" ? Otherwise you could use: archetype_id = "es_demo_online"

Thank you very much for your reply. It is really helpful. May I ask you another question if you don't mind?

I would like to deploy an hub and spoke architecture using this framework. I tried to configure my connectivity archetype as followed: ` archetype_config_overrides = {

------------------------------------------------------

# This variable is used to configure the built-in
# Enterprise-scale Management Groups with alternate
# (or custom) name and parameters.
# Simply uncomment the one(s) you want to modify and
# provide the required values.
#------------------------------------------------------#
# root = {

#------------------------------------------------------#
# EXAMPLES
#------------------------------------------------------#
connectivity = {
  archetype_id = "es_connectivity_hub_and_spoke"
  parameters = {
    ES-Deploy-HUB = {
    }
  }
  access_control = {
    role_definition_name = {
#       "member_1_object_id",
#       "member_2_object_id",
#       "member_3_object_id",
    }
  }
}
#------------------------------------------------------#

} ` Unfortunately it is not working as expected. Any hint regarding the configuration?

Thanx!

krowlandson commented 4 years ago

Hi @diesher ... We are still developing the module so features like network resource deployments are still pending whilst we decide the most appropriate approach. Our main blocker a the moment is how to cleanly handle resource deployment across multiple Subscriptions within a single Terraform module. This is particularly challenging when many of these components from the architecture are optional.

I also cannot offer an ETA for this particular feature at the moment, but we are actively working on a solution for centralised logging within the Management Subscription.

krowlandson commented 4 years ago

Did you created custom archetype template in the library called "customer_online" ? Otherwise you could use: archetype_id = "es_demo_online"

Hopefully this helped, but it's worth keeping in mind that this particular archetype_id is specifically for the demo Landing Zones so may be changed in future releases.

I think we will need to include a "default_empty" archetype definition for this type of scenario where the Landing Zone is simply intended to inherit policies and access control from the parent hierarchy.

Will try to add this to the next release.

diesher commented 4 years ago

hi @krowlandson thank you for your reply and your efforts.