Delete/Cleanup resource records sets from the selected hosted zone of the AWS Route53.
- AWS route53 resource record sets cleanup mechanism:
- Supports
dry-run
mode before any resource record deletion. - Supports
regex
to include resource records for deletion.
- Supports
You can get the credentials from:
AWS management console -> Command line or programmatic access
export AWS_ACCESS_KEY_ID=<value> AWS_SECRET_ACCESS_KEY=<value> AWS_SESSION_TOKEN=<value> (`optional-MFA`)
pip3 install --user requirements.txt
python3 record_cleanup.py --dryrun --regex '.*record.*' --aws-hosted-zone myzone.test.co
python3 record_cleanup.py --regex '.*record.*' --aws-hosted-zone myzone.test.co
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>"