Configuring AWS Lambda for production
Deploying Applications on AWS
Dunieski Otano
Amazon Web Services Solutions Architect
It worked in test
The function passed every test
In production it times out and throttles
The code was fine; the configuration wasn't
Lambda configuration that matters in production
Memory
: also scales CPU and network
Timeout
: max seconds before the function is killed
Ephemeral storage
: temporary space in /tmp
Concurrency
: how many run at once
Memory sizing and the CPU link
More memory =
proportionally more CPU
A CPU-bound function can run faster at higher memory
Faster duration can mean
lower cost
Right-size by testing, not by guessing
Concurrency: reserved vs provisioned
Reserved concurrency
Caps the maximum simultaneous executions
Protects downstream systems and other functions
Provisioned concurrency
Pre-warms instances, so there is no cold start
For latency-sensitive, user-facing functions
Packaging configuration and shared code
Environment variables
: per-environment configuration
Layers
: share code and dependencies across functions
Extensions
: run alongside the function for tools
Keep config out of the deployment package
Connecting Lambda to a VPC
Attach Lambda to
private subnets
for internal resources
Lambda creates
ENIs
in your VPC
Security groups
control what it can reach
Needs a NAT or VPC endpoint for outside access
Handling failures with destinations and DLQs
Async invokes
retry automatically
on failure
Lambda Destinations
: route onSuccess and onFailure
Dead-letter queue
: capture events that never succeed
Never silently drop a failed event
Let's practice!
Deploying Applications on AWS
Preparing Video For Download...