Skip to content

Commit 10c1646

Browse files
committed
BAU: add missing fields to the review app task definition
These fields are automatically added by AWS when creating a task definition. If we don't include them in our task definition, Terraform tries to remove them on every apply, which causes unnecessary changes to the task definition (and thus noise in our Terraform plan output).
1 parent 83cb6be commit 10c1646

File tree

1 file changed

+25
-2
lines changed

1 file changed

+25
-2
lines changed

.review_apps/ecs_task_definition.tf

Lines changed: 25 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,16 @@ resource "aws_ecs_task_definition" "task" {
7070
portMappings = [
7171
{
7272
containerPort = 3000
73+
hostPort = 3000
7374
protocol = "tcp"
7475
appProtocol = "http"
7576
}
7677
]
7778

79+
mountPoints = []
80+
systemControls = []
81+
volumesFrom = []
82+
7883
logConfiguration = {
7984
logDriver = "awslogs"
8085
options = {
@@ -89,6 +94,7 @@ resource "aws_ecs_task_definition" "task" {
8994
interval = 30
9095
retries = 5
9196
startPeriod = 180
97+
timeout = 5
9298
}
9399

94100
dependsOn = [
@@ -106,7 +112,17 @@ resource "aws_ecs_task_definition" "task" {
106112
command = []
107113
essential = true
108114

109-
portMappings = [{ containerPort = 5432 }]
115+
portMappings = [
116+
{
117+
containerPort = 5432
118+
hostPort = 5432
119+
protocol = "tcp"
120+
}
121+
]
122+
123+
mountPoints = []
124+
systemControls = []
125+
volumesFrom = []
110126

111127
environment = [
112128
{ name = "POSTGRES_PASSWORD", value = "postgres" }
@@ -122,7 +138,10 @@ resource "aws_ecs_task_definition" "task" {
122138
}
123139

124140
healthCheck = {
125-
command = ["CMD-SHELL", "psql -h localhost -p 5432 -U postgres -c \"SELECT current_timestamp - pg_postmaster_start_time();\""]
141+
command = ["CMD-SHELL", "psql -h localhost -p 5432 -U postgres -c \"SELECT current_timestamp - pg_postmaster_start_time();\""]
142+
interval = 30
143+
retries = 3
144+
timeout = 5
126145
}
127146
},
128147

@@ -135,6 +154,10 @@ resource "aws_ecs_task_definition" "task" {
135154
environment = local.forms_admin_env_vars
136155
readonlyRootFilesystem = true
137156

157+
mountPoints = []
158+
systemControls = []
159+
volumesFrom = []
160+
138161
logConfiguration = {
139162
logDriver = "awslogs"
140163
options = {

0 commit comments

Comments
 (0)