Skip to content

Commit

Permalink
Only remove all Route53 subdomains if REAPER env variable set (#822)
Browse files Browse the repository at this point in the history
Signed-off-by: Ryan Emerson <[email protected]>
  • Loading branch information
ryanemerson committed May 20, 2024
1 parent f0d092d commit 664f3b0
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
1 change: 1 addition & 0 deletions .github/workflows/auto-delete-on-schedule.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ jobs:
run: ./provision/aws/route53/route53_delete.sh
env:
AWS_REGION: ${{ vars.AWS_DEFAULT_REGION }}
REAPER: TRUE

delete-check:
needs: [rosa-delete, aurora-delete, route53-delete]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,6 @@ requests to the primary cluster.
== Remove Route 53 Failover

To delete the generated subdomain including the health checks, run the following command.
If no subdomain is specified, all health checks are removed.

[source,bash]
----
Expand Down
7 changes: 6 additions & 1 deletion provision/aws/route53/route53_delete.sh
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,12 @@ SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
source ${SCRIPT_DIR}/route53_common.sh

if [ -z "${SUBDOMAIN}" ]; then
echo "'SUBDOMAIN' env not set, removing all Route 53 records and health checks associated with *.${ROOT_DOMAIN}"
if [ "${REAPER^^}" != "TRUE" ]; then
echo "'SUBDOMAIN' env must be set"
exit 1
else
echo "'SUBDOMAIN' not set, removing all Route 53 records and health checks associated with *.${ROOT_DOMAIN}"
fi
fi

DOMAIN="${SUBDOMAIN}.${ROOT_DOMAIN}"
Expand Down

0 comments on commit 664f3b0

Please sign in to comment.