What's changed: In-scope service coverage (axis B): added definitions, roles, and selection criteria for EKS/EFS (s1), AppSync/ELB/Route 53/WAF (s2), and Aurora (s3).
1.1AWS Lambda and Serverless
Understand the basics of AWS Lambda (event-driven, no servers, billing model), handlers and the execution environment, memory/timeout, and cold starts. The core of "Development with AWS Services" in DVA-C02.
At the heart of modern development on AWS is AWS Lambda. You run code in response to events without managing servers, paying only for what you use.
1.1.1How Lambda works
- Event-driven: invoked by events from API Gateway, S3, SQS, DynamoDB Streams, EventBridge, etc.
- Handler: the function’s entry point that receives and processes each event.
- Billing: based on requests and duration (GB-seconds); no idle cost (pay only when invoked).
- Memory/timeout: more memory also adds CPU proportionally; max timeout is 15 minutes. A cold start is first-invocation latency.
DVA-C02 is an associate credential on "developing with AWS services," centered on Lambda. Without provisioning servers, you write code in a function (handler) and wire it to an event source. Performance and cost are driven mainly by memory allocation (CPU scales with memory), and billing is invocations × duration. Two cautions: (1) cold starts—the first invocation after idle incurs init latency (mitigated by provisioned concurrency); (2) the 15-minute limit—for longer or always-on work, consider ECS/Fargate or EC2. Externalize config via environment variables, fetch secrets from Secrets Manager / SSM Parameter Store, and grant access to other services via the execution (IAM) role (no embedded keys).
| Item | Point |
|---|---|
| Invocation | Event-driven (API GW/S3/SQS) |
| Billing | Requests × duration (GB-s) |
| Tuning | More memory → more CPU |
| Limit | Max 15-min timeout |
| Perms/secrets | Execution role / Secrets Manager・SSM |
Scenario: image-upload processing. A user uploads to S3 → an S3 event invokes Lambda → it generates a thumbnail to another bucket and records metadata in DynamoDB. Lambda bills per use with no idle cost; if generation is heavy, raise memory to boost CPU. Fetch DB credentials from Secrets Manager, grant access via the execution role.
Watch the mix-ups: (1) You can’t set CPU directly—raising memory raises CPU. (2) Cold starts add latency on first/scale invocations (mitigate with provisioned concurrency). (3) Work over 15 minutes can’t run on Lambda—use ECS/Fargate/EC2. (4) Permissions via the execution role; secrets via Secrets Manager/SSM (never hard-code).
Q. How to add CPU on Lambda? Increase memory—CPU scales proportionally. Q. Mitigate cold starts? Use provisioned concurrency to pre-warm environments. Q. Work over 15 minutes? Not on Lambda—use ECS/Fargate, EC2, or split with Step Functions. Q. Handling secrets? Fetch from Secrets Manager / SSM Parameter Store; grant via the execution role.
Common on DVA: no servers, event-driven, pay-per-use = Lambda, more memory also adds CPU, first-invocation latency = cold start, 15-minute max. Long-running/always-on → ECS/EC2; permissions via execution role; secrets via Secrets Manager/SSM.
1.1.2Compute beyond Lambda and shared files
For workloads Lambda does not fit—over 15 minutes, always-on, or container-based apps—pick another compute. Amazon EKS (Elastic Kubernetes Service) is managed Kubernetes: AWS runs the control plane while you use Kubernetes declarative deployment and autoscaling for container workloads. Choose it when you want the standard Kubernetes API and ecosystem, or consistent operations across clouds (use ECS for simpler container runs, Fargate to avoid managing servers). For storage, Lambda ephemeral space and EBS are tied to a single instance, so when many Lambdas, containers, or EC2 must share the same files, use Amazon EFS (Elastic File System)—an NFS-compatible shared file system that auto-scales capacity and can be mounted to Lambda for large models or shared data.
| What you want | Service |
|---|---|
| Run containers on managed Kubernetes | Amazon EKS |
| Share files across functions/instances | Amazon EFS (shared files) |
1.1.3Section summary
- Lambda = event-driven, serverless, pay-per-use (requests × duration)
- Memory scales CPU / 15-min max / cold start on first call; permissions via execution role, secrets via Secrets Manager/SSM
Sign in to track progress — Log in.
Quick check
(just a quick review)Q1. Which AWS service runs code on events without managing servers, billed per use?
Q2. You want more CPU for a Lambda function. Which adjustment is most appropriate?
Q3. Where do you grant a Lambda function permission to access other AWS services?

