Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom landing zone variable validation only checks first key #61

Closed
larsakerlund opened this issue Mar 23, 2021 · 2 comments
Closed

Custom landing zone variable validation only checks first key #61

larsakerlund opened this issue Mar 23, 2021 · 2 comments
Assignees
Labels
enhancement New feature or request

Comments

@larsakerlund
Copy link
Contributor

The validation of the custom_landing_zone keys only checks the value of the first key. This makes it possible to set invalid key names (which fails later).

Example inputs:

# Passes validation (and fails during archetype variable validation)
custom_landing_zones = {
  (var.root_id) = {
    display_name               = var.root_name
    parent_management_group_id = data.azurerm_client_config.current.tenant_id
    subscription_ids           = []
    archetype_config = {
      archetype_id   = "es_root"
      parameters     = {}
      access_control = {}
    }
  }

  test_key = {
    display_name               = "Test"
    parent_management_group_id = var.root_id
    subscription_ids           = []
    archetype_config = {
      archetype_id   = "es_landing_zones"
      parameters     = {}
      access_control = {}
    }
  }
}

# Does not pass validation 
custom_landing_zones = {
  test_root = {
    display_name               = var.root_name
    parent_management_group_id = data.azurerm_client_config.current.tenant_id
    subscription_ids           = []
    archetype_config = {
      archetype_id   = "es_root"
      parameters     = {}
      access_control = {}
    }
  }
}
@krowlandson
Copy link
Contributor

Great catch... I had forgotten to go back to update this logic.

We're reviewing this PR in conjunction with PR #59 so I would appreciate your response to my question on the related issue #58 before we merge these.

Thank you

@krowlandson
Copy link
Contributor

Closing as fixed by #62

@ghost ghost locked as resolved and limited conversation to collaborators Dec 14, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants