Elastic IP Address in AWS:
An Elastic IP address in AWS is a unique, static IP address designed for dynamic cloud computing. When you launch a virtual server (an EC2 instance) on AWS, it's given an IP address. However, this IP address can change if you stop and start your instance. Public IP is dynamic by default.
To give static IP, we use elastic IP.
Check your Ec2 instance Public and Private IPv4 address
Allocate Ip Address
Step 1: Search Elastic Ip and then Click on Allocate Elastic IP address button
Step 2: choose the region
Elastic ip is successfully created
This Elastic Ip address is not allocated to any instance yet
Step 3: To allocate the elastic ip, select the instance -> Actions -> Associate Elastic Ip address
Select Instance to whom you want to allocate elastic ip. You can also select network interface.
And now select that running instance to which you want to assign this elastic ip. You can see the instance id here
Provide Private IP address is optional
click on Associate
Now the elastic IP is associated to that instance
Click on the Associated Instance ID, refesh the running EC2 instance
Public Ip address is now assigned as elastic IP address
After stopping and restarting the instance, we can see the public ip address is same as previous one