AWS has announced that it will charge $0.005 per hour per public IPv4 address starting February 2024. Source: https://aws.amazon.com/blogs/aws/new-aws-public-ipv4-address-charge-public-ip-insights/
I've researched ways to mitigate these costs and read various documentations, but I would like to hear from the active community to better understand this issue.
In my research, I found an alternative approach involving a public/private VPC setup where internet access occurs through a NAT Gateway. This would eliminate the need for multiple public IPv4 addresses, keeping only one to be paid for. However, using the NAT Gateway would incur its own costs and might not be worthwhile for a small architecture.
My architecture is based on three applications in Elastic Beanstalk, each with its instance having a public IPv4 for clients to access the platform through a browser. Another public IPv4 is allocated to the RDS MySQL.
This will result in a cost of $0.005/hour/public IPv4 → 0.005 * 24 * 31 * 4 = $14.88.
Meanwhile, using a public/private VPC with NAT Gateway would incur costs like:
- NAT Gateway hourly charges: $0.045/hour/NAT Gateway x 730 hours x 1 NAT Gateway = $32.85/month
- NAT Gateway data processing fees: $0.045/GB x 10 GB (assuming 10 GB traffic) = $0.45/month
- Public IPv4 address charges in use: $0.005/IP/hour x 730 hours x 1 Elastic IP = $3.65/month
- Therefore, US$ 32.85 + US$ 0.45 + US$ 3.65 = US$ 36.95
My question is whether it's possible to mitigate the cost of the public IPv4. Can anyone provide guidance?
NAT Gateway can only be used for outbound access.
With Elastic Beanstalk your flows are ingressing into your apps, so NAT Gateway is of no help there.
You can associate Beanstalk apps with a VPC to expose them on private IPs and then front them with Application Load Balancer (ALB) or a Virtual Appliance like Aviatrix Gateway to use one public IP for multiple EB applications.