Scott's Recipes Logo

AWS Tutorial 07 - Understanding Elastic IPs

Any ec2 instance, let’s call it a node for simplicity’s sake, in AWS has a number of network settings that define how you access it. Here’s an example:

aws_tutorial_07.png

So this box has both a public IP and a public DNS address. And these are how you access the node - until its restarted. At which point the node will be assigned a fresh IP address and a matching DNS address. And, at this point, your SSH settings / browser settings for accessing that box need to be reset. And if you’re using an SSH config file to make accessing the box easy, well, you have to change it. And that sucks.

The key here is to assign an Elastic IP Address to the box so a consistent ip address and matching domain name is persistently attached to the node so even if you restart it / resize it / etc, you can always access it in the same way.

Here’s how to do that:

aws_tutorial_07.png

aws_tutorial_07.png

aws_tutorial_07.png

aws_tutorial_07.png

aws_tutorial_07.png

aws_tutorial_07.png

And, wham! Your box now has a permanent IP address associated with it. You can now use that for SSH / DNS / SSH config files, etc.

Notes

There are some issues with Elastic IPs that you need to understand: