Skip to content

Commit

Permalink
fix(DMVP-0000): adjust values to be returned as map instead of list
Browse files Browse the repository at this point in the history
  • Loading branch information
aramkarapetian committed Sep 20, 2023
1 parent a9b2469 commit 449251f
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
4 changes: 4 additions & 0 deletions modules/variable-set-reader/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,7 @@ data "tfe_variable_set" "this" {
data "tfe_variables" "this" {
variable_set_id = data.tfe_variable_set.this.id
}

locals {
results = { for value in data.tfe_variables.this.variables : value.name => value.value }
}
2 changes: 1 addition & 1 deletion modules/variable-set-reader/output.tf
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
output "values" {
value = data.tfe_variables.this.variables
value = local.results
sensitive = true
}
4 changes: 2 additions & 2 deletions modules/variable-set-reader/tests/basic/1-example.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
variable "tfc_token" {}
module "basic" {
source = "../.."
name = "some-test-variable-set"
org = "dasmeta-testing"
name = "aws_credentials"
org = "dasmeta"

tfc_token = var.tfc_token
}

0 comments on commit 449251f

Please sign in to comment.