diff --git a/.github/workflows/terragrunt-deploy.yml b/.github/workflows/terragrunt-deploy.yml index d7950c5f3..23c27a5e5 100644 --- a/.github/workflows/terragrunt-deploy.yml +++ b/.github/workflows/terragrunt-deploy.yml @@ -118,8 +118,10 @@ jobs: WFPREV_API_CPU_UNITS: ${{vars.WFPREV_API_CPU_UNITS}} WFPREV_API_MEMORY: ${{vars.WFPREV_API_MEMORY}} WFPREV_API_PORT: ${{vars.WFPREV_API_PORT}} - + TARGET_AWS_ACCOUNT_ID: ${{secrets.TARGET_AWS_ACCOUNT_ID}} # WFPREV UI - client_image: ${{ vars.REPOSITORY }}/${{ github.repository }}-wfprev-ui:${{ inputs.IMAGE_TAG }} + CLIENT_IMAGE: ${{ vars.REPOSITORY }}/${{ github.repository }}-wfprev-ui:${{ inputs.IMAGE_TAG }} WEBADE_OAUTH2_WFPREV_UI_CLIENT_SECRET: ${{ secrets.WEBADE_OAUTH2_WFPREV_UI_CLIENT_SECRET }} + WFPREV_UI_PORT: ${{vars.WFPREV_UI_PORT}} + run: terragrunt apply --terragrunt-non-interactive -auto-approve diff --git a/terraform/ecs.tf b/terraform/ecs.tf index fe995da75..e45622a7b 100644 --- a/terraform/ecs.tf +++ b/terraform/ecs.tf @@ -147,7 +147,7 @@ resource "aws_ecs_task_definition" "wfprev_client" { essential = true readonlyRootFilesystem = true name = var.client_container_name - image = var.client_image + image = var.CLIENT_IMAGE cpu = var.client_cpu_units memory = var.client_memory networkMode = "awsvpc" @@ -183,7 +183,15 @@ resource "aws_ecs_task_definition" "wfprev_client" { { name = "WEBADE-OAUTH2_CHECK_TOKEN_V2_URL" value = var.WEBADE-OAUTH2_CHECK_TOKEN_URL - } + }, + { //Will be phased out from prod eventually, but not yet "https://${aws_route53_record.wfprev_nginx.name}/" + name = "WFPREV_API_URL", + value = var.target_env == "prod" ? "https://${var.gov_api_url}/" : "https://example.com/" + }, + { + name = "APPLICATION_ENVIRONMENT", + value = var.target_env != "prod" ? var.target_env : " " + }, ] logConfiguration = { logDriver = "awslogs" @@ -282,7 +290,7 @@ resource "aws_ecs_service" "client" { network_configuration { - security_groups = [aws_security_group.wfnews_ecs_tasks.id, data.aws_security_group.app.id] + security_groups = [aws_security_group.wfprev_ecs_tasks.id, data.aws_security_group.app.id] subnets = module.network.aws_subnet_ids.app.ids assign_public_ip = true } diff --git a/terraform/terragrunt.hcl b/terraform/terragrunt.hcl new file mode 100644 index 000000000..fbad45297 --- /dev/null +++ b/terraform/terragrunt.hcl @@ -0,0 +1,62 @@ +locals { + tfc_hostname = "app.terraform.io" + tfc_organization = "bcgov" +} + +generate "remote_state" { + path = "backend.tf" + if_exists = "overwrite" + contents = <