SlideShare a Scribd company logo
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Donnie Prakoso, MSc
AWS Technology Evangelist, ASEAN
How to Use AWS Lambda Layers
and Lambda Runtime
@donnieprakoso
donnieprakoso
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
> hello, world
Donnie Prakoso, MSc
AWS Technology Evangelist
@donnieprakoso
donnieprakoso
• Speak in Go and Python
• Container, Machine Learning and Serverless
• I AWS User Groups
#TEMENNYAPETRA
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
What we’re going to talk today
• Quick review on serverless
• Previously on AWS Lambda
• Introducing AWS Lambda Layers and Lambda Runtime
• Few ideas on best practices
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Means …
No servers to provision
or manage
Scales with usage
Never pay for idle Built in availability and
fault tolerance
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Services for Building Serverless Applications
AWS Lambda
Amazon DynamoDB
Amazon SNS
Amazon API Gateway
Amazon SQS
Amazon Kinesis
Amazon S3
Compute and API Proxy
AWS X-Ray
AWS Step Functions
Datastores, Storage, Orchestration, Analytics, Interprocess Messaging
Developer Tools
AWS CodeBuild
AWS CodePipeline
AWS Serverless
Application Model (SAM)
Open Source and
third parties
Lambda@Edge
AWS Cloud9
Amazon Aurora
Serverless (preview)
AWS AppSync
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Serverless Applications
Services (anything)
Changes in
data state
Requests to
endpoints
Changes in
resource state
Event source Lambda function
Node.js
Python
Java
C#
Go
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Focus on building business logic.
!
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
Previously on AWS Lambda
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
How?
• How about common functions?
• How to separate lib, modules, frameworks?
• How to share common libs?
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Extend the Lambda execution
environment with any binaries,
dependencies, or runtimes
Lambda Layers
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
BUSINESS
LOGIC
LIB
A
LIB
B
Programming
Model
Before
BUSINESS
LOGIC
BUSINESS
LOGIC
BUSINESS
LOGIC
BUSINESS
LOGIC
LIB
A
LIB
B
After
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Business Logic{}
CI/CD for App & Dependencies
Streamline Development with AWS Lambda, Layers and Runtime
APP
Sourc
e Build Test
Deplo
y{}
Source Build Test Deploy
Lambda Layer
Lambda Layer
Lambda Layer
Sourc
e Build Test
Deplo
y
Sourc
e Build Test
Deplo
y
{}
{}
LIBRARIES
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Languages
Lambda
support
for Ruby
+ Bring any Linux compatible language
runtime;
Powered by new Runtime API - Codifies
the runtime calling conventions and
integration points
Same technology powering Ruby
support in AWS Lambda
Bring any Linux compatible
language runtime
Custom Runtimes
+
AWSOPENSOURCE
o f f e r e d b y
o f f e r e d b y
o f f e r e d b y
o f f e r e d b y
PARTNERSUPPORTED
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
UNDER THE HOOD - How does custom runtimes work?
1 • Retrieve settings
2 • Initialize the function
3 • Handle errors
1 • Get event
2 • Tracing
3 • Handle errors
4 • Invoke function
5 • Response handling
6 • Error handling
7 • Cleanup
Processing TasksInitialization Tasks
bootstrapBuild runtime
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Lambda Runtime API - Runtime Interactions
• POST /runtime/init/error
• GET /runtime/invocation/next
• The invocation-id is in the Lambda-Runtime-Aws-Request-Id header
• For AWS X-Ray there is a tracing header Lambda-Runtime-Trace-Id
• POST /runtime/invocation/{invocation-id}/response
• POST /runtime/invocation/{invocation-id}/error
• Sample Endpoint + Resource Path
• http://${AWS_LAMBDA_RUNTIME_API}/2018-06-
01/runtime/invocation/next
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Image credit to BukaLapak
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Open Source Runtimes
• C++ (AWS)
• Rust (AWS)
• Erlang (AlertLogic)
• Elixir (AlertLogic)
• Cobol (Blu Age)
• Node.js (NodeSource N|Solid)
• PHP (Stackery)
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Wrapping Up
• Experiments!
• Lambda Layers help you to simplify your system by enforcing separation
of concerns. Dependencies or business logic?
• Use existing available Lambda Layer and if it doesn’t suit your needs…
build one!
• Bring your own interpreter for any language of your choice
© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark
Go Build!
Donnie Prakoso
AWS Technology Evangelist, ASEAN
@donnieprakoso
donnieprakoso

