AWS Lambda
- a compute service where you can upload your code and create a Lambda function
- it take cares of provisioning and managing the servers that you use to run your code
- you don't have to worry about your operating systems, patching, scaling, etc.
AWS Lambda Usage
- as an even-drivent compute service where AWS Lambda runs your code in response to events. these events could be changes to data in an Amazon S3 bucket or an Amazon DynamoDB table.
- as a compute service to run your code in response to HTTP requests using Amazon API Gateway or API calls made using AWS SDKs
Currently available Lambda triggers
- API Gateway
- AWS IoT
- Alexa Skills Kit
- Alexa Smart Home
- CloudFront
- CloudWatch Events
- CloudWatch Logs
- Code Commit
- Cognito Sync Trigger
- DynamoDB
- Kinesis
- S3
- SNS
AWS Lambda Behavior
- 1 lambda per HTTP request
AWS Lambda Supported Languages
- Node.js
- Java
- Python
- C#
AWS Lambda Pricing
- Number of requests
- first 1 million requests are free. $0.20 per 1 million requests thereafter
- Duration
- Duration is calculated from the time your code begins executing until it returns or otherwise terminates, rounded up to the nearest 100ms.
- The price depends on the amount of memory you allocate to your function.
- You are charged $0.00001667 for every GB-second used
Why is Lambda cool?
- No servers
- Continous Scaling
- super super super cheap!
Lambda Exam Tips
- Lambda scales out (not up) automatically
- Lambda functions are independent, 1 event = 1 function
- Lambda is serverless
- Know what services are serverless
- Lambda functions can trigger other lambda functions, 1 event can = x functions if functions trigger other functions
- Architectures can get extremely complicated, AWS X-ray allows you to debug what is happening
- Lambda can do things globally, you can use it to back up S3 buckets to other S3 buckets etc
- know your triggers
- Lambda's duration time is maximum 5 minutes