Typically I set ssh aliases as follows:
ssh -i ~/path/key.pem ubuntu@public-host-name.compute-x.amazonaws.com
But with EC2 instances, the public-host-name
changes whenever an instance is stopped and restarted.
My EC2 instances are on a VPN and have constant private IPs. What strategy can I use so that I can log into my instances without constantly changing the alias?
Thanks!