This document discusses bridging the gap between serverless and containers by leveraging AWS Lambda container image support. It begins by introducing the speaker and their experience with serverless technologies. The rest of the document is organized into sections that discuss why serverless and containers make sense together, demonstrate how to implement and migrate to Lambda container images using examples, highlight some pitfalls to watch out for, and argue that containers can be improved with a serverless-first approach.
DevEX - reference for building teams, processes, and platforms
AWS Lambda Containers - bridging the gap between serverless and containers once and for all
1. AWS Lambda
Containers
Bridging the Gap
between
Serverless and
Containers once
and for all
24/02/2021 Serverless Meetup Sydney
Yun Zhi Lin
Partner - Deloitte Platform Engineering
2. About Me
Yun = Cloud 云
Partner at Deloitte Platform
Engineering
Serverless First since 2016
Author of serverless-golang
and 2018 lambda benchmarks
@yunzhilin
@mrserveless
What people think I do: What I really do:
3. Agenda
• Tell me why?
• Implementation/Migration
• Pitfalls to watch for
• Make containers great again!
5. Time for a Poll!
• Do you use serverless technologies in anger in Production?
• Do you use containers in anger in Production?
NEW FLASH: As of 9/2/2021, Lambda Container Image support is
available in Sydney region!
7. Serverless != FaaS
don’t pay for it if no
one uses it
(except storage)
Don’t need to worry
about scaling (up or
down)
Don’t need to
provision and manage
servers
DynamoDB
Amazon S3
AWS Amplify
Lex
Lambda
11. Anatomy of a Lambda Container
Use AWS Base Image Migrate Your Own Base Image
Source Files
Deps Source Files
Deps
Runtime Interface
Client (RIC)
ENTRYPOINT
ENTRYPOINT
Runtime Interface
Emulatior (RIE)
12. Demo Time
Code is here: serverlesscloud/serverless-
containers (github.com)
Serverless and SAM
Java, Node, Golang
Build, Local Run, Deploy
14. What’s wrong this architecture?
Dev Account
UAT Account
Prod Account
Dev Lambda
UAT Lambda
Prod Lambda
Dev ECR
UAT ECR
Prod ECR
IMG:v1
IMG:v1
IMG:v1
15. Should be more like this right?
Platform Shared Services
Dev Account Prod Account
UAT Lambda Prod Lambda
Central ECR
IMG:v1
Dev Lambda
UAT Account
IMG:v1 IMG:v1
18. Tooling Comparison
Functionality Serverless Framework SAM
Scaffolding No Container templates as of v2.25.2 Yes
AWS SSO No Add support for AWS CLI v2 SSO
profiles · Issue #7567 ·
serverless/serverless (github.com)
Yes
Local Run No – work around with docker run sam local invoke
sam local start-api
Docker build wrapper No – but that’s good! Yes via sam build – but why?
Deploy Lambda type =
Image
Yes Yes
20. Serverless First is
even easier with
Container
Portability!
And App
Modernisation is
more Streamlined
21. Remember
Serverless + Containers gives new meaning to
Serverless First and Legacy App Migration
Serverless + Containers brings new Developer
Experience
Serverless != FaaS
Containers != Kubernetes
22. Code and
References
• GitHub - serverlesscloud/serverless-containers
• Using container image support for AWS Lambda with AWS
SAM | AWS Compute Blog (amazon.com)
• Packaging AWS Lambda functions as container images | A
Cloud Guru
• AWS Lambda runtime API - AWS Lambda (amazon.com)
• https://github.com/aws/aws-lambda-python-runtime-
interface-client
• https://github.com/aws/aws-lambda-runtime-interface-
emulator/