The documentation for setting the hostname on AWS Linux AMI can be found here. However, what if you wanted to do it with a command line?
Try this -
MY_SERVER=my_host.rhapsody.com.au
sed -i "s/^\(HOSTNAME\s*=\s*\).*$/\1${MY_SERVER}/" /etc/sysconfig/network