Skip to content

Commit 3f10044

Browse files
Meet ShethMeet Sheth
authored andcommitted
readme ,example update, variable type add
1 parent a0d5eb8 commit 3f10044

File tree

4 files changed

+11
-1
lines changed

4 files changed

+11
-1
lines changed

EXAMPLE.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ module "ecs_task_definition" {
1515
port = 80
1616
requires_compatibilities = ["FARGATE"]
1717
network_mode = "awsvpc"
18+
Refer this doc for more information on health check https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-properties-ecs-taskdefinition-healthcheck.html
19+
health_check = {
20+
command = ["CMD-SHELL", "curl -f http://localhost:${#PORT}${#HEALTH_CHECK_PATH} || exit 1"]
21+
interval = 30
22+
timeout = 5
23+
retries = 2
24+
startPeriod = 0
25+
}
1826
environment_variables = {
1927
TEST = "1"
2028
FOO = "BAR"

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ No modules.
4242
| <a name="input_network_mode"></a> [network\_mode](#input\_network\_mode) | Docker networking mode to use for the containers in the task. The valid values are none, bridge, awsvpc, and host. | `string` | `"awsvpc"` | no |
4343
| <a name="input_port"></a> [port](#input\_port) | ECS container port | `number` | `0` | no |
4444
| <a name="input_requires_compatibilities"></a> [requires\_compatibilities](#input\_requires\_compatibilities) | A set of launch types required by the task. The valid values are EC2 and FARGATE. | `list(string)` | n/a | yes |
45+
| <a name="input_health_check"></a> [health\_check](#input\_health\_check) | ECS task definition health check | `any` | n/a | no |
4546
| <a name="input_secret_environment_variables"></a> [secret\_environment\_variables](#input\_secret\_environment\_variables) | ECS secrets environment variables | `map(string)` | n/a | yes |
4647
| <a name="input_ssm_kms_alias"></a> [ssm\_kms\_alias](#input\_ssm\_kms\_alias) | SSM kms key alias | `string` | `"alias/aws/ssm"` | no |
4748
| <a name="input_task_cpu"></a> [task\_cpu](#input\_task\_cpu) | ECS fargate task cpu | `number` | n/a | yes |

example/main.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ module "ecs_task_definition" {
88
port = 80
99
cloudwatch_log_retention_in_days = var.env == "prod" ? 90 : 30
1010
health_check = {
11-
command = ["CMD-SHELL", "curl -f http://localhost:${var.container_port}${var.task_health_check_path} || exit 1"]
11+
command = ["CMD-SHELL", "curl -f http://localhost:${PORT}${HEALTH_CHECK_PATH} || exit 1"]
1212
interval = 30
1313
timeout = 5
1414
retries = 2

variables.tf

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,5 +68,6 @@ variable "task_memory" {
6868

6969
variable "health_check" {
7070
description = "task definition health check"
71+
type = any
7172
default = null
7273
}

0 commit comments

Comments
 (0)