Your EC2 instance is assigned a fixed public IP from a list of Elastic IPs. But Amazon charges a considerable amount of money for the Elastic IP. Is there a way to automatically update the IP address of a DNS record defined in Amazon Route53 from the EC2 instance? Yes, there is, and it’s not hard. You can write a “bootstrap” script that is executed when the instance is started. The script will update the public DNS record according to the public IP of the instance.
1. Allow EC2 changing Route53 records
Detailed instructions for creating an IAM role
Log into your AWS management console.
Proceed to AIM (“Identity and Access Management”). Click on Roles. Click on Create role.
Select AWS service as the trusted entity type.
Select EC2 for the Use Case, then select EC2 (“Allows EC2 instances to call AWS services on your behalf”)
In the Permission policies, select AmazonRoute53FullAccess.
Click on Next: Tags (optional step, you can add tags to organize and manage your role).
Click on Next: Review.
Name your role. Choose a name that makes sense for its purpose, like EC2Route53UpdateRole.
(Optional) Add a description that explains the role’s purpose, like “Allows EC2 instances to update Route 53 DNS records.”
Review your choices and click on Create role.
Finalize and use the Role
After creating the role, … >>> Click to read the full post...