Reputation: 347
To save money when using AWS I will stop the instances that I don't need. When the instance restarts Amazon assigns a new name to the server.
For example, the AWS DDNS name of the server might be: ec2-123-123-123-123.compute-1.amazonaws.com
Then you stop and restart the server and the new name is: ec2-321-321-321-321.compute-1.amazonaws.com
This is a little annoying if you have scripts set up to ssh
into the old box name. What's the most cost effective way to keep the Amazon generated name without keeping the instance running and accruing charges?
Upvotes: 1
Views: 56
Reputation: 14533
For your above use case AWS provides Elastic IP address which you can associate to the EC2 instances and set the scripts to use that Elastic IP address. So even if you stop and start the instance you can allocate the instance with the same Elastic Ip address so that you don't have to make any changes to the script.
And also Elastic Ip when in use with a EC2 instance is free.
Upvotes: 3