SlideShare a Scribd company logo
Local Lambda Development and Debugging
Matt Billock
matt@backand.com
Agenda:
● AWS Lambda Overview
● Debugging AWS Lambda
● Building a local test harness
● Deployment with Backand CLI
● Quick overview of Backand
AWS Lambda
● Created in 2014, launched at
re:Invent
● Kicked off "serverless" (caveat)
● Function-as-a-Service
○Deploy code, not applications
Creating A Lambda Function
● Supports Node.JS, Python, C#, and
Java
○ Can call to server functionality (Linux)
● Code deployment options
○ Uploading as a ZIP file
○ Uploading from S3
○ Editing in in-browser editor
Creating A Lambda Function
Demo
Calling AWS Lambda Functions
● Event-based triggers
○ Also On-Demand
● Event Sources
○ AWS Services (S3, DynamoDB, others)
○ API Gateway
○ AWS SDK
Debugging Lambda Functions
● Cloudwatch Integration
○ Provides call record
● console.log()
○ Sends message to Cloudwatch
● … and that's it
Lambda Execution Environment
● Details kept proprietary by Amazon
● Based on Amazon Machine Instance
● Dynamically provisioned (hot vs cold)
● Temporary storage (/tmp, 500 MB)
○ NOT guaranteed to persist
Debugging Lambda Locally
● Need to mimic input format
● Need to mimic output format
○ Transformations in API Gateway
● Need a test harness
Creating a Test Harness
● Function Prototype
● Including Handler
● Mimicking Lambda Invocation
○ Parameters in event object
○ Handlers in the context object
Creating a Test Harness
● Calling a Lambda function, continued:
● Provide handlers in context argument
Test Harness Notes
● Callback mechanism provided by Lambda
○ Only supported by Node.JS actions
● Using callbacks in context parameter
○ Not officially supported
● Not a perfect substitute
○ Calls the function, but not from the same
environment
Improving Iteration Speed
● Per-line output
● Immediate feedback
● Breakpoints and other local
debugging tools
● Unit and Integration tests
Deploying Your Code
● Zip-file from S3, or manual upload
○ NOTE: zip only the source code,
not the parent folder!
● Testing upload
● Publishing
● Complex, non-intuitive
Using Backand's CLI Tool
● Backand On-Demand Node.JS
Lambda actions
● Backand CLI abstracts away
deployment
● npm install -g backand
● Requires registering with Backand
Deploying Lambda Code
● Initializing an action- backand action init
○ Arguments available in docs.backand.com
● Copy your Node.JS code into created
directory
● Deploy - backand action deploy
○ Arguments available in docs.backand.com
Calling Your Lambda
● Authentication
○ can be anonymous
○ api.backand.com/1/token
○ See docs
● cURL
curl -H "<auth header>" "https://api.backand.com/1/objects/action/<object>?name=<name>"
● JavaScript (with Backand SDK)
backand.object.action.get(...)
What is Backand?
● Serverless app platform
● Manages your app's database
● Manages your app's security and
authentication
● Provides custom server-side code execution
● Provides hosting options
● Provides logging, analytics, and more
Backand Features
● Automated REST API
● Bring your own Database
● Custom JavaScript Actions
● Server-Side Code Execution
● Batch and Bulk Processing
● Scheduled Tasks
● Automated messages
● Real-time Communications
● User and Role-based
Security
● Social Media Authentication
● GUI Schema Editor
● Custom Queries
● REST API Playground
● Sample Code Generation
● Hosting
● Detailed Analytics
● Logging
● Multi-Platform SDK
● Single Sign On Support
THANK YOU
https://github.com/backand
https://www.backand.com
matt@backand.com

More Related Content

PPTX
Lamba scaffold webinar
PPTX
Lessons learned after a year of lambda - AWS Community Day SF 2017
PDF
So you want to write a cloud function
PDF
Next Generation Automation in Ruckus Wireless
PPTX
Dynamic in C# 4.0
PDF
PyConIT 2018 Writing and deploying serverless python applications
ODP
Go lambda-presentation
PDF
Making Service Deployments to AWS a breeze with Nova
Lamba scaffold webinar
Lessons learned after a year of lambda - AWS Community Day SF 2017
So you want to write a cloud function
Next Generation Automation in Ruckus Wireless
Dynamic in C# 4.0
PyConIT 2018 Writing and deploying serverless python applications
Go lambda-presentation
Making Service Deployments to AWS a breeze with Nova

What's hot (20)

