From b469077bdad11b415ec6b8d90d4ad5e59da0452a Mon Sep 17 00:00:00 2001 From: Erik Osterman Date: Thu, 28 Sep 2017 14:50:39 -0700 Subject: [PATCH] Disambiguate logs (#5) --- main.tf | 17 +++++++++-------- variables.tf | 5 +++++ 2 files changed, 14 insertions(+), 8 deletions(-) diff --git a/main.tf b/main.tf index bcc7698..b43f979 100644 --- a/main.tf +++ b/main.tf @@ -4,7 +4,7 @@ module "origin_label" { stage = "${var.stage}" name = "${var.name}" delimiter = "${var.delimiter}" - attributes = ["origin"] + attributes = ["${compact(concat(var.attributes, list("origin")))}"] tags = "${var.tags}" } @@ -18,7 +18,7 @@ module "logs" { stage = "${var.stage}" name = "${var.name}" delimiter = "${var.delimiter}" - attributes = ["logs"] + attributes = ["${compact(concat(var.attributes, list("origin", "logs")))}"] tags = "${var.tags}" prefix = "${var.log_prefix}" standard_transition_days = "${var.log_standard_transition_days}" @@ -27,12 +27,13 @@ module "logs" { } module "distribution_label" { - source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.2.1" - namespace = "${var.namespace}" - stage = "${var.stage}" - name = "${var.name}" - delimiter = "${var.delimiter}" - tags = "${var.tags}" + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.2.1" + namespace = "${var.namespace}" + stage = "${var.stage}" + name = "${var.name}" + attributes = "${var.attributes}" + delimiter = "${var.delimiter}" + tags = "${var.tags}" } resource "aws_cloudfront_distribution" "default" { diff --git a/variables.tf b/variables.tf index dd5abc5..e5dad45 100644 --- a/variables.tf +++ b/variables.tf @@ -4,6 +4,11 @@ variable "namespace" {} variable "stage" {} +variable "attributes" { + type = "list" + default = [] +} + variable "tags" { default = {} }