AWS Lambda (LAMBDA)
Executes microservice functions, REST API endpoints, event handlers, and data transformations with automatic horizontal scaling.
AWS Container Placement
Regional / Global Managed Scope (Outside VPC Subnets)
Summary
Serverless event-driven compute engine running code without provisioning or managing EC2 instances.
When to Use (SAA-C03)
Use for bursty APIs, event glue, and short-lived tasks (<15 min); attach to a VPC only when accessing private RDS/ElastiCache (use RDS Proxy!).
Allowed Ingress Connections & Ports
| Source Service | Protocol | Port | Architectural Rationale |
|---|---|---|---|
| APIGW | HTTPS / AWS-RPC | 443 | Synchronous API Gateway proxy or HTTP integration invoking function payload. |
| SQS | EventBridge / Poll | Event Source | SQS queue pollers invoking function batches automatically. |
| ALB | HTTP / Lambda Target | 443 | Application Load Balancer invoking Lambda as target group member. |
Allowed Egress Targets & Ports
| Target Service | Protocol | Port | Data Flow Rationale |
|---|---|---|---|
| RDS | TCP | 3306, 5432 | SQL database queries via private VPC subnets. |
| SQS | HTTPS | 443 | Asynchronous event publish and Dead-Letter Queue (DLQ) failover. |
| S3 | HTTPS / Gateway Endpoint | 443 | File upload, download, and object transformation streams. |
Key Configuration Parameters & AWS Best Practices
| Parameter | Format / Example | Purpose & Rationale |
|---|---|---|
| Memory Size (lambdaMemory) (Required) | 1024 MB | Memory allocated to function. CPU and network throughput scale proportionally with memory. Why: AWS hardware schedulers allocate CPU slices in direct proportion to allocated memory. |
| Timeout (lambdaTimeout) (Required) | 30 seconds | The maximum duration in seconds that Lambda allows a function to run before termination. Why: Prevents runaway functions from exhausting compute quotas and incurring unexpected costs. |
| VPC Subnet Placement (lambdaSubnetIds) | subnet-app-a, subnet-app-b | Subnets in which Lambda provisions Hyperplane Elastic Network Interfaces (ENIs). Why: Required to access resources in private VPC subnets, such as RDS databases or internal endpoints. |
| Security Groups (lambdaSecurityGroupIds) | sg-lambda-egress | Stateful firewall rules controlling inbound and outbound network access for the Lambda ENI. Why: Protects the VPC network and restricts database port access. |
Practice Labs Using AWS Lambda
Tight Coupling in Transaction Processing
Decouple the architecture by placing an Amazon SQS queue between the producer and consumer.…
SAA-14E-Commerce Flash Sale: EventBridge Dead-Letter Queue (DLQ) Delivery Blackhole
Configure the EventBridge rule to route failed execution events to sqs-order-dlq.…
SAA-20RDS Connection Storm Exhaustion (RDS Proxy)
Insert an Amazon RDS Proxy between the Lambda functions and the RDS database to multiplex and pool database co…
SAA-21Decouple Synchronous Order Spike with SQS + DLQ
Buffer incoming orders asynchronously using an Amazon SQS queue with a Dead-Letter Queue (DLQ) before the work…
SAA-C03-ZEROTRUST-S3-PRESIGNEDSecure Media Streaming: Zero-Trust Cognito Auth & S3 Presigned Upload
Authenticate client with Cognito User Pool, issue presigned S3 SigV4 URL via Lambda, and upload directly to en…
BUILD-02Build: 100% Serverless Microservices REST API
Build a serverless architecture containing API Gateway, AWS Lambda, and Amazon DynamoDB, connected sequentiall…
Frequently Asked Questions
Where does AWS Lambda live inside an AWS VPC architecture?
Valid container placement: Regional / Global Managed Scope (Outside VPC Subnets). Executes microservice functions, REST API endpoints, event handlers, and data transformations with automatic horizontal scaling.
When should I use AWS Lambda on the AWS SAA-C03 exam?
Use for bursty APIs, event glue, and short-lived tasks (<15 min); attach to a VPC only when accessing private RDS/ElastiCache (use RDS Proxy!).
Can I simulate AWS Lambda packet routing without an AWS account?
Yes. CloudTracer simulates AWS Lambda along with 53 AWS services directly in your browser and exports production Terraform HCL.