Is possible to access specific map in list?
My example is working, but I want to use something like jmespath.
${var.deployment.modules.vms[?name == \"foo\"]}
Is it possible?
variable "deployment" {
type = object({
name = string
location = string
tags = object({
owner = string
})
modules = object({
vms = list(object({
name = string
}))
})
})
default = {
name = "dummy"
location = "dummy"
tags = {
owner = "dummy"
}
modules = {
vms = [
{ name = "dummy" },
{ name = "foo"}
]
}
}
}
output "a" {
value = "${element(var.deployment.modules.vms,0)}"
}
output "b" {
value = "${var.deployment.modules.vms[0]}"
}
Thanks