โก
AWS Lambda
Development with AWS ServicesEvent-driven, serverless compute that runs code without provisioning servers.
Core concepts
- โธMax execution timeout: 15 minutes.
- โธMemory: 128 MB โ 10,240 MB; CPU scales proportionally with memory.
- โธ/tmp ephemeral storage: up to 10,240 MB, persists only for the life of the execution environment.
- โธDeployment package limits: 50 MB zipped (direct upload), 250 MB unzipped, 10 GB for container images.
Concurrency
- โธReserved concurrency: caps AND guarantees a max number of concurrent executions for a function.
- โธProvisioned concurrency: pre-initializes environments to eliminate cold starts for predictable load.
- โธUnreserved account concurrency is shared across all functions without reserved concurrency.
Versions, aliases & deployment
- โธVersions are immutable snapshots of code + config; $LATEST is always mutable.
- โธAliases are mutable pointers to a version, and can split traffic by weight between two versions.
- โธCodeDeploy automates canary/linear traffic shifting between versions via an alias, with alarm-based rollback.
Integration patterns
- โธSynchronous invocations: API Gateway, ALB, direct SDK calls โ caller waits for a response.
- โธAsynchronous invocations: S3 events, SNS โ Lambda retries automatically and can send failures to a DLQ or Lambda Destination.
- โธPoll-based (event source mapping): SQS, Kinesis, DynamoDB Streams โ Lambda service polls on your behalf.
- โธLambda Destinations route async/stream success or failure results to SQS, SNS, EventBridge, or another Lambda โ richer than a DLQ.