In this post, you will find how to update AWS Route53 from your current public IP (ISP) and how to use EC2 instance metadata to change your DNS A Record.
To use this script, you will need:
pip install awscli)
apt-get install dnsutils)
Update Route53 with your current home Public IP
First, I was facing an issue with my current ISP with non-static IP address, so I found a useful script to update AWS Route53 on a daily basis from my RaspberryPi.
Please find the how-to on my GitHub
Update Route53 with your current EC2 Metadata from an instance in an ASG
I didn’t want to setup an ALB/ELB because it cost too much for my needs (labs). So I’ve adapted this article to meet my needs.
Follow the same steps and adapt
UserData from my Launch Configuration below:
update-route53-A.json & Update53-EC2Pub.sh
In this example, I’ve compressed and hosted source in a simple S3 bucket, and using it with UserData instance.
It’s working pretty well, with scheduled actions on my ASG, my instance is shutting down at night every day, and fire-up on the next morning, the public IP is automatically updated to my AWS Route53 A Record.
Don’t hesitate to ping me with any question