Tech Junkie Blog - Real World Tutorials, Happy Coding!: Iaas With AWS: Create An Elastic IP And Assign It To An Instance

Wednesday, August 11, 2021

Iaas With AWS: Create An Elastic IP And Assign It To An Instance

 When an instance is created in AWS a public and private IP is assigned to the instance.  The private IP does not change, but the public IP address changes each time the instance reboot or is stopped.  On reboot you might be lucky enough to grab the same public IP, but it's not guaranteed.  But on stoppage you will definitely be assigned a new public IP.

That's probably not a good thing a real world situation, that's where an Elastic IP comes into play.  An Elastic IP is a static IP that when assigned does not change.  However, there's no free lunch so you will be charged for it.  So only create one if you really need it.  I would recommend that you use the public DNS instead when you are not in production.  Say the development and test environment.  You might want to spend some money on the staging environment to mirror production as close as possible.

In the following section I will show you how to create an Elastic IP and assign it to an instance.  You probably want to delete it after you create it if you do not want to pay.  Only keep it if you want to use it.

So to create an Elastic IP, click on the "Elastic IPs" link under "Network & Security" section in the instances page








Click on "Allocate Elastic IP address"


Accept the default and click on "Allocate"


You will see that a new Elastic IP has been allocated to you


Even though an Elastic IP has been allocated, it still has not been associated with any resources, the next thing we want to do is associate it with our Linux instance.  To do that click on the "Actions" dropdown and select "Associate Elastic IP address"
Under "Resource type" select "Instance", then fill in the Instance id and the private IP address.  Those should be dropdowns.  Then click "Associate"


If you go back to the instance "Description" tab you should see that the Elastic IP has been associated with the instance, and it has replaced the dynamic public IP that was assigned by default.  It would not change on restart or stoppage from now on.

8 comments:

  1. Your blog is very informative, finally, I found exactly what I want. Paypal is an excellent service for online payments but lots of its users confront issues while they access Paypal. If you want to resolve your problems then must visit contact Paypal Nederland.

    ReplyDelete
  2. Your blog is very informative and interesting to read, finally, I found exactly what I search for. Thanks for sharing such outstanding look sharing whit us. Some points express here were new for me and it was really amazing to go during such educational post. it’s very useful for me & for other I hope you will share some more Please keep sharing!
    If you want to learn TUTORIALS.
    Visit Tutorialsmate, It provide you the best tutorial free.

    ReplyDelete
  3. Thanks you very much for sharing nice article - Java Vogue

    ReplyDelete
  4. Going for a free assistance isn't pretty much as great as it might appear, since it may amazingly be confined. In any event, going for a costly help in case you are simply beginning with sites is recommendable all things considered.https://onohosting.com/

    ReplyDelete

Search This Blog