Skip to content

20 Advanced Tips for AWS Lambda

Published: at 01:12 PM

AWS Lambda is a serverless compute service that runs your code in response to events and automatically manages the underlying compute resources for you. It’s the most basic serverless building block, especially for event-driven architectures.

Here’s how it works:

Obviously, that code runs somewhere. The point is that you don’t manage or care where (‘cause it’s serverless, you see). Every time a request comes in, Lambda will either use an available execution environment or start a new one. That means Lambda scales up and down automatically and nearly instantly.

Here’s the fine details:

Actionable tips

The most important tip is that you don’t need to do everything in this list, and you don’t need to do everything right now. But take your time to read it, I bet there’s at least one thing in there that you should be doing but aren’t.

Lambda is supported by every IaC tool out there. But if you’re working with serverless, you’ll want to check out these options (and pick one, don’t mix them):

All of the above are great, but a bit limited for running things locally. LocalStack is better (though some features are paid). Try to use your IaC tool’s capabilities, but if you hit a wall, definitely give LocalStack a shot.

Serverless Land is a place with a ton of serverless resources.

And check out the Serverlespressso AWS Workshop. They built a serverless app to serve coffee, and set up a coffee shop at the expo in AWS Re:Invent 2021.