How to migrate off EIP on EC2?

by mskaon 9/4/2024, 12:39 PMwith 2 comments

Elastic IPs (EIPs) now come with charges, and AWS also limits accounts to a maximum of five by default, with requests for quota increases often being rejected.

Currently, to run an EC2 instance under a custom domain, there are two main approaches:

A Record (Route53) -> EIP -> EC2: This method uses a paid Elastic IP, which is subject to the strict quota (max 5 by default). It works but becomes costly if managing multiple projects.

CName Record (Route53) -> Dynamic IP Service URL (e.g., No-IP) -> EC2’s non-static IP: This involves updating the IP dynamically via a script with each deployment. It's more affordable, removes the IP limit, but may cause some downtime during updates.

Are there any other options that could be considered? Hosting small-scale projects on AWS has become more difficult and expensive over time. While $5/month for Option 1 may seem manageable, costs quickly add up when running 10-20 projects. Even if you're willing to pay, the limit on IPs can be restrictive if AWS doesn’t approve an increase in quotas.

by frxon 9/4/2024, 12:45 PM

You can use IPv6 behind CloudFront but it is not supported as an origin yet [1]

If IPv6 addresses are free while in use like IPv4 used to be, this would be the cheapest option

[1] https://repost.aws/questions/QUOWEDVURTSxWkSlenuHaS4g/cloudf...

by re-thcon 9/4/2024, 12:49 PM

If they're all in the same region create a load balancer e.g. ALB and run all the projects through it. It's 1 IP for those 10-20 projects.