File tree Expand file tree Collapse file tree 2 files changed +12
-1
lines changed
modules/container-definition Expand file tree Collapse file tree 2 files changed +12
-1
lines changed Original file line number Diff line number Diff line change @@ -69,6 +69,11 @@ module "ecs" {
69
69
memory = 1024
70
70
essential = true
71
71
image = " public.ecr.aws/aws-containers/ecsdemo-frontend:776fd50"
72
+
73
+ health_check = {
74
+ command = [" CMD-SHELL" , " curl -f http://localhost:${ local . container_port } /health || exit 1" ]
75
+ }
76
+
72
77
port_mappings = [
73
78
{
74
79
name = local.container_name
Original file line number Diff line number Diff line change @@ -19,6 +19,12 @@ locals {
19
19
20
20
linux_parameters = var. enable_execute_command ? merge ({ " initProcessEnabled" : true }, var. linux_parameters ) : merge ({ " initProcessEnabled" : false }, var. linux_parameters )
21
21
22
+ health_check = length (var. health_check ) > 0 ? merge ({
23
+ interval = 30 ,
24
+ retries = 3 ,
25
+ timeout = 5
26
+ }, var. health_check ) : null
27
+
22
28
definition = {
23
29
command = length (var. command ) > 0 ? var.command : null
24
30
cpu = var.cpu
@@ -34,7 +40,7 @@ locals {
34
40
essential = var.essential
35
41
extraHosts = local.is_not_windows && length (var. extra_hosts ) > 0 ? var.extra_hosts : null
36
42
firelensConfiguration = length (var. firelens_configuration ) > 0 ? var.firelens_configuration : null
37
- healthCheck = length (var . health_check ) > 0 ? var.health_check : null
43
+ healthCheck = local .health_check
38
44
hostname = var.hostname
39
45
image = var.image
40
46
interactive = var.interactive
You can’t perform that action at this time.
0 commit comments