I have this in my tf file
existing_alerting_sns_topic = "arn:aws:sns:${var.aws_region}:${module.account.id[“ab-cd”]}:cd-prod-${var.aws_region}-slack-notifier-infrastructure-alerts"
but I don’t have anything specified in my variable.tf yet. when I run the terraform plan I do see the below error. Do I need to specify anything like map(any) or map(list(string)) ??
│
│ existing_alerting_sns_topic = "arn:aws:sns:${var.aws_region}:${module.account.id[“ab-cd”]}:cd-prod-${var.aws_region}-slack-notifier-infrastructure-alerts"
│ ├────────────────
│ │ module.account.id is map of string with 105 elements
│
│ The given key does not identify an element in this collection value```
Thanks!
2
Answers
Thanks for looking into my question. I have figured out the error was about the case sensitive letters(ab-CD) I have mentioned for the account name in the line
${module.account.id[“ab-cd”]}
Thanks!It simply says that:
account
‘s outputid
is a huge map of strings (105) butab-cd
.Maybe a typo in the outputs of the account module?