| Invocation Type | Behavior | Services | Error Handling |
|---|---|---|---|
| Synchronous | Caller waits for response | API Gateway, ALB, Cognito, Alexa | Caller handles errors |
| Asynchronous | Lambda queues event, returns 202 | S3, SNS, EventBridge, SES | 2 retries, then DLQ |
| Event Source Mapping | Lambda polls for records | Kinesis, DynamoDB Streams, SQS | Retry until success or record expires |
| Setting | Description | Limits/Best Practices |
|---|---|---|
| Memory | 128 MB to 10,240 MB | CPU scales proportionally with memory |
| Timeout | Maximum execution time | 1 second to 15 minutes max |
| Ephemeral Storage | /tmp directory | 512 MB to 10,240 MB |
| Environment Variables | Key-value configuration | 4 KB total, use Secrets Manager for secrets |
| Reserved Concurrency | Limits concurrent executions | Protects downstream resources |
| Provisioned Concurrency | Pre-warmed execution environments | Eliminates cold starts, extra cost |
• Deployment Package: 50 MB zipped (direct upload), 250 MB unzipped
• Container Image: Up to 10 GB
• Concurrent Executions: 1,000 per region (soft limit)
• Invocation Payload: 6 MB (sync), 256 KB (async)
| Feature | Lambda@Edge | CloudFront Functions |
|---|---|---|
| Runtime | Node.js, Python | JavaScript only |
| Execution Time | 5-30 seconds | < 1 millisecond |
| Memory | 128 MB - 10 GB | 2 MB |
| Network Access | Yes | No |
| Use Cases | Origin request/response manipulation | Viewer request/response (headers, URL rewrites) |
• Kinesis/DynamoDB Streams: Parallelization factor up to 10 per shard
• SQS: Batch size 1-10,000, long polling enabled automatically
• SQS FIFO: Scales by number of message groups
• Failure Handling: Bisect batch on error, max retry attempts, max record age
| Type | Execution | Duration | Pricing | Use Cases |
|---|---|---|---|---|
| Standard | Exactly-once | Up to 1 year | Per state transition | Long-running workflows |
| Express | At-least-once | Up to 5 minutes | Per execution + duration | High-volume event processing |
• EventBridge: Serverless event bus (rules, targets, schemas)
• AppSync: Managed GraphQL API service
• SAM: Serverless Application Model (CloudFormation extension)