Function Configuration
- Memory: 128 MB to 10,240 MB (10 GB) in 1 MB increments.
- Timeout: 1 second to 15 minutes maximum.
- Ephemeral storage (/tmp): 512 MB to 10,240 MB.
- Deployment package: 50 MB zipped, 250 MB unzipped. Use layers for shared code/libraries.
- Environment variables are encrypted at rest with KMS; max 4 KB total.
- Runtime: choose from Node.js, Python, Java, .NET, Go, Ruby, or custom runtime.
Concurrency & Scaling
- Default regional concurrency limit: 1,000 concurrent executions.
- Reserved concurrency: guarantees a fixed pool for one function, blocks others from using it.
- Provisioned concurrency: pre-warms execution environments to eliminate cold starts.
- Lambda scales by creating new execution environments for each concurrent invocation.
- Event source mappings (SQS, Kinesis, DynamoDB Streams) batch records and invoke synchronously.
Invocation Models
- Synchronous: caller waits for response (API Gateway, SDK invoke). Errors return immediately.
- Asynchronous: Lambda queues the event (S3, SNS, EventBridge). Retries twice on failure. Configure DLQ or destination.
- Event source mapping: Lambda polls the source (SQS, Kinesis, DynamoDB Streams). Failed batches retry until success or expiry.
Versions & Aliases
- A version is an immutable snapshot of code + configuration. $LATEST is always mutable.
- An alias is a pointer to a version (e.g., "prod" → v5). Aliases enable traffic shifting.
- CodeDeploy uses aliases for canary, linear, and all-at-once deployments.
- API Gateway stage variables can point to Lambda aliases for stage-specific routing.
Layers
- Layers package shared libraries, custom runtimes, or configuration files.
- A function can use up to 5 layers. Total unzipped size (function + layers) ≤ 250 MB.
- Layers are versioned and immutable. Functions reference a specific layer version ARN.
Practice Lambda Questions
Put your knowledge to the test with practice questions.