More Related Content

What's hot (15)

PPTX
AWS Lambda
Andrew Dixon
 
PDF
aws lambda & api gateway
fumihiko hata
 
PDF
AWS Serverless Introduction (Lambda)
Ashish Kushwaha
 
PPTX
AWS Lambda
Julian Kleinhans
 
PDF
AWS Lambda Documentation
Whizlabs
 
PDF
Amazon Elastic Block Storage and Balancer
Whizlabs
 
PPTX
AWS - Lambda Fundamentals
Piyush Agrawal
 
PDF
Serverless Architectures on AWS Lambda
Serhat Can
 
PPTX
Serverless computing
Dmitriy Ivanov
 
PPTX
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
Simplilearn
 
PDF
Serverless Computing
Rushi Namani
 
PPTX
Introduction To AWS & AWS Lambda
An Nguyen
 
PDF
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
Edureka!
 
PDF
Serverless computing with AWS Lambda
Apigee | Google Cloud
 
PDF
AWS Lambda
Scott Leberknight
 
AWS Lambda
Andrew Dixon
 
aws lambda & api gateway
fumihiko hata
 
AWS Serverless Introduction (Lambda)
Ashish Kushwaha
 
AWS Lambda
Julian Kleinhans
 
AWS Lambda Documentation
Whizlabs
 
Amazon Elastic Block Storage and Balancer
Whizlabs
 
AWS - Lambda Fundamentals
Piyush Agrawal
 
Serverless Architectures on AWS Lambda
Serhat Can
 
Serverless computing
Dmitriy Ivanov
 
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
Simplilearn
 
Serverless Computing
Rushi Namani
 
Introduction To AWS & AWS Lambda
An Nguyen
 
AWS Lambda Tutorial | Introduction to AWS Lambda | AWS Tutorial | AWS Trainin...
Edureka!
 
Serverless computing with AWS Lambda
Apigee | Google Cloud
 
AWS Lambda
Scott Leberknight
 

Similar to How to Use AWS Lambda Layers and Lambda Runtime (20)

PDF
Serverless applications with AWS
javier ramirez
 
PDF
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
PDF
Building serverless backends - Tech talk 5 May 2017
ARDC
 
PDF
Overview aws-lambda-security
mustafa sarac
 
PDF
Getting started building your first serverless web application on AWS
Ioannis Polyzos
 
PPTX
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
Chris Munns
 
PDF
Serverless workshop with Amazon Web Services
TheFamily
 
PPTX
The family - presentation on AWS Serverless
Alexandre Pinhel
 
PPTX
Building self service framework
Rovshan Musayev
 
PPTX
Containerless in the Cloud with AWS Lambda
Ryan Cuprak
 
PDF
What’s new in serverless - re:Invent 2020
AWS Chicago
 
PDF
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
PDF
The serverless LAMP stack
⛷️ Ben Smith
 
PPTX
Getting started with Serverless on AWS
Adrian Hornsby
 
PDF
Serverless on AWS: Architectural Patterns and Best Practices
Vladimir Simek
 
PDF
Getting Started with AWS Lambda and Serverless Computing
Kristana Kane
 
PDF
Serverless best practices plus design principles 20m version
Heitor Lessa
 
PDF
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 
PDF
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
Derek Ashmore
 
PDF
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
Serverless applications with AWS
javier ramirez
 
Stephen Liedig: Building Serverless Backends with AWS Lambda and API Gateway
Steve Androulakis
 
Building serverless backends - Tech talk 5 May 2017
ARDC
 
Overview aws-lambda-security
mustafa sarac
 
Getting started building your first serverless web application on AWS
Ioannis Polyzos
 
Gluecon 2018 - The Best Practices and Hard Lessons Learned of Serverless Appl...
Chris Munns
 
Serverless workshop with Amazon Web Services
TheFamily
 
The family - presentation on AWS Serverless
Alexandre Pinhel
 
Building self service framework
Rovshan Musayev
 
Containerless in the Cloud with AWS Lambda
Ryan Cuprak
 
What’s new in serverless - re:Invent 2020
AWS Chicago
 
