user8424883
user8424883

Reputation:

how to stop my public ip address from changing in ec2 instance

I have one ec2 instance running on aws. I am stopping and starting it by using the Lambda expression at a specific time interval. Whenever (ec2) instance starts from stop mode. it's public IP changes every time due to this always I have to change my Ip address for a hosted website in domain registrar. How to stop this IP from changing or assign an unchangeable Ip address.

Upvotes: 2

Views: 2949

Answers (1)

Juned Ahsan
Juned Ahsan

Reputation: 68715

You can get an AWS Elastic IP and attach to your instance.

An Elastic IP address is a static IPv4 address designed for dynamic cloud computing. An Elastic 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.

Here is the confirmation that elastic IP is not released when you stop an instance.

When you stop a running instance, the following happens:

The instance retains its associated Elastic IP addresses. You're charged for any Elastic IP addresses associated with a stopped instance. With EC2-Classic, an Elastic IP address is dissociated from your instance when you stop it. For more information, see EC2-Classic.

Source : https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/Stop_Start.html

Upvotes: 3

Related Questions