I tried them and went back to zip packages. The cold starts are worse, and the failure mode with Cognito triggers is a user who can't sign in.
Don't use it when
- Always, unless you genuinely need a 10 GB image or a runtime Lambda doesn't offer.
In my words: what hurts
- Worse cold starts than zip packages.
- Deleting the image can break the function.
- With Cognito triggers, an idle container Lambda times out on reconnect and Cognito sign-in fails.
Gotchas, with fixes
Gotcha: Cognito gives trigger functions about 5 seconds. A cold container image can blow through that.
Fix: Keep Cognito triggers small, zip-packaged and Node.js.
Provisioning
Official Pulumi package · Official Terraform provider
Use instead
Zip-packaged Lambda functions, or Fargate when you really need a container.
Alternatives
- AWS Lambda Zip-packaged functions.
- Fargate scheduled tasks You really need a container.
Where it fits
- A job that runs for hours: Don't.
Not a workaround for long jobs: a container image still stops at Lambda's 15 minutes, with worse cold starts. If it needs a container and hours, run it on Fargate.
Instead: Fargate scheduled tasks
Last reviewed by Nicolas Dao