Getting Started with AWS Lambda & Serverless Cloud
Ian Massingham
 
The serverless LAMP stack
⛷️ Ben Smith
 
Getting started with Serverless on AWS
Adrian Hornsby
 
Serverless on AWS: Architectural Patterns and Best Practices
Vladimir Simek
 
Getting Started with AWS Lambda and Serverless Computing
Kristana Kane
 
Serverless best practices plus design principles 20m version
Heitor Lessa
 
20200520 - Como empezar a desarrollar aplicaciones serverless
Marcia Villalba
 
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
Derek Ashmore
 
Introduction to Serverless Computing - OOP Munich
Boaz Ziniman
 
Ad

More from Donnie Prakoso (7)

PDF
Programming Infrastructure with AWS CDK
Donnie Prakoso
 
PDF
Modern Application Development for Startups
Donnie Prakoso
 
PDF
Operating Microservices at Hyperscale — Tech in Asia PDC 2019
Donnie Prakoso
 
PDF
More Containers Less Operations
Donnie Prakoso
 
PDF
Serverless Text Analytics with Amazon Comprehend
Donnie Prakoso
 
PDF
Building Serverless Microservices with AWS
Donnie Prakoso
 
PPTX
Design, Build, and Modernize Your Web Applications with AWS
Donnie Prakoso
 
Programming Infrastructure with AWS CDK
Donnie Prakoso
 
Modern Application Development for Startups
Donnie Prakoso
 
Operating Microservices at Hyperscale — Tech in Asia PDC 2019
Donnie Prakoso
 
More Containers Less Operations
Donnie Prakoso
 
Serverless Text Analytics with Amazon Comprehend
Donnie Prakoso
 
Building Serverless Microservices with AWS
Donnie Prakoso
 
Design, Build, and Modernize Your Web Applications with AWS
Donnie Prakoso
 
Ad

Recently uploaded (20)

PDF
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
PPTX
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
PDF
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
PPTX
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
PPTX
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
PPTX
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
PPTX
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
PDF
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
PPTX
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
PDF
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
PPTX
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
PDF
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
PDF
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
PDF
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
PDF
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
PPTX
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
PDF
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
PDF
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
PDF
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
PPTX
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 
The Rise of AI and IoT in Mobile App Tech.pdf
IMG Global Infotech
 
MuleSoft MCP Support (Model Context Protocol) and Use Case Demo
shyamraj55
 
Transforming Utility Networks: Large-scale Data Migrations with FME
Safe Software
 
AI Penetration Testing Essentials: A Cybersecurity Guide for 2025
defencerabbit Team
 
Mastering ODC + Okta Configuration - Chennai OSUG
HathiMaryA
 
Designing_the_Future_AI_Driven_Product_Experiences_Across_Devices.pptx
presentifyai
 
