generated from cloudposse/terraform-example-module
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adds a handful of fixes + enhancements to the module (#6)
Co-authored-by: John C. Bland II <johncblandii@users.noreply.github.com> Co-authored-by: Dan Meyers <danjbh@users.noreply.github.com> Co-authored-by: actions-bot <58130806+actions-bot@users.noreply.github.com>
- Loading branch information
1 parent
c856676
commit 3062c72
Showing
22 changed files
with
153 additions
and
99 deletions.
There are no files selected for viewing
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
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
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
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
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
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
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
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
File renamed without changes.
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
output "example" { | ||
description = "Outputs for the example module" | ||
value = module.example | ||
output "global_workspace" { | ||
value = module.example.global_workspace | ||
description = "Configuration information for the global workspace." | ||
} | ||
|
||
output "environment_workspaces" { | ||
value = module.example.environment_workspaces | ||
description = "A list of environment workspaces & their configurations." | ||
} | ||
|
||
output "project_workspaces" { | ||
value = module.example.project_workspaces | ||
description = "A list of project workspaces & their configurations." | ||
} |
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,18 @@ | ||
locals { | ||
# We compute the values ahead of time to deal with ternary type conversion issues. | ||
# The jsonencode / replaces below translate a JSON encoded string to proper HCL2 | ||
variables = merge(var.variables, { | ||
for key, val in var.variables : | ||
key => replace(replace(jsonencode(val), "/(\".*?\"):/", "$1 = "), "/= null/", "= \"\"") if var.hcl | ||
}) | ||
} | ||
resource "tfe_variable" "this" { | ||
for_each = var.variables | ||
for_each = local.variables | ||
|
||
category = var.category | ||
hcl = var.hcl | ||
key = var.category == "env" ? "TF_VAR_${each.key}" : each.key | ||
sensitive = var.sensitive | ||
# translate a JSON encoded string to proper HCL2 | ||
value = var.hcl ? replace(replace(jsonencode(each.value), "/(\".*?\"):/", "$1 = "), "/= null/", "= \"\"") : jsonencode(each.value) | ||
category = var.category | ||
hcl = var.hcl | ||
key = var.category == "env" ? "TF_VAR_${each.key}" : each.key | ||
sensitive = var.sensitive | ||
value = each.value | ||
workspace_id = var.workspace_id | ||
} |
Oops, something went wrong.