Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .review_apps/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ The Terraform code in this directory is used to deploy a review copy of `forms-a
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:

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

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.

Expand Down
73 changes: 0 additions & 73 deletions .review_apps/ecs_task_definition.tf
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,9 @@ locals {
{ name = "SECRET_KEY_BASE", value = "unsecured_secret_key_material" },
{ name = "SETTINGS__ACT_AS_USER_ENABLED", value = "true" },
{ name = "SETTINGS__AUTH_PROVIDER", value = "developer" },
{ name = "SETTINGS__FORMS_API__AUTH_KEY", value = "unsecured_api_key_for_review_apps_only" },
{ name = "SETTINGS__FORMS_API__BASE_URL", value = "http://localhost:9292" },
{ name = "SETTINGS__FORMS_ENV", value = "review" },
{ name = "SETTINGS__FORMS_RUNNER__URL", value = "https://forms.service.gov.uk/" },
]

forms_api_env_vars = [
{ name = "DATABASE_URL", value = "postgres://postgres:postgres@127.0.0.1:5432" },
{ name = "EMAIL", value = "review-app-submissions@review.forms.service.gov.uk" },
{ name = "RAILS_DEVELOPMENT_HOSTS", value = "localhost:9292" },
{ name = "RAILS_ENV", value = "production" },
{ name = "SECRET_KEY_BASE", value = "unsecured_secret_key_material" },
{ name = "SETTINGS__FORMS_API__AUTH_KEY", value = "unsecured_api_key_for_review_apps_only" },
{ name = "SETTINGS__FORMS_ENV", value = "review" },
]
}

resource "aws_ecs_task_definition" "task" {
Expand Down Expand Up @@ -111,41 +99,6 @@ resource "aws_ecs_task_definition" "task" {
]
},

# forms-api
{
name = "forms-api"
image = "711966560482.dkr.ecr.eu-west-2.amazonaws.com/forms-api-deploy:latest"
command = []
essential = true
environment = local.forms_api_env_vars
readonlyRootFilesystem = true

portMappings = [{ containerPort = 9292 }]

logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-group = data.terraform_remote_state.review.outputs.review_apps_log_group_name
awslogs-region = "eu-west-2"
awslogs-stream-prefix = "${local.logs_stream_prefix}/forms-api"
}
}

healthCheck = {
command = ["CMD-SHELL", "wget -O - 'http://localhost:9292/up' || exit 1"]
interval = 30
retries = 5
startPeriod = 180
}

dependsOn = [
{
containerName = "postgres"
condition = "HEALTHY"
}
]
},

# postgres
{
name = "postgres"
Expand Down Expand Up @@ -198,31 +151,5 @@ resource "aws_ecs_task_definition" "task" {
}
]
},

# forms-api-seeding
{
name = "forms-api-seeding"
image = "711966560482.dkr.ecr.eu-west-2.amazonaws.com/forms-api-deploy:latest"
command = ["rake", "db:create", "db:migrate", "db:seed"]
essential = false
environment = local.forms_api_env_vars
readonlyRootFilesystem = true

logConfiguration = {
logDriver = "awslogs"
options = {
awslogs-group = data.terraform_remote_state.review.outputs.review_apps_log_group_name
awslogs-region = "eu-west-2"
awslogs-stream-prefix = "${local.logs_stream_prefix}/forms-api-seeding"
}
}

dependsOn = [
{
containerName = "postgres"
condition = "HEALTHY"
}
]
},
])
}