On Amazon EC2, the system hostname is changed either on boot. This can cause license errors.
On EC2 servers, you must utilize the Cloud Config system. Amazon has instructions available to set the hostname permanently.
If you continue to have hostname resets after the above guide has been followed, you should contact Amazon support using the link at the bottom of the above guide regarding this matter.