Skip to content

Commit

Permalink
Add input variable for ecs service wait_for_steady_state (#109)
Browse files Browse the repository at this point in the history
* var.wait_for_steady_state

* var.wait_for_steady_state

* Auto Format

Co-authored-by: cloudpossebot <11232728+cloudpossebot@users.noreply.github.com>
  • Loading branch information
nitrocode and cloudpossebot committed Feb 25, 2021
1 parent afb8060 commit a4d023d
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -347,6 +347,7 @@ Available targets:
| use\_old\_arn | A flag to enable/disable tagging the ecs resources that require the new arn format | `bool` | `false` | no |
| volumes | Task volume definitions as list of configuration objects | <pre>list(object({<br> host_path = string<br> name = string<br> docker_volume_configuration = list(object({<br> autoprovision = bool<br> driver = string<br> driver_opts = map(string)<br> labels = map(string)<br> scope = string<br> }))<br> efs_volume_configuration = list(object({<br> file_system_id = string<br> root_directory = string<br> transit_encryption = string<br> transit_encryption_port = string<br> authorization_config = list(object({<br> access_point_id = string<br> iam = string<br> }))<br> }))<br> }))</pre> | `[]` | no |
| vpc\_id | The VPC ID where resources are created | `string` | n/a | yes |
| wait\_for\_steady\_state | If true, it will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing | `bool` | `false` | no |

## Outputs

Expand Down
1 change: 1 addition & 0 deletions docs/terraform.md
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,7 @@
| use\_old\_arn | A flag to enable/disable tagging the ecs resources that require the new arn format | `bool` | `false` | no |
| volumes | Task volume definitions as list of configuration objects | <pre>list(object({<br> host_path = string<br> name = string<br> docker_volume_configuration = list(object({<br> autoprovision = bool<br> driver = string<br> driver_opts = map(string)<br> labels = map(string)<br> scope = string<br> }))<br> efs_volume_configuration = list(object({<br> file_system_id = string<br> root_directory = string<br> transit_encryption = string<br> transit_encryption_port = string<br> authorization_config = list(object({<br> access_point_id = string<br> iam = string<br> }))<br> }))<br> }))</pre> | `[]` | no |
| vpc\_id | The VPC ID where resources are created | `string` | n/a | yes |
| wait\_for\_steady\_state | If true, it will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing | `bool` | `false` | no |

## Outputs

Expand Down
2 changes: 2 additions & 0 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,7 @@ resource "aws_ecs_service" "ignore_changes_task_definition" {
scheduling_strategy = var.launch_type == "FARGATE" ? "REPLICA" : var.scheduling_strategy
enable_ecs_managed_tags = var.enable_ecs_managed_tags
iam_role = local.enable_ecs_service_role ? join("", aws_iam_role.ecs_service.*.arn) : null
wait_for_steady_state = var.wait_for_steady_state

dynamic "capacity_provider_strategy" {
for_each = var.capacity_provider_strategies
Expand Down Expand Up @@ -379,6 +380,7 @@ resource "aws_ecs_service" "default" {
scheduling_strategy = var.launch_type == "FARGATE" ? "REPLICA" : var.scheduling_strategy
enable_ecs_managed_tags = var.enable_ecs_managed_tags
iam_role = local.enable_ecs_service_role ? join("", aws_iam_role.ecs_service.*.arn) : null
wait_for_steady_state = var.wait_for_steady_state

dynamic "capacity_provider_strategy" {
for_each = var.capacity_provider_strategies
Expand Down
6 changes: 6 additions & 0 deletions variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -313,6 +313,12 @@ variable "use_old_arn" {
default = false
}

variable "wait_for_steady_state" {
type = bool
description = "If true, it will wait for the service to reach a steady state (like aws ecs wait services-stable) before continuing"
default = false
}

variable "task_definition" {
type = string
description = "Reuse an existing task definition family and revision for the ecs service instead of creating one"
Expand Down

0 comments on commit a4d023d

Please sign in to comment.