Pricing Model
Lambda charges based on:
- Requests: $0.20 per 1M requests
- Duration: $0.0000166667 per GB-second
Cost Calculation
Cost = (Requests × $0.20/1M) + (Memory GB × Duration seconds × Requests × $0.0000166667)
Example
1M invocations, 512MB memory, 200ms average:
- Request cost: $0.20
- Duration cost: (0.5GB × 0.2s × 1M × $0.0000166667) = $1.67
- Total: $1.87/month
Pricing here is illustrative—actual Lambda prices vary by region and over time, so always confirm with the current AWS pricing page.
Quick Wins
- Compute Savings Plans - Commit to baseline usage for automatic compute discounts (no code changes).
- Switch to Graviton - Switch runtimes/architectures to arm64 for better price-performance (may require rebuilding native deps).
- Right-size memory - Use the Lambda Power Tuning tool to pick the cheapest memory setting that still meets latency goals.
- Cost-Effective Log Storage - Define log retention and archive plans in IaC so CloudWatch Logs don’t grow unbounded and older data moves to cheaper storage.
- Event Filtering - Configure event filtering on queues/streams so Lambda only runs for relevant records instead of every message.