I'm looking at this architecture diagram:
My ultimate goals is to deploy a ECS/Fargate cluster on AWS. I know that the ALB can be a bit expensive, and I was wondering if I could use API gateway instead. I'll still have a few containers running (maybe 2-3 max at the beginning) so I'd still need some sort of load balancing capability.
Is it possible?
API Gateway is designed to be a front-end for native AWS services (mostly, Lambda), and handle things like authorization, rate limiting and some rudimentary caching. If your backend logic lives in a bunch of lambdas and you need a non AWS-aware client (like a mobile app or a SPA in a browser) call it over HTTP, API gateway is the way to go.
API gateway does support integration with HTTP endpoints, but no load balancing.
If your workload truly calls for compute instances (that is, long-running processes that persist a non-trivial state in memory or on a local drive, shared and updated by many concurrent units of work), then you'll need a load balancer of some kind.
If your units of work share no or minimal state in memory that can be easily hydrated from the database, you might be better of implementing it in lambdas. In this case, you can get away with an API gateway, as Lambda runtime will handle the balancing.