# Automatically allocate and associate elastic IP with newly created ec2 instance

**Project:** Servers | **Board:** Planned | **Votes:** 6
**URL:** https://roadmap.ploi.io/projects/1-server-level-requests/items/199-automatically-allocate-and-associate-elastic-ip-with-newly-created-ec2-instance

---

Currently a public IPv4 address is automatically generated for a new ec2 instance. This IP is released when an instance is stopped, hibernated, or terminated. A stopped or hibernated instance receives a new public IP address when it is started.

To prevent an instance from changing IPs we would like to have an option to allocate and associate an elastic IP when creating a new server.

---

## Comments

**Dennis** (2022-08-04T07:02:11+00:00):
[@Ruben-Van-Erk](/user/Ruben-Van-Erk) Is there an endpoint where we can get those elastic IPs from with AWS?

**Ruben van Erk** (2022-08-04T07:11:58+00:00):
Probably, but I'm not familiar with the AWS api.

**Robin** (2022-08-08T13:24:44+00:00):
[@Dennis](/user/Dennis) https://docs.aws.amazon.com/sdk-for-php/v3/developer-guide/ec2-examples-using-elastic-ip-addresses.html

