2. In this webinar:
● 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)
● Multiple types of code integration
○ Uploading as a ZIP file
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
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