"Autonomy of LLM Agents: Current State and Future Prospects", Oles` Petriv
Fwdays
 
“NPU IP Hardware Shaped Through Software and Use-case Analysis,” a Presentati...
Edge AI and Vision Alliance
 
The Project Compass - GDG on Campus MSIT
dscmsitkol
 
[Newgen] NewgenONE Marvin Brochure 1.pdf
darshakparmar
 
From Sci-Fi to Reality: Exploring AI Evolution
Svetlana Meissner
 
“Voice Interfaces on a Budget: Building Real-time Speech Recognition on Low-c...
Edge AI and Vision Alliance
 
Smart Trailers 2025 Update with History and Overview
Paul Menig
 
Building Real-Time Digital Twins with IBM Maximo & ArcGIS Indoors
Safe Software
 
Newgen 2022-Forrester Newgen TEI_13 05 2022-The-Total-Economic-Impact-Newgen-...
darshakparmar
 
Future Tech Innovations 2025 – A TechLists Insight
TechLists
 
What’s my job again? Slides from Mark Simos talk at 2025 Tampa BSides
Mark Simos
 
LOOPS in C Programming Language - Technology
RishabhDwivedi43
 
CIFDAQ Market Insights for July 7th 2025
CIFDAQ
 
Webinar: Introduction to LF Energy EVerest
DanBrown980551
 

How to Use AWS Lambda Layers and Lambda Runtime

  • 1. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Donnie Prakoso, MSc AWS Technology Evangelist, ASEAN How to Use AWS Lambda Layers and Lambda Runtime @donnieprakoso donnieprakoso
  • 2. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark > hello, world Donnie Prakoso, MSc AWS Technology Evangelist @donnieprakoso donnieprakoso • Speak in Go and Python • Container, Machine Learning and Serverless • I AWS User Groups #TEMENNYAPETRA
  • 3. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark What we’re going to talk today • Quick review on serverless • Previously on AWS Lambda • Introducing AWS Lambda Layers and Lambda Runtime • Few ideas on best practices
  • 4. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Means … No servers to provision or manage Scales with usage Never pay for idle Built in availability and fault tolerance
  • 5. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Services for Building Serverless Applications AWS Lambda Amazon DynamoDB Amazon SNS Amazon API Gateway Amazon SQS Amazon Kinesis Amazon S3 Compute and API Proxy AWS X-Ray AWS Step Functions Datastores, Storage, Orchestration, Analytics, Interprocess Messaging Developer Tools AWS CodeBuild AWS CodePipeline AWS Serverless Application Model (SAM) Open Source and third parties Lambda@Edge AWS Cloud9 Amazon Aurora Serverless (preview) AWS AppSync
  • 6. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Serverless Applications Services (anything) Changes in data state Requests to endpoints Changes in resource state Event source Lambda function Node.js Python Java C# Go
  • 7. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Focus on building business logic. !
  • 8. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B Previously on AWS Lambda
  • 9. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark How? • How about common functions? • How to separate lib, modules, frameworks? • How to share common libs?
  • 10. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Extend the Lambda execution environment with any binaries, dependencies, or runtimes Lambda Layers BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B BUSINESS LOGIC LIB A LIB B Programming Model Before BUSINESS LOGIC BUSINESS LOGIC BUSINESS LOGIC BUSINESS LOGIC LIB A LIB B After
  • 11. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Business Logic{} CI/CD for App & Dependencies Streamline Development with AWS Lambda, Layers and Runtime APP Sourc e Build Test Deplo y{} Source Build Test Deploy Lambda Layer Lambda Layer Lambda Layer Sourc e Build Test Deplo y Sourc e Build Test Deplo y {} {} LIBRARIES
  • 12. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Languages Lambda support for Ruby + Bring any Linux compatible language runtime; Powered by new Runtime API - Codifies the runtime calling conventions and integration points Same technology powering Ruby support in AWS Lambda Bring any Linux compatible language runtime Custom Runtimes + AWSOPENSOURCE o f f e r e d b y o f f e r e d b y o f f e r e d b y o f f e r e d b y PARTNERSUPPORTED
  • 13. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark UNDER THE HOOD - How does custom runtimes work? 1 • Retrieve settings 2 • Initialize the function 3 • Handle errors 1 • Get event 2 • Tracing 3 • Handle errors 4 • Invoke function 5 • Response handling 6 • Error handling 7 • Cleanup Processing TasksInitialization Tasks bootstrapBuild runtime
  • 14. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Lambda Runtime API - Runtime Interactions • POST /runtime/init/error • GET /runtime/invocation/next • The invocation-id is in the Lambda-Runtime-Aws-Request-Id header • For AWS X-Ray there is a tracing header Lambda-Runtime-Trace-Id • POST /runtime/invocation/{invocation-id}/response • POST /runtime/invocation/{invocation-id}/error • Sample Endpoint + Resource Path • http://${AWS_LAMBDA_RUNTIME_API}/2018-06- 01/runtime/invocation/next
  • 15. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Image credit to BukaLapak
  • 16. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Open Source Runtimes • C++ (AWS) • Rust (AWS) • Erlang (AlertLogic) • Elixir (AlertLogic) • Cobol (Blu Age) • Node.js (NodeSource N|Solid) • PHP (Stackery)
  • 17. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Wrapping Up • Experiments! • Lambda Layers help you to simplify your system by enforcing separation of concerns. Dependencies or business logic? • Use existing available Lambda Layer and if it doesn’t suit your needs… build one! • Bring your own interpreter for any language of your choice
  • 18. © 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark© 2018, Amazon Web Services, Inc. or its Affiliates. All rights reserved. Amazon Confidential and Trademark Go Build! Donnie Prakoso AWS Technology Evangelist, ASEAN @donnieprakoso donnieprakoso