Created
September 23, 2019 19:59
-
-
Save phinze/adb9ee8378c0be3d6b7680afafab99d0 to your computer and use it in GitHub Desktop.
Untested sketch of a workaround for terraform.workspace not resolving in Terraform Cloud.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
variable "org" {} | |
data "tfe_workspace_ids" "all" { | |
names = ["*"] | |
organization = var.org | |
} | |
resource "tfe_variable" "workspace_name" { | |
for_each = tfe_workspace_ids.all.*.id | |
workspace = this.key | |
key = "workspace_name" | |
value = split("/", this.key)[1] | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment