Skip to content

Commit 255f96f

Browse files
authored
Merge pull request #2243 from alphagov/remove-api-from-review-apps
Remove forms-api task from review apps
2 parents eb694e4 + 67ba7b2 commit 255f96f

File tree

2 files changed

+1
-75
lines changed

2 files changed

+1
-75
lines changed

.review_apps/README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@ The Terraform code in this directory is used to deploy a review copy of `forms-a
55
It constructs a minimal, ephemeral version of a GOV.UK Forms environment in AWS ECS that can be used for reviews, then freely destroyed. This includes:
66

77
* a copy of `forms-admin` at the commit in question
8-
* a copy of the version of `forms-api` currently in production
9-
* a local PostgreSQL database with seed data for both `forms-api` and `forms-admin`
8+
* a local PostgreSQL database with seed data for `forms-admin`
109

1110
Review apps rely on a set of underlying infrastructure managed and deployed in `forms-deploy`. The Terraform will require you to be targeting the `integration` AWS account (where the `review` environment lives), and you should not override this.
1211

.review_apps/ecs_task_definition.tf

Lines changed: 0 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -23,21 +23,9 @@ locals {
2323
{ name = "SECRET_KEY_BASE", value = "unsecured_secret_key_material" },
2424
{ name = "SETTINGS__ACT_AS_USER_ENABLED", value = "true" },
2525
{ name = "SETTINGS__AUTH_PROVIDER", value = "developer" },
26-
{ name = "SETTINGS__FORMS_API__AUTH_KEY", value = "unsecured_api_key_for_review_apps_only" },
27-
{ name = "SETTINGS__FORMS_API__BASE_URL", value = "http://localhost:9292" },
2826
{ name = "SETTINGS__FORMS_ENV", value = "review" },
2927
{ name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk/" },
3028
]
31-
32-
forms_api_env_vars = [
33-
{ name = "DATABASE_URL", value = "postgres://postgres:postgres@127.0.0.1:5432" },
34-
{ name = "EMAIL", value = "review-app-submissions@review.forms.service.gov.uk" },
35-
{ name = "RAILS_DEVELOPMENT_HOSTS", value = "localhost:9292" },
36-
{ name = "RAILS_ENV", value = "production" },
37-
{ name = "SECRET_KEY_BASE", value = "unsecured_secret_key_material" },
38-
{ name = "SETTINGS__FORMS_API__AUTH_KEY", value = "unsecured_api_key_for_review_apps_only" },
39-
{ name = "SETTINGS__FORMS_ENV", value = "review" },
40-
]
4129
}
4230

4331
resource "aws_ecs_task_definition" "task" {
@@ -111,41 +99,6 @@ resource "aws_ecs_task_definition" "task" {
11199
]
112100
},
113101

114-
# forms-api
115-
{
116-
name = "forms-api"
117-
image = "711966560482.dkr.ecr.eu-west-2.amazonaws.com/forms-api-deploy:latest"
118-
command = []
119-
essential = true
120-
environment = local.forms_api_env_vars
121-
readonlyRootFilesystem = true
122-
123-
portMappings = [{ containerPort = 9292 }]
124-
125-
logConfiguration = {
126-
logDriver = "awslogs"
127-
options = {
128-
awslogs-group = data.terraform_remote_state.review.outputs.review_apps_log_group_name
129-
awslogs-region = "eu-west-2"
130-
awslogs-stream-prefix = "${local.logs_stream_prefix}/forms-api"
131-
}
132-
}
133-
134-
healthCheck = {
135-
command = ["CMD-SHELL", "wget -O - 'http://localhost:9292/up' || exit 1"]
136-
interval = 30
137-
retries = 5
138-
startPeriod = 180
139-
}
140-
141-
dependsOn = [
142-
{
143-
containerName = "postgres"
144-
condition = "HEALTHY"
145-
}
146-
]
147-
},
148-
149102
# postgres
150103
{
151104
name = "postgres"
@@ -198,31 +151,5 @@ resource "aws_ecs_task_definition" "task" {
198151
}
199152
]
200153
},
201-
202-
# forms-api-seeding
203-
{
204-
name = "forms-api-seeding"
205-
image = "711966560482.dkr.ecr.eu-west-2.amazonaws.com/forms-api-deploy:latest"
206-
command = ["rake", "db:create", "db:migrate", "db:seed"]
207-
essential = false
208-
environment = local.forms_api_env_vars
209-
readonlyRootFilesystem = true
210-
211-
logConfiguration = {
212-
logDriver = "awslogs"
213-
options = {
214-
awslogs-group = data.terraform_remote_state.review.outputs.review_apps_log_group_name
215-
awslogs-region = "eu-west-2"
216-
awslogs-stream-prefix = "${local.logs_stream_prefix}/forms-api-seeding"
217-
}
218-
}
219-
220-
dependsOn = [
221-
{
222-
containerName = "postgres"
223-
condition = "HEALTHY"
224-
}
225-
]
226-
},
227154
])
228155
}

0 commit comments

Comments
 (0)