Skip to content

Commit afb2f8d

Browse files
feat: Add sigint_rollback argument support to ECS service
1 parent 17b8a18 commit afb2f8d

File tree

15 files changed

+27
-12
lines changed

15 files changed

+27
-12
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Large diffs are not rendered by default.

examples/container-definition/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Note that this example may create resources which will incur monetary charges on
2222
| Name | Version |
2323
|------|---------|
2424
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
25-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.4 |
25+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.6 |
2626
| <a name="requirement_null"></a> [null](#requirement\_null) | >= 3.2 |
2727

2828
## Providers

examples/container-definition/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.4"
7+
version = ">= 6.6"
88
}
99
null = {
1010
source = "hashicorp/null"

examples/ec2-autoscaling/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Note that this example may create resources which will incur monetary charges on
2727
| Name | Version |
2828
|------|---------|
2929
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
30-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.4 |
30+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.6 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.4 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.6 |
3737

3838
## Modules
3939

examples/ec2-autoscaling/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.4"
7+
version = ">= 6.6"
88
}
99
}
1010
}

examples/fargate/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,13 +27,13 @@ Note that this example may create resources which will incur monetary charges on
2727
| Name | Version |
2828
|------|---------|
2929
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.5.7 |
30-
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.4 |
30+
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | >= 6.6 |
3131

3232
## Providers
3333

3434
| Name | Version |
3535
|------|---------|
36-
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.4 |
36+
| <a name="provider_aws"></a> [aws](#provider\_aws) | >= 6.6 |
3737

3838
## Modules
3939

examples/fargate/versions.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ terraform {
44
required_providers {
55
aws = {
66
source = "hashicorp/aws"
7-
version = ">= 6.4"
7+
version = ">= 6.6"
88
}
99
}
1010
}

main.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,7 @@ module "service" {
8888
scheduling_strategy = each.value.scheduling_strategy
8989
service_connect_configuration = each.value.service_connect_configuration
9090
service_registries = each.value.service_registries
91+
sigint_rollback = each.value.sigint_rollback
9192
timeouts = each.value.timeouts
9293
triggers = each.value.triggers
9394
volume_configuration = each.value.volume_configuration

modules/service/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,7 @@ module "ecs_service" {
308308
| <a name="input_service_connect_configuration"></a> [service\_connect\_configuration](#input\_service\_connect\_configuration) | The ECS Service Connect configuration for this service to discover and connect to services, and be discovered by, and connected from, other services within a namespace | <pre>object({<br/> enabled = optional(bool, true)<br/> log_configuration = optional(object({<br/> log_driver = string<br/> options = optional(map(string))<br/> secret_option = optional(list(object({<br/> name = string<br/> value_from = string<br/> })))<br/> }))<br/> namespace = optional(string)<br/> service = optional(list(object({<br/> client_alias = optional(object({<br/> dns_name = optional(string)<br/> port = number<br/> test_traffic_rules = optional(list(object({<br/> header = optional(object({<br/> name = string<br/> value = object({<br/> exact = string<br/> })<br/> }))<br/> })))<br/> }))<br/> discovery_name = optional(string)<br/> ingress_port_override = optional(number)<br/> port_name = string<br/> timeout = optional(object({<br/> idle_timeout_seconds = optional(number)<br/> per_request_timeout_seconds = optional(number)<br/> }))<br/> tls = optional(object({<br/> issuer_cert_authority = object({<br/> aws_pca_authority_arn = string<br/> })<br/> kms_key = optional(string)<br/> role_arn = optional(string)<br/> }))<br/> })))<br/> })</pre> | `null` | no |
309309
| <a name="input_service_registries"></a> [service\_registries](#input\_service\_registries) | Service discovery registries for the service | <pre>object({<br/> container_name = optional(string)<br/> container_port = optional(number)<br/> port = optional(number)<br/> registry_arn = string<br/> })</pre> | `null` | no |
310310
| <a name="input_service_tags"></a> [service\_tags](#input\_service\_tags) | A map of additional tags to add to the service | `map(string)` | `{}` | no |
311+
| <a name="input_sigint_rollback"></a> [sigint\_rollback](#input\_sigint\_rollback) | Whether to enable graceful termination of deployments using SIGINT signals. Only applicable when using ECS deployment controller and requires wait\_for\_steady\_state = true. Default is false | `bool` | `null` | no |
311312
| <a name="input_skip_destroy"></a> [skip\_destroy](#input\_skip\_destroy) | If true, the task is not deleted when the service is deleted | `bool` | `null` | no |
312313
| <a name="input_subnet_ids"></a> [subnet\_ids](#input\_subnet\_ids) | List of subnets to associate with the task or service | `list(string)` | `[]` | no |
313314
| <a name="input_tags"></a> [tags](#input\_tags) | A map of tags to add to all resources | `map(string)` | `{}` | no |

modules/service/main.tf

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -279,6 +279,11 @@ resource "aws_ecs_service" "this" {
279279
}
280280
}
281281

282+
sigint_rollback = (
283+
lookup(var.deployment_controller, "type", "ECS") == "ECS" &&
284+
var.wait_for_steady_state == true
285+
) ? var.sigint_rollback : false
286+
282287
tags = merge(var.tags, var.service_tags)
283288
task_definition = local.task_definition
284289
triggers = var.triggers

0 commit comments

Comments
 (0)