Skip to content

Commit

Permalink
Pass health check IDs to deploy
Browse files Browse the repository at this point in the history
  • Loading branch information
farski committed Apr 19, 2024
1 parent 1c3105c commit dfed67b
Showing 1 changed file with 15 additions and 3 deletions.
18 changes: 15 additions & 3 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,9 @@ jobs:
check_id=$(aws cloudformation describe-stacks --region ${{ matrix.check-region }} --stack-name "$stack_name" --query "Stacks[0].Outputs[?OutputKey=='HealthCheckId'].OutputValue" --output text)
echo "$check_id" > health_check_id
- uses: actions/upload-artifact@v4
- name: Capture health check ID
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.check-region }}-targeting-${{ matrix.target-region }}
path: components/ftp-connection-check/health_check_id
Expand All @@ -92,7 +94,8 @@ jobs:
role-to-assume: arn:aws:iam::561178107736:role/PRX-GHA-AccessRole
role-session-name: gha-deploy-prxtransfer-dns-connection-checker

- uses: actions/download-artifact@v4
- name: Fetch health check IDs
uses: actions/download-artifact@v4
with:
path: components/hosted-zone

Expand All @@ -109,6 +112,14 @@ jobs:
prod_use1_nlb_hostname=$(aws cloudformation describe-stacks --stack-name infrastructure-cd-root-production --query "Stacks[0].Outputs[?OutputKey=='ExchangeFtpServerNlbDnsName'].OutputValue" --output text --region us-east-1)
prod_usw2_nlb_hostname=$(aws cloudformation describe-stacks --stack-name infrastructure-cd-root-production --query "Stacks[0].Outputs[?OutputKey=='ExchangeFtpServerNlbDnsName'].OutputValue" --output text --region us-west-2)
# Create a comma-delimited list of us-east-1 health check IDs
find . -path "*-targeting-us-east-1/health_check_id" -type f -exec cat {} \; > us_east_1
us_east_1_check_ids=$(cat us_east_1 | awk '{printf("%s,",$0)}' | sed 's/,\s*$//')
# Create a comma-delimited list of us-west-2 health check IDs
find . -path "*-targeting-us-west-2/health_check_id" -type f -exec cat {} \; > us_west_2
us_west_2_check_ids=$(cat us_west_2 | awk '{printf("%s,",$0)}' | sed 's/,\s*$//')
# Deploy the stack using all the values collected
aws cloudformation deploy \
--template-file template.yml \
Expand All @@ -121,4 +132,5 @@ jobs:
StagNlbHostnameUSWEST2=$stag_usw2_nlb_hostname \
ProdNlbHostnameUSEAST1=$prod_use1_nlb_hostname \
ProdNlbHostnameUSWEST2=$prod_usw2_nlb_hostname \
ProdHealthCheckIdsTargetingUSEAST1=
ProdHealthCheckIdsTargetingUSEAST1=$us_east_1_check_ids
ProdHealthCheckIdsTargetingUSWEST2=$us_west_2_check_ids

0 comments on commit dfed67b

Please sign in to comment.