Purging Route53 Zones

The setup and tear-down of Route53 hosted zones doesn’t happen often. In order to delete a hosted zone all records except the NS and SOA records need to be deleted. This can be difficult if you have a zone with a few thousand records - common if you are seeding your reverse and forward lookups. When you are sure a zone needs to purged, you can lean on the below script to purge all records from a hosted zone while saving a backup locally.

Share