Let's say I have an string type variable called "env" (the value can be "dev" or "production")
With the following data, how can I get the value of setting1 for the first element in "dev" or "production"?
locals{
environments = {
dev = {
"hello001" = {
setting1 = "abc"
setting2 = "def"
setting3 = "ghi"
}
"hello002" = {
setting1 = "jkl"
setting2 = "mno"
setting3 = "pqr"
}
}
production = {
"hello003" = {
setting1 = "abc"
setting2 = "def"
setting3 = "ghi"
}
"hello004" = {
setting1 = "jkl"
setting2 = "mno"
setting3 = "pqr"
}
}
}
}
I tried with
local.environments[var.env][0].setting1
but getting the error "This value does not have any indices"
map(map(map(object(...string...)))tomap(map(list(object(...string...)))?