3 ways to back up Route 53 records
1. Actual “export” using the AWS CLI
This is the most commonly used method. Entering the following command in the terminal saves all records in the current hosted zone to a JSON file. This effectively serves as an “export.”
# Extract all record sets in JSON format aws route53 list-resource-record-sets --hosted-zone-id [HOSTED_ZONE_ID] --output json > backup_records.json
2. Infrastructure as Code (IaC)
Managing records as code makes the code itself a complete backup.
Tools: Terraform, AWS CloudFormation, CDK.
Benefits: Even if you accidentally delete a record, it can be restored with a single
terraform apply. You can also use Git to perfectly track who, when, and why a record was modified.
3. Automated script using the AWS CLI
This method automatically extracts records every night and stores them in S3.
Command:
aws route53 list-resource-record-sets --hosted-zone-id [ZONE_ID]Method: Write a simple Lambda function that runs the command above, and configure it to run daily using EventBridge. Saving the results to S3 in JSON format creates an excellent backup system.
Change history tracking: AWS Config
Backups are important, but it is also important to know, “Who changed my record?”
Enabling AWS Config records configuration changes to Route 53 resources.
When a record is deleted or modified, you can check what its previous state was on a timeline, which is extremely helpful for manual recovery.
Backup method comparison
Category | Console export | IaC (Terraform, etc.) | Automated script (CLI) |
Difficulty | Very low | Moderate | Moderate |
Automation | Not possible (manual) | Fully automated | Fully automated |
Recovery speed | Moderate | Very fast | Moderate (manual restoration required) |
Recommended for | Solo administrators | Enterprise operating environments | Development teams/DevOps |
Comments
0 comments
Article is closed for comments.