Skip to content

Instantly share code, notes, and snippets.

@lukaszkorecki
Created March 7, 2020 19:50
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lukaszkorecki/038985b187d3f51f2929117c2505167d to your computer and use it in GitHub Desktop.
Save lukaszkorecki/038985b187d3f51f2929117c2505167d to your computer and use it in GitHub Desktop.
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