Assign a Fixed/Static IP to AWS EC2 Instance

Great, you have an AWS EC2 instance. EC2 instance is widely used as server by developers, where many of your applications point. After creation of EC2 instance you get an IP. But whenever you stop or restart your instance, every time you get a new IP. Due to this outside world cannot stay connected to your machine. So, here Elastic IP comes into picture. With this feature of AWS you can assign static IP to your EC2 instance.

Follow below steps to assign a static IP to your instance:

  • Navigate to your EC2 dashboard.
  • In the left side pane click “Elastic IPs” under “Network and Security”.ec2 (13)
  • Click on “Allocate New Address”.ec2 (14)
  • Now you got a new static IP. We have to associate this IP with an Instance.
  • Select the IP you just created and click on “Actions”. And then click on “Associate Address”.ec2 (15)
  • Now, in the pop up just came, click in “Instance”. Your running instance should appear, select one. And click on “Associate”.ec2 (16)
  • Great, the new IP is assigned to your instance.
  • Now you can access your machine from the IP we just created.

**Note: If you create an IP, then it should be associated with any running instance on AWS. Any unassociated IP is charged as $0.01/hr. this is done in order to prevent reserving IP unnecessarily.

Reference : Amazon Webservices Docs

If you find any difficulties or suggestions, post below.

If you find this article important, Do share.

Happy Learning!

Leave a Reply

Your email address will not be published. Required fields are marked *