There are times when using an instances DNS string is fine but there are other times when you always want to know what your servers IP address is.
This is where elastic IP addresses come in.
First step is to create an elastic IP address
From the EC2 Dashboard select Elastic IPs
Click on Allocate New Address
There is an important choice here between EC2 and VCP make sure you choose the correct one for your environment and click Yes, Allocate
Your new Static Public IP address is created click close and on to Associate Address step.
To Associate the address click on Associate Address then from the popup screen click inside the instance box and a list of current instances appears select the correct on and click associate.
If you are not sure which one it is go back to instances and look for the instance ID
After you have clicked the associate button you can view which IP address is associated with each instance.
Note there is a nominal fee for elastic IP addresses that are not associated with a running instance. So keep that in mind and don’t create elastic IP’s if you are not going to use them.