Serverless Developer Guide
Deploy with containers
If you need a custom runtime that is not provided by AWS, you can create and deploy a custom 
container image. AWS provides base images preloaded with a language runtime and other 
components that are required to run the image on Lambda. AWS provides a Dockerﬁle for each of 
the base images to help with building your container image.
Custom containers are one way you might experiment with lift and shift of existing code to 
Lambda runtimes. If you do this, consider the architectural diﬀerences between always running 
containers, versus on demand nature of Lambda functions.
Related resource:
• Deploy container images
Add code with Layers
A Lambda layer is a .zip ﬁle archive that can contain additional code or other content. A layer can 
contain libraries, a custom runtime, data, or conﬁguration ﬁles. Layers are also necessary if your 
function .zip archive exceeds the size limit.
Layers provide a convenient way to package libraries and other dependencies that you can use with 
your Lambda functions. Using layers reduces the size of uploaded deployment archives and makes 
it faster to deploy your code. Layers also promote code sharing and separation of responsibilities so 
that you can iterate faster on writing business logic.
Related resource:
• Creating and sharing Lambda layers
Extensions
You can use Lambda extensions to augment your Lambda functions. For example, use Lambda 
Extensions to integrate with your preferred monitoring, observability, security, and governance 
tools.
Lambda supports internal or external extensions. An internal extension runs as part of the runtime 
process. An external extension runs as an independent process in the execution environment and 
continues to run after the function invocation is fully processed.
Advanced Topics 58