* We write our HTTP services and package them in containers.
* We add the Lambda Web Adapter into the Dockerfile.
* We push the image to ECR.
* There's a hook lambda that creates a service on ECS/Fargate (the first-party Kubernetes equivalent on AWS) and a lambda.
* Both are prepped to receive traffic from the ALB, but only one of them is activated.
For services that make sense on lambda, they ALB routes traffic to the lambda, otherwise to the service.
The other comments here have more detailed arguments over which service would do better where, but the decision making tree is a bit like this:
* is this a service with very few invocations? Probably use lambda.
* is there constant load on this service? Probably use the service.
* if load is mixed or if there's are lot of idle time in the request handling flow, figure out the inflection point at which a service would be cheaper. And run that.
While we wish there was a fully automated way to do this, this is working well for us.