Skip to content

Commit

Permalink
Bump label to 0.16.0; allow environment to be set (#61)
Browse files Browse the repository at this point in the history
Nothing too exciting here: bump the label module to the latest and allow
the `environment` to be set; add $self to contributors.

Co-authored-by: Erik Osterman <[email protected]>
  • Loading branch information
rsrchboy and osterman authored Jul 15, 2020
1 parent e4837ea commit 4c3fc5e
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 13 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,7 @@ Available targets:
| enable\_ecs\_managed\_tags | Specifies whether to enable Amazon ECS managed tags for the tasks within the service | `bool` | `false` | no |
| enable\_icmp\_rule | Specifies whether to enable ICMP on the security group | `bool` | `true` | no |
| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| health\_check\_grace\_period\_seconds | Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers | `number` | `0` | no |
| ignore\_changes\_task\_definition | Whether to ignore changes in container definition and task definition in the ECS service | `bool` | `true` | no |
| launch\_type | The launch type on which to run your service. Valid values are `EC2` and `FARGATE` | `string` | `"FARGATE"` | no |
Expand Down Expand Up @@ -434,8 +435,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply

### Contributors

| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sarkis Varozian][sarkis_avatar]][sarkis_homepage]<br/>[Sarkis Varozian][sarkis_homepage] |
|---|---|---|---|
| [![Erik Osterman][osterman_avatar]][osterman_homepage]<br/>[Erik Osterman][osterman_homepage] | [![Igor Rodionov][goruha_avatar]][goruha_homepage]<br/>[Igor Rodionov][goruha_homepage] | [![Andriy Knysh][aknysh_avatar]][aknysh_homepage]<br/>[Andriy Knysh][aknysh_homepage] | [![Sarkis Varozian][sarkis_avatar]][sarkis_homepage]<br/>[Sarkis Varozian][sarkis_homepage] | [![Chris Weyl][rsrchboy_avatar]][rsrchboy_homepage]<br/>[Chris Weyl][rsrchboy_homepage] |
|---|---|---|---|---|

[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
Expand All @@ -445,6 +446,8 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
[aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png
[sarkis_homepage]: https://github.com/sarkis
[sarkis_avatar]: https://img.cloudposse.com/150x150/https://github.com/sarkis.png
[rsrchboy_homepage]: https://github.com/rsrchboy
[rsrchboy_avatar]: https://img.cloudposse.com/150x150/https://github.com/rsrchboy.png

[![README Footer][readme_footer_img]][readme_footer_link]
[![Beacon][beacon]][website]
Expand Down
2 changes: 2 additions & 0 deletions README.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,5 @@ contributors:
github: aknysh
- name: Sarkis Varozian
github: sarkis
- name: Chris Weyl
github: rsrchboy
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
| enable\_ecs\_managed\_tags | Specifies whether to enable Amazon ECS managed tags for the tasks within the service | `bool` | `false` | no |
| enable\_icmp\_rule | Specifies whether to enable ICMP on the security group | `bool` | `true` | no |
| enabled | Set to false to prevent the module from creating any resources | `bool` | `true` | no |
| environment | Environment, e.g. 'prod', 'staging', 'dev', 'pre-prod', 'UAT' | `string` | `""` | no |
| health\_check\_grace\_period\_seconds | Seconds to ignore failing load balancer health checks on newly instantiated tasks to prevent premature shutdown, up to 7200. Only valid for services configured to use load balancers | `number` | `0` | no |
| ignore\_changes\_task\_definition | Whether to ignore changes in container definition and task definition in the ECS service | `bool` | `true` | no |
| launch\_type | The launch type on which to run your service. Valid values are `EC2` and `FARGATE` | `string` | `"FARGATE"` | no |
Expand Down
23 changes: 12 additions & 11 deletions main.tf
Original file line number Diff line number Diff line change
@@ -1,30 +1,31 @@
module "default_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.15.0"
enabled = var.enabled
attributes = var.attributes
delimiter = var.delimiter
name = var.name
namespace = var.namespace
stage = var.stage
tags = var.tags
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
enabled = var.enabled
attributes = var.attributes
delimiter = var.delimiter
name = var.name
namespace = var.namespace
stage = var.stage
environment = var.environment
tags = var.tags
}

module "task_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.15.0"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
enabled = var.enabled && length(var.task_role_arn) == 0
context = module.default_label.context
attributes = compact(concat(var.attributes, ["task"]))
}

module "service_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.15.0"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
enabled = var.enabled
context = module.default_label.context
attributes = compact(concat(var.attributes, ["service"]))
}

module "exec_label" {
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.15.0"
source = "git::https://github.com/cloudposse/terraform-null-label.git?ref=tags/0.16.0"
enabled = var.enabled && length(var.task_exec_role_arn) == 0
context = module.default_label.context
attributes = compact(concat(var.attributes, ["exec"]))
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,12 @@ variable "namespace" {
default = ""
}

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

variable "stage" {
type = string
description = "Stage (e.g. `prod`, `dev`, `staging`)"
Expand Down

0 comments on commit 4c3fc5e

Please sign in to comment.