Skip to content
This repository has been archived by the owner on Sep 9, 2023. It is now read-only.
/ aws-route53 Public archive

AWS Route53 Resource Record Sets Cleanup Mechanism

License

Notifications You must be signed in to change notification settings

theodore86/aws-route53

Repository files navigation

Linting

AWS (DNS) Route53 RRSets Cleanup

Delete/Cleanup resource records sets from the selected hosted zone of the AWS Route53.

Features:

  • AWS route53 resource record sets cleanup mechanism:
    • Supports dry-run mode before any resource record deletion.
    • Supports regex to include resource records for deletion.

Usage:

Copy the AWS credentials

You can get the credentials from: AWS management console -> Command line or programmatic access

Export the AWS credentials

export AWS_ACCESS_KEY_ID=<value> AWS_SECRET_ACCESS_KEY=<value> AWS_SESSION_TOKEN=<value> (`optional-MFA`)

Install the required dependencies

pip3 install --user requirements.txt

Dry-run before any AWS Route53 resource record deletion:

python3 record_cleanup.py --dryrun --regex '.*record.*' --aws-hosted-zone myzone.test.co

Delete the AWS Route53 resource records in the selected zone:

python3 record_cleanup.py --regex '.*record.*' --aws-hosted-zone myzone.test.co

Delete the AWS Route53 resource records using Docker (recommended):

docker build -t aws_route53_cleanup:latest . && \
docker run --rm -it -e AWS_ACCESS_KEY_ID="<value>" -e AWS_SECRET_ACCESS_KEY="<value>" \
  -e AWS_SESSION_TOKEN="<value>" aws_route53_cleanup:latest \
  --regex '.*pattern.*' --aws-hosted-zone "<name>"