I'm looking for a way to save on costs in my test environments. Is there a CDK construct available that can substitute an Application Load Balancer (ALB) with an EC2 instance? Something that can just drop in easily would be ideal.
5 Answers
If you're not using separate accounts for your environments, you can actually share the same ALB. Utilizing listener rules can help; I favor DNS-based rules like app.testing.your-company.com for this.
Have you considered using nginx instead? It won't directly relate to the fck-nat construct, but it can serve as a functional load balancer.
The reason fck-nat is useful is that in many setups, a NAT gateway isn't crucial; its failure won't majorly impact production. In contrast, load balancers are usually critical and can bottleneck scaling. You can technically use nginx, but it involves more work than configuring NAT, which is pretty straightforward on Linux.
If cost is a concern, you might want to consider hosting on a VPS instead of using AWS, which tends to be expensive for these use cases.
True! Maybe we should just archive the fck-nat library and tell AWS to reconsider their startup credits!
I don't think there's a substitute available just yet. Load balancing has a lot of complexities and configs that are needed to match what AWS ALB provides, which makes it tricky to find a simple replacement.
Definitely agree with that, it’s more involved than it seems.

I'm more on the lookout for a drop-in replacement or a construct like fck-nat.