Skip to content

Commit e820560

Browse files
committed
AUTH-1359: Update deploy task to inject new Terraform variables
- Terraform requires a values for new variables that, mostly, come from Concourse secrets.
1 parent f7383c5 commit e820560

4 files changed

Lines changed: 39 additions & 4 deletions

File tree

ci/tasks/deploy-frontend.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,34 @@ params:
1010
DEPLOYER_ROLE_ARN: ((deployer-role-arn-non-prod))
1111
STATE_BUCKET: digital-identity-dev-tfstate
1212
DEPLOY_ENVIRONMENT: build
13+
DNS_DEPLOYER_ROLE_ARN: ((deployer-role-arn-production))
14+
DNS_STATE_BUCKET: ((dns-state-bucket))
15+
DNS_STATE_KEY: ((dns-state-key))
1316
CF_USERNAME: ((cf-username))
1417
CF_PASSWORD: ((cf-password))
1518
CF_ORG_NAME: ((cf-org-name))
19+
APP_INSTANCES: 3
20+
GTM_ID: ((build-gtm-id))
21+
SESSION_EXPIRY: ((build-session-expiry))
22+
LOGGING_ENDPOINT_ARN: "arn:aws:logs:eu-west-2:885513274347:destination:csls_cw_logs_destination_prod"
23+
LOGGING_ENDPOINT_ENABLED: "true"
24+
ZENDESK_USERNAME: ""
25+
ZENDESK_GROUP_ID_PUBLIC: ""
26+
ZENDESK_API_TOKEN: ""
1627
inputs:
1728
- name: frontend-src
29+
- name: frontend-image
1830
outputs:
1931
- name: terraform-outputs
2032
run:
2133
path: /bin/sh
2234
args:
2335
- -euc
2436
- |
37+
export IMAGE_URI=$(cat frontend-image/repository)
38+
export IMAGE_TAG=$(cat frontend-image/tag)
39+
export IMAGE_DIGEST=$(cat frontend-image/digest)
40+
2541
cd "frontend-src/ci/terraform/"
2642
terraform init -input=false \
2743
-backend-config "role_arn=${DEPLOYER_ROLE_ARN}" \
@@ -35,6 +51,22 @@ run:
3551
-var "cf_username=${CF_USERNAME}" \
3652
-var "cf_password=${CF_PASSWORD}" \
3753
-var "cf_org_name=${CF_ORG_NAME}" \
38-
-var-file ${DEPLOY_ENVIRONMENT}.tfvars
54+
-var "common_state_bucket=${STATE_BUCKET}" \
55+
-var "dns_state_bucket=${DNS_STATE_BUCKET}" \
56+
-var "dns_state_key=${DNS_STATE_KEY}" \
57+
-var "dns_state_role=${DNS_DEPLOYER_ROLE_ARN}" \
58+
-var "ecs_desired_count=${APP_INSTANCES}" \
59+
-var "session_expiry=${SESSION_EXPIRY}" \
60+
-var "logging_endpoint_arn=${LOGGING_ENDPOINT_ARN}" \
61+
-var "logging_endpoint_enabled=${LOGGING_ENDPOINT_ENABLED}" \
62+
-var "zendesk_username=${ZENDESK_USERNAME}" \
63+
-var "zendesk_group_id_public=${ZENDESK_GROUP_ID_PUBLIC}" \
64+
-var "zendesk_api_token=${ZENDESK_API_TOKEN}" \
65+
-var "gtm_id=${GTM_ID}" \
66+
-var "session_expiry=${SESSION_EXPIRY}" \
67+
-var "image_uri=${IMAGE_URI}" \
68+
-var "image_tag=${IMAGE_TAG}" \
69+
-var "image_digest=${IMAGE_DIGEST}" \
70+
-var-file ${DEPLOY_ENVIRONMENT}.tfvars \
3971
4072
terraform output --json > ../../../terraform-outputs/${DEPLOY_ENVIRONMENT}-terraform-outputs.json

ci/terraform/build.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
redis_service_plan = "tiny-ha-5_x"
22
environment = "build"
3-
common_state_bucket = "digital-identity-dev-tfstate"
3+
common_state_bucket = "digital-identity-dev-tfstate"
4+
public_access = true

ci/terraform/integration.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
redis_service_plan = "tiny-ha-5_x"
22
environment = "integration"
3-
common_state_bucket = "digital-identity-dev-tfstate"
3+
common_state_bucket = "digital-identity-dev-tfstate"
4+
public_access = true

ci/terraform/production.tfvars

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
11
redis_service_plan = "large-ha-5_x"
22
environment = "production"
3-
common_state_bucket = "digital-identity-prod-tfstate"
3+
common_state_bucket = "digital-identity-prod-tfstate"
4+
public_access = false

0 commit comments

Comments
 (0)