Skip to content

Commit

Permalink
Fix formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
Steven Nemetz committed Mar 29, 2018
1 parent f4a327a commit 96d827e
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 7 deletions.
12 changes: 6 additions & 6 deletions examples/tags/main.tf
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module "tags" {
source = "../../"
names = ["CapMe"]
environment = "Dev"
organization = "CorpXyZ"
attributes = ["role", "policy", "use", ""]
tags = "${map("Key", "Value")}"
source = "../../"
names = ["CapMe"]
environment = "Dev"
organization = "CorpXyZ"
attributes = ["role", "policy", "use", ""]
tags = "${map("Key", "Value")}"
}
4 changes: 4 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,11 @@ data "null_data_source" "ids-trunc-attr" {
# TODO: need to change to list of maps for all label names
data "null_data_source" "tags" {
count = "${module.enabled.value ? length(var.names) : 0}"

inputs = {
#TODO: only add Organization if not ""
tag_keys = "Name,Environment,Organization,Terraform"

tag_vals = "${join(",",list(
element(data.null_data_source.ids.*.outputs.id, count.index),
local.env,
Expand All @@ -129,6 +131,7 @@ data "null_data_source" "tags" {
)}"
}
}

/*
data "null_data_source" "tag_list" {
count = "${module.enabled.value ? length(var.names) : 0}"
Expand Down Expand Up @@ -157,3 +160,4 @@ resource "null_resource" "this" {
}
}
*/

3 changes: 2 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ output "organization" {
# TODO: need to change to list of maps for all label names
output "tags" {
description = "Tags map merged with standard tags"
value = "${merge(

value = "${merge(
zipmap(
split(",", element(concat(data.null_data_source.tags.*.outputs.tag_keys, list("")),0)),
split(",", element(concat(data.null_data_source.tags.*.outputs.tag_vals, list("")),0))),
Expand Down

0 comments on commit 96d827e

Please sign in to comment.