TF Error "The given key does not identify an element in this collection value" when deploying account baseline #20
Unanswered
security-penguin
asked this question in
Questions & Answers
Replies: 1 comment 2 replies
-
I would make sure that the actual root account name is specified in # stacks/catalog/account-map.yaml
components:
terraform:
account-map:
vars:
root_account_aws_name: root # <---- this is your unique name for your root account. It depends on whatever you named the account when created
root_account_account_name: core-root # <---- this is always "core-root" with the default refarch |
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I am currently going through the quick start and I have just deployed the accounts successfully via
atmos workflow deploy/accounts -f accounts
and I have runatmos terraform apply account-map -s core-gbl-root
to build the account maps.But when I run
atmos workflow deploy/account-settings -f accounts
I get the following error:`Planning failed. Terraform encountered an error while generating this plan.
╷
│ Error: Invalid index
│
│ on ../account-map/modules/iam-roles/main.tf line 46, in locals:
│ 46: is_root_user = local.current_identity_account == local.account_map.full_account_map[local.root_account_name]
│ ├────────────────
│ │ local.account_map.full_account_map is object with 12 attributes
│ │ local.root_account_name is "core-root"
│
│ The given key does not identify an element in this collection value.`
Checking the account map I see the line:
root_account_account_name = "core-root"
so it doesn't look like a object with attributes. What are some suggested steps to troubleshoot this?Beta Was this translation helpful? Give feedback.
All reactions