An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. This IP address is associated with your AWS account. With an Elastic IP address, you can mask the failure of an instance or software by rapidly remapping the address to another instance in your account.
It is a public IPv4 address, which is use to access AWS instances and resources from local machines via the Internet. If your instance does not have a public IPv4 address, you can associate an Elastic IP address with your instance to enable communication with the Internet.
The basic characteristics of an Elastic IP address:
- You need to first allocate one Elastic IP to your account, and then associate it with your instance or a network interface.
- When you associate an Elastic IP address with an instance or its primary network interface, the instance’s public IPv4 address is released back into Amazon’s pool of public IPv4 addresses. You cannot reuse a public IPv4 address.
- You can associate, disassociate and reassociate your one Elastic IP address with your AWS different resources.
- An Elastic IP address is for use in a specific region only.
- When you associate an Elastic IP address with an instance that previously had a public IPv4 address, the public DNS hostname of the instance changes to match the Elastic IP address.
- While your instance is running, you are not charged for one Elastic IP address associated with the instance, but you are charged for any additional Elastic IP addresses associated with the instance. (Source: http://docs.aws.amazon.com/)
Task list for the module 7:
- To Allocate a new Elastic IP address and configure it for the dinostore website which is running on the primary web server
- To reassociate the Elastic IP address for the replica server “WebServer 02” and configure it for the dinostore website which is running on the secondary web server
The architecture of the project:
Steps for the task: To Allocate a new Elastic IP address and configure it for the dinostore website which is running on the primary web server
In this task, I will create a new elastic IP address and I will associate it with my primary web server. And I will check that is my website running from through this newly create Elastic IP address or not!
- Firstly, You need to allocate a new address. Go to the EC2 dashboard from services Menu in the AWS Management Console. Click “Allocate New Address” and next page, Click “Allocate”. An IP address will be automatically allocated.
- In this step, You will associate to your newly created Elastic IP address with your instance “Web Server”. Go to the “Action” menu. Select “Associate Address” and click on it.
- Now associate your instance with the Elastic IP. Select Instance or Network Instance. Select the instance from the top down list and private IP. Then click “Associate“.
- Your instance and private IP will be associated with that Elastic IP Address. You can view it from the Elastic IPs panel of the EC2 Dashboard.
- Now open your browser from your local machines. Run your dinostore website. You can see it is running from the public DNS address. Now replace the public DNS address with the Elastic IP Address. Note: you can see your website is working with the new elastic IP address. Notices that your Private address is same in both cases.
Steps for the task: To reassociate the Elastic IP address for the replica server “WebServer 02” and configure it for the dinostore website which is running on the secondary web server
In this task, I will disassociate that Elastic IP address and reassociate it with the AMI instance “webserver02 “. Then I will test with the dinostore website for checking is it working or not!
- Go to the Action menu from the Elastic IP console page. Choose the “Disassociate address” and click on it. That Elastic IP address will be unmapped from the primary web server.
- Go the Action Menu again. Click “Associate“. This time you will associate it with your AMI instance “WebServer02“.
- Now you need to open your website with the public DNS address and replace it with Elastic IP which is associated with AMI Instance Server.
After complete all of the above tasks, You will successfully able to hosting your website with an elastic IP address. During implementing this module, I did not face any problem. I hope you will able to deploy it smoothly.
Remember that When you allocate an Elastic IP address, it’s for use only in a VPC. And it would remain associated If you stop an instance. By default, all AWS accounts are limited to 5 Elastic IP addresses per region, because public IPv4 Internet addresses are a scarce public resource.
The next Module I will discuss “Module Using ELB to Scale Applications”