Skip to content

Commit

Permalink
feat: Add optional "propagate_tags" variable (#32)
Browse files Browse the repository at this point in the history
Variable allows to set optional "propagate_tags" argument on "aws_ecs_service" resource
  • Loading branch information
Konrad Obal authored and aknysh committed Oct 18, 2019
1 parent 2141944 commit abf388a
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
9 changes: 5 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ Available targets:
| name | Solution name, e.g. 'app' or 'cluster' | string | - | yes |
| namespace | Namespace, which could be your organization name, e.g. 'eg' or 'cp' | string | - | yes |
| network_mode | The network mode to use for the task. This is required to be awsvpc for `FARGATE` `launch_type` | string | `awsvpc` | no |
| propagate_tags | Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION. | string | `` | no |
| security_group_ids | Security group IDs to allow in Service `network_configuration` | list | - | yes |
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | - | yes |
| subnet_ids | Subnet IDs | list | - | yes |
Expand Down Expand Up @@ -343,13 +344,13 @@ Check out [our other projects][github], [follow us on twitter][twitter], [apply
|---|---|---|---|

[osterman_homepage]: https://github.com/osterman
[osterman_avatar]: https://github.com/osterman.png?size=150
[osterman_avatar]: https://img.cloudposse.com/150x150/https://github.com/osterman.png
[goruha_homepage]: https://github.com/goruha
[goruha_avatar]: https://github.com/goruha.png?size=150
[goruha_avatar]: https://img.cloudposse.com/150x150/https://github.com/goruha.png
[aknysh_homepage]: https://github.com/aknysh
[aknysh_avatar]: https://github.com/aknysh.png?size=150
[aknysh_avatar]: https://img.cloudposse.com/150x150/https://github.com/aknysh.png
[sarkis_homepage]: https://github.com/sarkis
[sarkis_avatar]: https://github.com/sarkis.png?size=150
[sarkis_avatar]: https://img.cloudposse.com/150x150/https://github.com/sarkis.png



Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
| name | Solution name, e.g. 'app' or 'cluster' | string | - | yes |
| namespace | Namespace, which could be your organization name, e.g. 'eg' or 'cp' | string | - | yes |
| network_mode | The network mode to use for the task. This is required to be awsvpc for `FARGATE` `launch_type` | string | `awsvpc` | no |
| propagate_tags | Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION. | string | `` | no |
| security_group_ids | Security group IDs to allow in Service `network_configuration` | list | - | yes |
| stage | Stage, e.g. 'prod', 'staging', 'dev', or 'test' | string | - | yes |
| subnet_ids | Subnet IDs | list | - | yes |
Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,7 @@ resource "aws_ecs_service" "ignore_changes_task_definition" {
health_check_grace_period_seconds = "${var.health_check_grace_period_seconds}"
launch_type = "${var.launch_type}"
cluster = "${var.ecs_cluster_arn}"
propagate_tags = "${var.propagate_tags}"
tags = "${module.default_label.tags}"

deployment_controller {
Expand Down Expand Up @@ -228,6 +229,7 @@ resource "aws_ecs_service" "default" {
health_check_grace_period_seconds = "${var.health_check_grace_period_seconds}"
launch_type = "${var.launch_type}"
cluster = "${var.ecs_cluster_arn}"
propagate_tags = "${var.propagate_tags}"
tags = "${module.default_label.tags}"

deployment_controller {
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -141,3 +141,9 @@ variable "assign_public_ip" {
default = "false"
description = "Assign a public IP address to the ENI (Fargate launch type only). Valid values are true or false. Default false."
}

variable "propagate_tags" {
type = "string"
default = ""
description = "Specifies whether to propagate the tags from the task definition or the service to the tasks. The valid values are SERVICE and TASK_DEFINITION."
}

0 comments on commit abf388a

Please sign in to comment.