Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Created Mar 7, 2020
Embed
What would you like to do?
variable "env_map" {
default = {
PG_HOST = "some.host.internal"
SOME_SECRET = "pineapples are 1337"
}
}
variable "port" {
default = 1234
}
locals {
environment = flatten([for k, v in merge(var.env_map, { PORT = var.port }) : { name = k, value = v }])
}
output "out" {
value = local.environment
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment