As part of the EC2 service Amazon offers a feature called “Elastic IP Addresses” (EIP). Exactly what are these and how can we use them to our advantage?
The idea behind Elastic IPs (which really are static addresses) in AWS is that you can reserve an IP address. Then you can assign that IP address to any AMI instance that you have running. The assignment can be changed to a different instance at any time if it suits your purposes.
According to Amazon this feature is designed for “dynamic cloud computing”. Once an EIP has been associated with an instance it remains tied to that instance until you decide to release it. EIPs can be assigned to or released from a running instance programmatically, with command line tools or via the browser based console. You pay for an EIP when it is not associated with an instance but not when it is.
Why might this be useful? Well, for one thing, it allows considerable flexibility in implementing a web-based solution. Instance failures can be handled by simply remapping the EIP to any healthy instance you control. This removes the need to wait for someone to possibly have to replace hardware. There is also no delay as would be the case if you had to use a new IP address and have that propagate through DNS. Finally, you have control over the specific technology you use to implement your solution. You can change your solution stack at any time and not disrupt your customer’s ability to connect to your site.
An additional benefit that EIP gives you is the ability to configure for reverse DNS lookup. This is recommended if you intend to send email from your account. To limit spam Amazon, by default, puts limits on the amount of email that can be sent from EC2 accounts. Providing EIPs and the associated domain name can reduce the chance that your emails will be flagged as spam (unless, of course you violate the terms of service!).
This screencast shows how to use Amazon Elastic IPs addresses to flexibly manage a website in your own domain:
There are certainly lots of features to explore and exploit in EC2 and AWS. By utilizing this infrastructure (IaaS) effectively the developer gains a lot of flexibility and control when implementing a solution. In Learning Tree’s Cloud Computing course we consider IaaS in context with the other services defined in the SPI model (Software, Platform and Infrastructure as a Service).