diff --git a/README.md b/README.md index c0de2d1..5855c33 100644 --- a/README.md +++ b/README.md @@ -120,6 +120,7 @@ Available targets: | attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | | delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | | enabled | Set to false to prevent the module from creating or accessing any resources | `bool` | `true` | no | +| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no | | name | The Name of the application or solution (e.g. `bastion` or `portal`) | `string` | n/a | yes | | namespace | Namespace (e.g. `eg` or `cp`) | `string` | n/a | yes | | parent\_zone\_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`) | `string` | `""` | no | diff --git a/docs/terraform.md b/docs/terraform.md index 257fbf1..3733f6f 100644 --- a/docs/terraform.md +++ b/docs/terraform.md @@ -21,6 +21,7 @@ | attributes | Additional attributes (e.g. `1`) | `list(string)` | `[]` | no | | delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | `string` | `"-"` | no | | enabled | Set to false to prevent the module from creating or accessing any resources | `bool` | `true` | no | +| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no | | name | The Name of the application or solution (e.g. `bastion` or `portal`) | `string` | n/a | yes | | namespace | Namespace (e.g. `eg` or `cp`) | `string` | n/a | yes | | parent\_zone\_id | ID of the hosted zone to contain this record (or specify `parent_zone_name`) | `string` | `""` | no | diff --git a/main.tf b/main.tf index 68354f4..033c57a 100644 --- a/main.tf +++ b/main.tf @@ -1,12 +1,13 @@ module "label" { - source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.17.0" - namespace = var.namespace - stage = var.stage - name = var.name - delimiter = var.delimiter - attributes = var.attributes - tags = var.tags - enabled = var.enabled + source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.17.0" + namespace = var.namespace + stage = var.stage + environment = var.environment + name = var.name + delimiter = var.delimiter + attributes = var.attributes + tags = var.tags + enabled = var.enabled } locals { @@ -28,6 +29,7 @@ data "template_file" "zone_name" { vars = { namespace = var.namespace + environment = var.environment name = var.name stage = var.stage id = module.label.id diff --git a/variables.tf b/variables.tf index 76f28c4..4e2f080 100644 --- a/variables.tf +++ b/variables.tf @@ -8,6 +8,12 @@ variable "namespace" { description = "Namespace (e.g. `eg` or `cp`)" } +variable "environment" { + default = "" + type = string + description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'" +} + variable "stage" { type = string description = "Stage (e.g. `prod`, `dev`, `staging`)"