diff --git a/.circleci/config.yml b/.circleci/config.yml index 4f5cd00..b9959a0 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -1,5 +1,5 @@ references: - circleci_docker: &circleci_docker trussworks/circleci:efb1042e31538677779971798e0912390f699e72 + circleci_docker: &circleci_docker trussworks/circleci:f697f3f2436b7516571f27f234d82ad1657bcc1d jobs: terratest: docker: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index b041a70..4efe487 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -12,17 +12,17 @@ repos: - id: trailing-whitespace - repo: git://github.com/igorshubovych/markdownlint-cli - rev: v0.26.0 + rev: v0.27.0 hooks: - id: markdownlint - repo: git://github.com/antonbabenko/pre-commit-terraform - rev: v1.45.0 + rev: v1.47.0 hooks: - id: terraform_docs - id: terraform_fmt - repo: git://github.com/golangci/golangci-lint - rev: v1.33.0 + rev: v1.37.1 hooks: - id: golangci-lint diff --git a/README.md b/README.md index f2dd316..376de94 100644 --- a/README.md +++ b/README.md @@ -114,6 +114,26 @@ module "app_ecs_service" { |------|---------| | aws | >= 3.0 | +## Modules + +No Modules. + +## Resources + +| Name | +|------| +| [aws_cloudwatch_log_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_log_group) | +| [aws_cloudwatch_metric_alarm](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/cloudwatch_metric_alarm) | +| [aws_ecs_service](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_service) | +| [aws_ecs_task_definition](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/ecs_task_definition) | +| [aws_ecs_task_definition](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/ecs_task_definition) | +| [aws_iam_policy_document](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/iam_policy_document) | +| [aws_iam_role](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role) | +| [aws_iam_role_policy](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/iam_role_policy) | +| [aws_region](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/region) | +| [aws_security_group](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group) | +| [aws_security_group_rule](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/resources/security_group_rule) | + ## Inputs | Name | Description | Type | Default | Required | @@ -141,6 +161,7 @@ module "app_ecs_service" { | fargate\_platform\_version | The platform version on which to run your service. Only applicable when using Fargate launch type. | `string` | `"LATEST"` | no | | fargate\_task\_cpu | Number of cpu units used in initial task definition. Default is minimum. | `number` | `256` | no | | fargate\_task\_memory | Amount (in MiB) of memory used in initial task definition. Default is minimum. | `number` | `512` | no | +| health\_check\_grace\_period\_seconds | Grace period within which failed health checks will be ignored at container start. Only applies to services with an attached loadbalancer. | `number` | `null` | no | | hello\_world\_container\_ports | List of ports for the hello world container app to listen on. The app currently supports listening on two ports. | `list(number)` |
[
8080,
8081
]
| no | | kms\_key\_id | KMS customer managed key (CMK) ARN for encrypting application logs. | `string` | n/a | yes | | lb\_target\_groups | List of load balancer target group objects containing the lb\_target\_group\_arn, container\_port and container\_health\_check\_port. The container\_port is the port on which the container will receive traffic. The container\_health\_check\_port is an additional port on which the container can receive a health check. The lb\_target\_group\_arn is either Application Load Balancer (ALB) or Network Load Balancer (NLB) target group ARN tasks will register with. |
list(
object({
container_port = number
container_health_check_port = number
lb_target_group_arn = string
}
)
)
| `[]` | no | @@ -169,7 +190,6 @@ module "app_ecs_service" { | task\_role | The IAM role object assumed by Amazon ECS container tasks. | | task\_role\_arn | The ARN of the IAM role assumed by Amazon ECS container tasks. | | task\_role\_name | The name of the IAM role assumed by Amazon ECS container tasks. | - ## Upgrade Path diff --git a/main.tf b/main.tf index ba1323b..1990e36 100644 --- a/main.tf +++ b/main.tf @@ -484,6 +484,8 @@ resource "aws_ecs_service" "main" { } } + health_check_grace_period_seconds = var.associate_alb || var.associate_nlb ? var.health_check_grace_period_seconds : null + dynamic "service_registries" { for_each = var.service_registries content { diff --git a/variables.tf b/variables.tf index d462b08..369616b 100644 --- a/variables.tf +++ b/variables.tf @@ -216,3 +216,9 @@ variable "service_registries" { })) default = [] } + +variable "health_check_grace_period_seconds" { + description = "Grace period within which failed health checks will be ignored at container start. Only applies to services with an attached loadbalancer." + default = null + type = number +}