How to the set the hostname in an AWS ec2 instance to a unique value in an autoscale group?
This is more or less the approach that I take. It makes a lot of sense to include the instance ID in the hostname, as this makes it very easy to identify and associate running servers with instances in the web console or other API commands.
Is there a better approach to this?
What's your definition of "better"?
If it works for you, just go with it. Instance IDs are guaranteed to be unique within an account, and you already have a solution using those IDs, so it sounds like you're all set.