ALB alternatives for side projects?

I only have one internet facing service. I’m using ECS, so am relying on ALB to do load balancing and health checks.

With the new ipv4 price increase, ALB is minimum $33/month. This is for a small side project, so $33/mo is like half my bill. Was wondering if there were any alternatives that offered container load balancing at a lower price? I use CDK if that helps.

Spin up an ec2 micro instance with nginx and proxypass to the ecs service

Just use host headers for routing on the ALB.

One ALB can route for a shitload of domains/target groups/etc.

A few options come to mind like: share an ALB, use cloudflare reverse tunneling, host your own load balancer.

They all have tradeoffs as you’re going to spend your own time on it instead of having AWS do it for you. While an HAProxy (or nginx) instance might ‘work’, even if you’re not doing maintenance, it’s not the same capacity or quality as one of those hosted services, especially if you just do the setup and then never patch or check it.

Switch to EC2 and run your container on the ec2 host.

Assuming that a small side project doesn’t carry much traffic, two options come to mind:

  1. Use Lambda + API Gateway instead of ECS+ALB. That would cost you practically zero if there isn’t much traffic.

  2. Use Cloud Map and API Gateway to address your ECS Service: https://aws.amazon.com/blogs/architecture/field-notes-integrating-http-apis-with-aws-cloud-map-and-amazon-ecs-services/ (you can skip the VPC Interface Endpoints if you have a NAT Gateway / instance or your Fargate task runs with public IP)

There are other ugly options like using a public Cloud Map DNS zone with Service Discovery and public Fargate IPs, but I’d not recommend that.

Cloud Map + API GW is definitely the way to go for this. It works great and is effectively free for low-traffic services

What about switching to IPv6?

How would that help?

- You need IPv4 to serve IPv4 end users (Cloudflare can help with that)

- You cannot disable IPv4 on ALB, so the IPv4 tax remains even if you only use IPv6

The IPv4 charge is for public IP addresses only. You can still use private IPv4 addresses without additional costs.

I don’t know enough about the setup in question, OP didn’t provide much detail, that’s why I’m asking.

You can set up AAAA records with IPv6 addresses, most browsers support IPv6 and IPv4 using Happy Eyeballs strategy.

You can put the ECS service in a public subnet and then create an R53 A record that routes traffic to the public IP of the task. It’s not nice but it’s cheap.

It’s reasonable to assume that OP is using a public ALB for an “internet facing service” – which would use public IPv4.

An internal ALB would block IPv6 traffic arriving via IGW. I just learned that this behavior seems to be configurable though. Did you mean that – using an internal ALB and disabling this setting?

I know DNS entries support IPv6, browsers and many other clients support IPv6. I’m reading stuff like end-to-end connectivity using Internet Protocol version 6 and think that it should (???) be possible setting up the AWS infrastructure without public IPv4 addresses, right?

I’m not a network expert, that’s why I’m asking “what about switching to IPv6”? Is it possible?

Or is it “we (AWS) start charging you for public IPv4 addresses, because they are limited and costly, but don’t even dream of using IPv6 only, we don’t support that”?

Ah, I think is misread your initial reply.

You’re right, the world is very much ready for IPv6. But on AWS, you get solid IPv6 only in EC2 and basic networking. Running without public IPv4 is practically impossible if you’re using additional services like ALB and ECS.

Cool, thanks for the link.

I think I will dig deeper into this. Within the FinOps community, there already plenty of people asking what you can do about this new charge. Might be time for a new article.

This is a great general suggestion and we do this. However I think the op wants to go from 1 to 0 albs.

If you are using ECS that means your application is already containerized. So you can switch to AppRunner and have it run your containers without the need for setting up ALB, and all the the other infra.

Do you actually need a load balancer?

Not really. If you’re doing HTTP only, sure. In today’s world though, the expectation is that sites will use HTTPS. With an ALB, you are limited to just 25 HTTPS certificates. Each certificate can have up to 100 Alternate Names, but then you get into the problem of exposing the names of multiple unrelated customers in a single SSL cert. Might be OK, might not, but best case a single ALB can support 2500 domains.

We have use cases that require answering for 25,000+ HTTPS hostnames. The only practical path to doing that is an NLB passing traffic to an NGINX or other similar target group for actual SSL termination.

This is the way.
There is a step by step from Aiden Steele on how to do this
https://awsteele.com/blog/2022/10/15/cheap-serverless-containers-using-api-gateway.html