2. What is Lambda?
• Event-driven managed
compute service
• Stateless code execution,
no affinity to underlying
infrastructure
• Announced November
2014
3. Benefits of Lambda
• Run code without
managing servers
• Infinitely scalable
• Built-in high availability
• Pay only for what you use
• Zero administration
10. Lambda Function Code
• Execution Environment
– Runs on Amazon Linux
– AWS SDK included by default
• Available Runtimes
– Node.js
– Python 2.7
– Java 8
• Bring your own libraries
– Native library support
11. Lambda Function Permissions
• IAM Role
– Best Practice: Never hardcode
username/password or Access/Secret keys
• Specify granular permissions for each
function to other AWS resources
– S3
– DynamoDB
– Kinesis
• Coming Soon: VPC
15. Example Use Case:
Security Group Change Notifications
http://www.1strategy.com/blog/security-group-change-notifications/
16. Lambda Pricing
• Pricing based on memory
allocation and number of requests
• CPU, network I/O, disk I/O
determined by memory allocation
• Billed in 100ms increments
• No hourly, daily, or monthly
minimums
• Free Tier
– 400,000 GB-seconds every month
17. Sample Cost Comparison Assumptions
Sample Scenario
• 1 million requests
• 1 second processing time per request
• Highly-Available
18. Sample Cost Comparison
Using EC2
• 2x t2.micro
– $0.013/hour * 750 hours
• Total: $19.50
Using Lambda
• 1,000,000 requests
– First million requests are free
• 1,000,000 GB-seconds
– 400,000 GB-seconds are free
– 600,000 * $0.000001667 per
100ms
• Total: $10
20. API Gateway Overview
• Create, publish,
maintain, monitor and
secure APIs
• Works with EC2,
Lambda, or any web
application as the
backend
• Pay only for what you
use
21. API Gateway and Lambda
• Built-in controls for throttling
• Automatic monitoring through CloudWatch
• API Versioning
• Using Lambda
– API Gateway becomes an “Event Source”