Looking for advise as to the best way to handle this. I’m creating a module that creates a documentDB database instance, and want to to use for-each or count to support creating several DB instances from a structure like this in the terragrunt.hcl file. I’m not sure if nodes should be a list(map(string)) or do it as a map(map(string)
Can you elaborate on “This isn’t working”? What error messages (if any) are you getting? As far as I know, this should work if you are using Terraform 0.13.
If you are using Terraform 0.13, my guess is that the issue is probably a type issue, where you are using a list of objects for the for_each argument instead of a map. See the official docs for more info on this.
but terraform errors with “The environment variable TF_VAR_nodes does not contain a valid value for
variable “nodes”: element “prod”: element “allowed_security_groups”: string
required.”
I’m assuming this is because of the map(map(string)) type.