Skip to content

Commit 1cf2195

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 e868b6d commit 1cf2195

1 file changed

Lines changed: 25 additions & 2 deletions

File tree

.review_apps/ecs_task_definition.tf

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

80+
mountPoints = []
81+
systemControls = []
82+
volumesFrom = []
83+
7984
logConfiguration = {
8085
logDriver = "awslogs"
8186
options = {
@@ -90,6 +95,7 @@ resource "aws_ecs_task_definition" "task" {
9095
interval = 30
9196
retries = 5
9297
startPeriod = 180
98+
timeout = 5
9399
}
94100

95101
dependsOn = [
@@ -107,7 +113,17 @@ resource "aws_ecs_task_definition" "task" {
107113
command = []
108114
essential = true
109115

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

112128
environment = [
113129
{ name = "POSTGRES_PASSWORD", value = "postgres" }
@@ -123,7 +139,10 @@ resource "aws_ecs_task_definition" "task" {
123139
}
124140

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

@@ -136,6 +155,10 @@ resource "aws_ecs_task_definition" "task" {
136155
environment = local.forms_admin_env_vars
137156
readonlyRootFilesystem = true
138157

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

0 commit comments

Comments
 (0)