Skip to content

Instantly share code, notes, and snippets.

@klang
Created June 21, 2019 06:48
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save klang/f3464f79f20e34c8959cf153c7c4c951 to your computer and use it in GitHub Desktop.
Terraform 0.12+ does not support "."'s in hash keys
locals {
project = "project-name"
env = {
# default.name = "default-workspace-name" # <= tf0.11 notation
default_name = "default-workspace-name" # <= tf0.12 notation
# other.name = "other-workspace-name"
other_name = "other-workspace-name"
}
name = "${lookup(local.env, "${terraform.workspace}_name")}"
}
output name { value = "${local.name}"}
# terraform workspace new other
# terraform apply -auto-approve
# terraform workspace select default
# terraform apply -auto-approve
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment