Skip to content

Commit

Permalink
Use the latest label module to support the environment attribute (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcrews authored and aknysh committed Jan 5, 2020
1 parent 96af9b8 commit 166da6f
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 23 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,17 @@ Available targets:
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `1`) | list(string) | `<list>` | no |
| chmod_command | Template of the command executed on the private key file | string | `chmod 600 %v` | no |
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | string | `-` | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
| generate_ssh_key | If set to `true`, new SSH key pair will be created | bool | `false` | no |
| name | Application or solution name (e.g. `app`) | string | - | yes |
| namespace | Namespace (e.g. `eg` or `cp`) | string | `` | no |
| name | Solution name, e.g. 'app' or 'jenkins' | string | `` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
| private_key_extension | Private key extension | string | `` | no |
| public_key_extension | Public key extension | string | `.pub` | no |
| ssh_key_algorithm | SSH key algorithm | string | `RSA` | no |
| ssh_public_key_path | Path to SSH public key directory (e.g. `/secrets`) | string | - | yes |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | `` | no |
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`) | map(string) | `<map>` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map(string) | `<map>` | no |

## Outputs

Expand Down Expand Up @@ -228,7 +229,7 @@ In general, PRs are welcome. We follow the typical "fork-and-pull" Git workflow.

## Copyright

Copyright © 2017-2019 [Cloud Posse, LLC](https://cpco.io/copyright)
Copyright © 2017-2020 [Cloud Posse, LLC](https://cpco.io/copyright)



Expand Down
11 changes: 6 additions & 5 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,17 @@
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `1`) | list(string) | `<list>` | no |
| chmod_command | Template of the command executed on the private key file | string | `chmod 600 %v` | no |
| delimiter | Delimiter to be used between `namespace`, `stage`, `name` and `attributes` | string | `-` | no |
| delimiter | Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes` | string | `-` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
| generate_ssh_key | If set to `true`, new SSH key pair will be created | bool | `false` | no |
| name | Application or solution name (e.g. `app`) | string | - | yes |
| namespace | Namespace (e.g. `eg` or `cp`) | string | `` | no |
| name | Solution name, e.g. 'app' or 'jenkins' | string | `` | no |
| namespace | Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp' | string | `` | no |
| private_key_extension | Private key extension | string | `` | no |
| public_key_extension | Public key extension | string | `.pub` | no |
| ssh_key_algorithm | SSH key algorithm | string | `RSA` | no |
| ssh_public_key_path | Path to SSH public key directory (e.g. `/secrets`) | string | - | yes |
| stage | Stage (e.g. `prod`, `dev`, `staging`) | string | `` | no |
| tags | Additional tags (e.g. map(`BusinessUnit`,`XYZ`) | map(string) | `<map>` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map(string) | `<map>` | no |

## Outputs

Expand Down
15 changes: 8 additions & 7 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
module "label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
namespace = var.namespace
stage = var.stage
name = var.name
attributes = var.attributes
delimiter = var.delimiter
tags = var.tags
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
namespace = var.namespace
stage = var.stage
environment = var.environment
name = var.name
attributes = var.attributes
delimiter = var.delimiter
tags = var.tags
}

locals {
Expand Down
17 changes: 12 additions & 5 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,31 @@
variable "namespace" {
type = string
description = "Namespace (e.g. `eg` or `cp`)"
default = ""
description = "Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp'"
}

variable "environment" {
type = string
default = ""
description = "Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT'"
}

variable "stage" {
type = string
description = "Stage (e.g. `prod`, `dev`, `staging`)"
default = ""
description = "Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release'"
}

variable "name" {
type = string
description = "Application or solution name (e.g. `app`)"
default = ""
description = "Solution name, e.g. 'app' or 'jenkins'"
}

variable "delimiter" {
type = string
default = "-"
description = "Delimiter to be used between `namespace`, `stage`, `name` and `attributes`"
description = "Delimiter to be used between `namespace`, `environment`, `stage`, `name` and `attributes`"
}

variable "attributes" {
Expand All @@ -30,7 +37,7 @@ variable "attributes" {
variable "tags" {
type = map(string)
default = {}
description = "Additional tags (e.g. map(`BusinessUnit`,`XYZ`)"
description = "Additional tags (e.g. `map('BusinessUnit','XYZ')`"
}

variable "ssh_public_key_path" {
Expand Down

0 comments on commit 166da6f

Please sign in to comment.