Hacker News new | ask | show | jobs
by Aeolun 1343 days ago
But don’t try to create a REST API Gateway with more than 200 resources, or CloudFormation will randomly start failing.

Or try to add more than 100 rules to your ALB, because it’ll be impossible.

My biggest issue with AWS is that the limits are so arbitrary, and seem to solely exist due to terrible design decisions.

If my local express server, or nginx can deal with 100 endpoints, how is it possible for this multi billion dollar infinitely scalable service to not do the same…

2 comments

Interesting, I haven't had the experience with CloudFormation.

At that scale, however, I tend to group my Lambdas as microservices not per endpoint. It helps with cold start time as well. So for example, if I have a page" resource, I don't make that 5+ endpoints, I make it a wildcard / prefix match and do the routing inside of the service lambda.

Maybe you legitimately have 100+ different microservices, in which case, I don't doubt that is a problem, I just haven't experienced it.

I mean, there are certainly ways to work around the silly limitations. I just feel like I shouldn’t have to.
The 200 resources thing has been a really frustrating problem for us too. We've started migrating ours to separate API Gateways at a "service" level and then mapping paths to different APIs using the Custom Domain API Mappings.
> We've started migrating ours to separate API Gateways at a "service" level and then mapping paths to different APIs using the Custom Domain API Mappings.

Yeah, that was suggested to us too, but it felt like a dirty hack to me. What is the point of having an API gateway if you can’t have the single one (our microservices hook themselves up to that single gateway).

Our solution involves a custom CDK resource that keeps re-creating API gateways until it gets a root resource ID starting in the lower range of the alphabet, ensuring it’ll always be found by CloudFormation.