diff --git a/base-label/outputs.tf b/base-label/outputs.tf index 2c96211..e40d7fc 100644 --- a/base-label/outputs.tf +++ b/base-label/outputs.tf @@ -1,4 +1,4 @@ output "version" { description = "Module version information. Cannot be passed back in tags because it will overwrite other module tags" - value = local.base_tags + value = local.base_tags } diff --git a/base-label/prefixes.tf b/base-label/prefixes.tf index fa3bccb..92f751d 100644 --- a/base-label/prefixes.tf +++ b/base-label/prefixes.tf @@ -1,6 +1,6 @@ locals { _prefixes = yamldecode(file(format("%v/prefixes.yml", path.module)))["prefixes"] - prefixes = { for k, v in local._prefixes : k => v!=null ? format("%v-", v) : "" } + prefixes = { for k, v in local._prefixes : k => v != null ? format("%v-", v) : "" } } output "prefixes" { diff --git a/base-label/variables.tf b/base-label/variables.tf index cac7451..94bee02 100644 --- a/base-label/variables.tf +++ b/base-label/variables.tf @@ -1,19 +1,34 @@ +variable "filename" { + description = "Filename of YAML file with tags (see documentation for structure)" + type = string + default = null +} + +variable "filenames" { + description = "Filenames of YAML file with tags (see documentation for structure). Each will be processed and the resultant tags merged" + type = list(string) + default = [] +} + variable "business" { description = "Business label (organization, program, etc)" type = string + default = null } variable "application" { description = "Application label" type = string + default = null } variable "environment" { description = "Environment label" type = string + default = null validation { - condition = contains(["dev", "test", "qa", "uat", "ite", "stage", "prod", "cre", "sa", "services", "common"], var.environment) + condition = contains(["dev", "test", "qa", "uat", "ite", "stage", "prod", "cre", "sa", "services", "common"], var.environment) || var.environment == null error_message = "The var.environment value invalid. See https://github.e.it.census.gov/terraform/cloud-information/tree/master/aws/documentation/naming-tagging-standard for valid list." } }