Static IP addresses for Amazon Web Services instances
This very blog you are reading right now is running on a t2.micro instance in the Amazon Web Services Cloud. The T2 micro instances are some of the cheapest options when running a full time server in the AWS cloud. Normally when running these types of instances, we want to keep the cost down as much as possible. I’ve recently wrote about my Migration to AWS here, where I talk about how much it actually costs. (Spoiler alert: Around 11 bucks a month)
One thing I just recently learned was that Amazon also offers free static IP addresses for their instances. One IP per instance to be exact and you have to have it associated or else you will be charged a nominal fee. They want the IPs that are dedicated to actually be in use. Makes sense. The benefit of adding a static IP address is managing all the DNS records associated with this website. I can set it all up once and not worry that it will change when the instance is restarted. Based on Amazon Docs, you ALWAYS get a new IP address when you Start/Stop your instance without the elastic IP.
You will not be billed for elastic IP if these basic conditions are met –
- Elastic IP allocated to you is associated with EC2 instance
- That EC2 instance has only one elastic IP associated
- That EC2 instance is in running state.
In order to get a static Elastic IP, you should go to your AWS dashboard and choose your Elastic IP
You then click Allocate new address and then Associate address.
The whole process is super easy and quick and didn’t even require a restart of the instance. When/if you do start or stop the instance, you will need to just go back to the Elastic IP section and re-associate the address with the instance. It honestly couldn’t be easier and it’s FREE! I’m not sure I can think of a downside to doing this ever. So if you are running an AWS hosted site, be sure to check out the Elastic IP address feature.
Having the Elastic IPs makes the whole DNS process much more manageable and set it/forget it.
Happy IP’ing!