Iterating a map(string) in a map(object) variable

Hi,
I have a terraform variable that is an object map. Within this, is a map, like so:

type = map(object({
     instances= number,
    id= map(string)
  }))

I can use for_each to get the “instances” variable in a resource declaration, but as I can’t do nested for_each, how can I enumerate the string map to get the child keys and values?

Hi @GurdipS5,

You can nest for expressions in the Terraform configuration language, so this is probably a question about shaping the data into the structure you need. Can you show an example of what you are trying to do with the data structure you have?