Skip to content

Commit

Permalink
add filename(s), defaults
Browse files Browse the repository at this point in the history
  • Loading branch information
badra001 committed Jul 30, 2025
1 parent 852dd32 commit c1da89f
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 3 deletions.
2 changes: 1 addition & 1 deletion base-label/outputs.tf
Original file line number Diff line number Diff line change
@@ -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
}
2 changes: 1 addition & 1 deletion base-label/prefixes.tf
Original file line number Diff line number Diff line change
@@ -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" {
Expand Down
17 changes: 16 additions & 1 deletion base-label/variables.tf
Original file line number Diff line number Diff line change
@@ -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."
}
}
Expand Down

0 comments on commit c1da89f

Please sign in to comment.