Skip to content

Instantly share code, notes, and snippets.

@klang
Created Jun 21, 2019
Embed
What would you like to do?
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