Update Route53 DNS records from your EC2 instance using this simple Ruby script. You can call it from rc.local after setting your hostname locally. First parameter is the desired <hostname>.<domain> Domain and other parameters are hardcoded. This script is useful for handling internal DNS changes in your systems after instance changes.
Attached is also IAM policy for your AWS IAM user. You should create a new user for this and not use your admin credentials to keep the security tight.