Skip to content

Commit

Permalink
Use the latest label module to support the environment attribute (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
adamcrews authored and aknysh committed Jan 6, 2020
1 parent f989b4d commit 9d23e8f
Show file tree
Hide file tree
Showing 4 changed files with 55 additions and 45 deletions.
13 changes: 7 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -123,20 +123,21 @@ Available targets:
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `1`) | list(string) | `<list>` | 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 |
| dns_name | Name of the CNAME record to create | string | `` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| encrypted | If true, the file system will be encrypted | bool | `false` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
| mount_target_ip_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target | string | `` | no |
| name | 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 |
| performance_mode | The file system performance mode. Can be either `generalPurpose` or `maxIO` | string | `generalPurpose` | no |
| provisioned_throughput_in_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with `throughput_mode` set to provisioned | string | `0` | no |
| region | AWS Region | string | - | yes |
| security_groups | Security group IDs to allow access to the EFS | list(string) | - | yes |
| stage | Stage (_e.g._ `prod`, `dev`, `staging`) | string | `` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
| subnets | Subnet IDs | list(string) | - | yes |
| tags | Additional tags (e.g. `{ BusinessUnit = "XYZ" }` | map(string) | `<map>` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map(string) | `<map>` | no |
| throughput_mode | Throughput mode for the file system. Defaults to bursting. Valid values: `bursting`, `provisioned`. When using `provisioned`, also set `provisioned_throughput_in_mibps` | string | `bursting` | no |
| vpc_id | VPC ID | string | - | yes |
| zone_id | Route53 DNS zone ID | string | `` | no |
Expand Down Expand Up @@ -243,7 +244,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 @@ -3,20 +3,21 @@
| Name | Description | Type | Default | Required |
|------|-------------|:----:|:-----:|:-----:|
| attributes | Additional attributes (e.g. `1`) | list(string) | `<list>` | 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 |
| dns_name | Name of the CNAME record to create | string | `` | no |
| enabled | Set to false to prevent the module from creating any resources | bool | `true` | no |
| encrypted | If true, the file system will be encrypted | bool | `false` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | string | `` | no |
| mount_target_ip_address | The address (within the address range of the specified subnet) at which the file system may be mounted via the mount target | string | `` | no |
| name | 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 |
| performance_mode | The file system performance mode. Can be either `generalPurpose` or `maxIO` | string | `generalPurpose` | no |
| provisioned_throughput_in_mibps | The throughput, measured in MiB/s, that you want to provision for the file system. Only applicable with `throughput_mode` set to provisioned | string | `0` | no |
| region | AWS Region | string | - | yes |
| security_groups | Security group IDs to allow access to the EFS | list(string) | - | yes |
| stage | Stage (_e.g._ `prod`, `dev`, `staging`) | string | `` | no |
| stage | Stage, e.g. 'prod', 'staging', 'dev', OR 'source', 'build', 'test', 'deploy', 'release' | string | `` | no |
| subnets | Subnet IDs | list(string) | - | yes |
| tags | Additional tags (e.g. `{ BusinessUnit = "XYZ" }` | map(string) | `<map>` | no |
| tags | Additional tags (e.g. `map('BusinessUnit','XYZ')` | map(string) | `<map>` | no |
| throughput_mode | Throughput mode for the file system. Defaults to bursting. Valid values: `bursting`, `provisioned`. When using `provisioned`, also set `provisioned_throughput_in_mibps` | string | `bursting` | no |
| vpc_id | VPC ID | string | - | yes |
| zone_id | Route53 DNS zone ID | string | `` | no |
Expand Down
17 changes: 9 additions & 8 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,12 +1,13 @@
module "label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.15.0"
enabled = var.enabled
namespace = var.namespace
name = var.name
stage = var.stage
delimiter = var.delimiter
attributes = var.attributes
tags = var.tags
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
enabled = var.enabled
namespace = var.namespace
name = var.name
stage = var.stage
environment = var.environment
delimiter = var.delimiter
attributes = var.attributes
tags = var.tags
}

locals {
Expand Down
59 changes: 33 additions & 26 deletions variables.tf
Original file line number Diff line number Diff line change
@@ -1,24 +1,49 @@
variable "enabled" {
type = bool
description = "Set to false to prevent the module from creating any resources"
default = true
variable "namespace" {
type = string
default = ""
description = "Namespace, which could be your organization name or abbreviation, e.g. 'eg' or 'cp'"
}

variable "namespace" {
variable "environment" {
type = string
description = "Namespace (_e.g._ `eg` or `cp`)"
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 = "Name (_e.g._ `app`)"
default = ""
description = "Solution name, e.g. 'app' or 'jenkins'"
}

variable "enabled" {
type = bool
default = true
description = "Set to false to prevent the module from creating any resources"
}

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

variable "attributes" {
type = list(string)
default = []
description = "Additional attributes (e.g. `1`)"
}

variable "tags" {
type = map(string)
default = {}
description = "Additional tags (e.g. `map('BusinessUnit','XYZ')`"
}

variable "security_groups" {
Expand Down Expand Up @@ -47,24 +72,6 @@ variable "zone_id" {
default = ""
}

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

variable "attributes" {
type = list(string)
description = "Additional attributes (e.g. `1`)"
default = []
}

variable "tags" {
type = map(string)
description = "Additional tags (e.g. `{ BusinessUnit = \"XYZ\" }`"
default = {}
}

variable "encrypted" {
type = bool
description = "If true, the file system will be encrypted"
Expand Down

0 comments on commit 9d23e8f

Please sign in to comment.