Benefits
- Easy Pricing:
• Pay per request and compute time
- Free tier of 1,000,000 AWS Lambda requests and 400,000 GBs of compute time
- Integrated with the whole AWS suite of services
- Integrated with many programming languages
- Easy monitoring through AWS CloudWatch
- Easy to get more resources per functions (up to 10GB of RAM!)
- Increasing RAM will also improve CPU and network.
Lambda with EventBridge
- use lambda with eventbridge rules to set up a serverless cron
- EventBridge has two types of rules:
- Rules with event pattern
- Schedule ( Cron )
Lambda with S3 Event Notifications
- use case: generate thumbnails of images uploaded to s3
Lambda Permissions
- IAM Roles
- grant lambda function permission to AWS Services
- Resource-based Policies
- Give other AWS Services permission to invoke lambda functions
Lambda Performance
- Any code that takes a lot of time to execute ( such as opening a db connection ) should be placed outside of your lambda function handler.