PDF
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
PPTX
Aws Developer Associate Overview
KEY
Event machine
PPTX
The Road to Kubernetes
PDF
9th docker meetup 2016.07.13
PPTX
Experiences sharing about Lambda, Kinesis, and Postgresql
PDF
Serverless architecture: introduction & first steps
PDF
Rust with-kafka-07-02-2019
PDF
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
PDF
Integracia security do ci cd pipelines
PPTX
Rust kafka-5-2019-unskip
PDF
PDF
Angular2 - A story from the trenches
PDF
Aws Lambda in Swift - NSLondon - 3rd December 2020
PDF
Multitenant SaaS Apps In Rails By Iqbal Hasnan
PDF
Dynamic input tables lwc vs aura vs. visualforce
PDF
Introduction to Jhipster
PPTX
Lightning Web Components by Abdul Gafoor
PDF
From rest api to graph ql a 10 year journey
PPTX
Behavior-Driven Development with JGiven
Serverless Framework Workshop - Tyler Hendrickson, Chicago/burbs
Aws Developer Associate Overview
Event machine
The Road to Kubernetes
9th docker meetup 2016.07.13
Experiences sharing about Lambda, Kinesis, and Postgresql
Serverless architecture: introduction & first steps
Rust with-kafka-07-02-2019
Javantura v4 - Java or Scala – Web development with Playframework 2.5.x - Kre...
Integracia security do ci cd pipelines
Rust kafka-5-2019-unskip
Angular2 - A story from the trenches
Aws Lambda in Swift - NSLondon - 3rd December 2020
Multitenant SaaS Apps In Rails By Iqbal Hasnan
Dynamic input tables lwc vs aura vs. visualforce
Introduction to Jhipster
Lightning Web Components by Abdul Gafoor
From rest api to graph ql a 10 year journey
Behavior-Driven Development with JGiven
Ad

Similar to Local Lambda Debugging (20)

PDF
AWS Lambda Presentation (Tech Talk DC)
PDF
AWS Lambda
PDF
AWS Lambda Deployments: Best Practices and Common Mistakes O'Reilly Software...
PPTX
Introduction to AWS lambda & Serverless Application1.pptx
PPTX
Lambda lambda-lambda
PDF
Aws Lambda for Java Architects - Illinois VJug -2016-05-03
PPTX
2016 Utah Cloud Summit: AWS Lambda and API Gateway
PDF
10 Tips For Serverless Backends With NodeJS and AWS Lambda
PDF
Aws Lambda for Java Architects - JavaOne -2016-09-19
PDF
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
PDF
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
PDF
Building serverless apps with MongoDB Atlas and AWS Lambda
PDF
AWS Lambda
PPTX
PPTX
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
PDF
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
PPTX
lambda.pptx
PPTX
Containerless in the Cloud with AWS Lambda
PPTX
Building serverless app_using_aws_lambda_b4usolution
PDF
AWS Lambda and Serverless framework: lessons learned while building a serverl...
AWS Lambda Presentation (Tech Talk DC)
AWS Lambda
AWS Lambda Deployments: Best Practices and Common Mistakes O'Reilly Software...
Introduction to AWS lambda & Serverless Application1.pptx
Lambda lambda-lambda
Aws Lambda for Java Architects - Illinois VJug -2016-05-03
2016 Utah Cloud Summit: AWS Lambda and API Gateway
10 Tips For Serverless Backends With NodeJS and AWS Lambda
Aws Lambda for Java Architects - JavaOne -2016-09-19
Aws Lambda for Java Architects CJug-Chicago 2016-08-30
AWS Lambda for Architects - Chicago Coder Conference -2016-06-07
Building serverless apps with MongoDB Atlas and AWS Lambda
AWS Lambda
AWS Lambda Tutorial For Beginners | What is AWS Lambda? | AWS Tutorial For Be...
Aws Lambda for Java Architects - Illinois JUG-Northwest -2016-08-02
lambda.pptx
Containerless in the Cloud with AWS Lambda
Building serverless app_using_aws_lambda_b4usolution
AWS Lambda and Serverless framework: lessons learned while building a serverl...
Ad

Recently uploaded (20)

PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PPT
“AI and Expert System Decision Support & Business Intelligence Systems”
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
A comparative analysis of optical character recognition models for extracting...
PPTX
Machine Learning_overview_presentation.pptx
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Assigned Numbers - 2025 - Bluetooth® Document
PDF
Machine learning based COVID-19 study performance prediction
PDF
Unlocking AI with Model Context Protocol (MCP)
PPTX
Big Data Technologies - Introduction.pptx
PPTX
A Presentation on Artificial Intelligence
PDF
Network Security Unit 5.pdf for BCA BBA.
PPTX
Cloud computing and distributed systems.
PDF
cuic standard and advanced reporting.pdf
PDF
NewMind AI Weekly Chronicles - August'25-Week II
DOCX
The AUB Centre for AI in Media Proposal.docx
Digital-Transformation-Roadmap-for-Companies.pptx
“AI and Expert System Decision Support & Business Intelligence Systems”
Per capita expenditure prediction using model stacking based on satellite ima...
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
A comparative analysis of optical character recognition models for extracting...
Machine Learning_overview_presentation.pptx
Programs and apps: productivity, graphics, security and other tools
ACSFv1EN-58255 AWS Academy Cloud Security Foundations.pptx
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Assigned Numbers - 2025 - Bluetooth® Document
Machine learning based COVID-19 study performance prediction
Unlocking AI with Model Context Protocol (MCP)
Big Data Technologies - Introduction.pptx
A Presentation on Artificial Intelligence
Network Security Unit 5.pdf for BCA BBA.
Cloud computing and distributed systems.
cuic standard and advanced reporting.pdf
NewMind AI Weekly Chronicles - August'25-Week II
The AUB Centre for AI in Media Proposal.docx

Local Lambda Debugging

  • 1. Local Lambda Development and Debugging Matt Billock [email protected]
  • 2. Agenda: ● AWS Lambda Overview ● Debugging AWS Lambda ● Building a local test harness ● Deployment with Backand CLI ● Quick overview of Backand
  • 3. AWS Lambda ● Created in 2014, launched at re:Invent ● Kicked off "serverless" (caveat) ● Function-as-a-Service ○Deploy code, not applications
  • 4. Creating A Lambda Function ● Supports Node.JS, Python, C#, and Java ○ Can call to server functionality (Linux) ● Code deployment options ○ Uploading as a ZIP file ○ Uploading from S3 ○ Editing in in-browser editor
  • 5. Creating A Lambda Function Demo
  • 6. Calling AWS Lambda Functions ● Event-based triggers ○ Also On-Demand ● Event Sources ○ AWS Services (S3, DynamoDB, others) ○ API Gateway ○ AWS SDK
  • 7. Debugging Lambda Functions ● Cloudwatch Integration ○ Provides call record ● console.log() ○ Sends message to Cloudwatch ● … and that's it
  • 8. Lambda Execution Environment ● Details kept proprietary by Amazon ● Based on Amazon Machine Instance ● Dynamically provisioned (hot vs cold) ● Temporary storage (/tmp, 500 MB) ○ NOT guaranteed to persist
  • 9. Debugging Lambda Locally ● Need to mimic input format ● Need to mimic output format ○ Transformations in API Gateway ● Need a test harness
  • 10. Creating a Test Harness ● Function Prototype ● Including Handler ● Mimicking Lambda Invocation ○ Parameters in event object ○ Handlers in the context object
  • 11. Creating a Test Harness ● Calling a Lambda function, continued: ● Provide handlers in context argument
  • 12. Test Harness Notes ● Callback mechanism provided by Lambda ○ Only supported by Node.JS actions ● Using callbacks in context parameter ○ Not officially supported ● Not a perfect substitute ○ Calls the function, but not from the same environment
  • 13. Improving Iteration Speed ● Per-line output ● Immediate feedback ● Breakpoints and other local debugging tools ● Unit and Integration tests
  • 14. Deploying Your Code ● Zip-file from S3, or manual upload ○ NOTE: zip only the source code, not the parent folder! ● Testing upload ● Publishing ● Complex, non-intuitive
  • 15. Using Backand's CLI Tool ● Backand On-Demand Node.JS Lambda actions ● Backand CLI abstracts away deployment ● npm install -g backand ● Requires registering with Backand
  • 16. Deploying Lambda Code ● Initializing an action- backand action init ○ Arguments available in docs.backand.com ● Copy your Node.JS code into created directory ● Deploy - backand action deploy ○ Arguments available in docs.backand.com
  • 17. Calling Your Lambda ● Authentication ○ can be anonymous ○ api.backand.com/1/token ○ See docs ● cURL curl -H "<auth header>" "https://api.backand.com/1/objects/action/<object>?name=<name>" ● JavaScript (with Backand SDK) backand.object.action.get(...)
  • 18. What is Backand? ● Serverless app platform ● Manages your app's database ● Manages your app's security and authentication ● Provides custom server-side code execution ● Provides hosting options ● Provides logging, analytics, and more
  • 19. Backand Features ● Automated REST API ● Bring your own Database ● Custom JavaScript Actions ● Server-Side Code Execution ● Batch and Bulk Processing ● Scheduled Tasks ● Automated messages ● Real-time Communications ● User and Role-based Security ● Social Media Authentication ● GUI Schema Editor ● Custom Queries ● REST API Playground ● Sample Code Generation ● Hosting ● Detailed Analytics ● Logging ● Multi-Platform SDK ● Single Sign On Support