I use Python SDK to delete DNS record sets in Route53
. Due to Route53
API throttling, the deletion fails sometimes and the stale DNS record set is building up.
As the DNS record set approaches the 10,000 limit, I want to delete the record sets that were created last year because they are not needed any longer. But I am unable to find the record creation time either using AWS CLI
or using Python SDK (Boto3
). Is there a way to get the DNS record creation time in Route53
using CLI
or SDK
?
Amazon Route 53 is designed to propagate updates you make to your DNS records to its world-wide network of authoritative DNS servers within 60 seconds under normal conditions. A change is successfully propagated world-wide when the API call returns an INSYNC status listing.
The AWS documentation states: "If an alias record points to an AWS resource, you can't set the time to live (TTL); Route 53 uses the default TTL for the resource."
Using AWS Route 53, it takes only 10 minutes to get ready to serve web site on a specific domain name you want to use.
Why does it take between 24-48hrs for changes made to a hosted zone in Amazon Route53 to reflect globally? DNS resolvers around the world cna only reflect the changes in their cache after the Time to Live (TTL) has expired, it is 24hrs by default.
After analysing the root cause of the problem you are facing, I think it is not specifically related to python or boto3, but it is related to your algorithm and aws route 53 service behavior, you said:
I use Python SDK to delete DNS record sets in Route53. Due to Route53 API throttling, the deletion fails sometimes and the stale DNS record set is building up.
I would recommend you to use a SQS queue as intermediate to delete records from Route53 asynchronously, eventually using exponential backoff and dead letter queues to improve the reliability of your process if you think some deletion is broken by another reason and should be postponed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With