Hello,
Using Terraform 0.11.
I’m trying to get a string of account id’s and names out of aws_organizations_organization.
The format I want is:
"accountid": "account name" - "accountid2":"account name2"
I thought this would be easy as
data "aws_organizations_organization" "org" {}
locals {
accountid_name_map = "${formatlist("\"%s\" - \"%s\"", data.aws_organizations_organization.org.accounts.*.id, data.aws_organizations_organization.org.accounts.*.name)}"
}
yet this keeps returning me an error like
formatlist: formatlist requires at least one list argument
I’ve been ttrying all kinds of iterations, but sofar it’s stumping me. How do I get this to work?