CertNote/ Commute Study Notes
Roadmap
KOEN
CLF-C02 · FoundationalCloud Practitioner - Foundational
DVA-C02 · AssociateDeveloper - Associate
SAA-C03 · AssociateSolutions Architect - Associate
  • Week 1
    • 1.The Map of AWS Infrastructure: Regions, AZs, and the Promise Called Shared Responsibility
    • 2.IAM Fundamentals: Who Gets to Do What
    • 3.IAM Deep Dive: STS, Permissions Boundaries, and the Shadow of the Confused Deputy
    • 4.AWS Organizations, SCP, Control Tower: The Skeleton of Multi-Account Governance
    • 5.Week 1 Review: Fundamentals and IAM, Hardened Through Scenarios
  • Week 2
  • Week 3
  • Week 4
  • Week 5
  • Week 6
    • 1.Lambda: What It Really Means to Run Code Without a Server
    • 2.API Gateway: The Broker Between Client and Backend
    • 3.Step Functions and AppSync: Orchestration and GraphQL
    • 4.Containers: ECS, EKS, Fargate, ECR
    • 5.Week 6 Review: Serverless + Containers Combined
  • Week 7
  • Week 8
  • Week 9
  • Week 10
  • Week 11
  • Week 12
SOA-C02 · AssociateCloudOps Engineer - Associate
SAP-C02 · ProfessionalSolutions Architect - Professional
DOP-C02 · ProfessionalDevOps Engineer - Professional
Linux Master 2 · 2급KAIT Linux Master - Level 2
SCS-C03 · SpecialtySecurity - Specialty
Linux Master 1 · 1급KAIT Linux Master - Level 1
MLA-C01 · AssociateMachine Learning Engineer - Associate
AIF-C01 · FoundationalAI Practitioner - Foundational
DEA-C01 · AssociateData Engineer - Associate
MLS-C01 · SpecialtyMachine Learning - Specialty
SQLD · 개발자SQL Developer (SQLD)

© CertNote · 주간랩스

  • About
  • Changelog
  • Contact
  • Terms
  • Privacy
← SAA-C03/Week 6/Day 5

Based on the SAA-C03 exam guide·Report an error

SAA-C03· AssociateWeek 6 · Day 5~41 min read

Day 5 - Week 6 Review: Serverless + Containers Combined

The theme of Week 6 was "managed compute." AWS keeps absorbing more of the burden of running servers yourself, and we trace the spectrum from Lambda (fully serverless) through Fargate (serverless containers) to ECS/EKS (orchestration), sorting out each service's position and trade-offs. On the SAA-C03 exam this topic is tested along two axes: "which service do you choose" and "how do you connect them."

The spectrum of operational burden: EC2 (fully managed by you) → ECS/EKS + EC2 (node management) → ECS/EKS + Fargate (orchestration only) → Lambda (functions only). Moving to the right, operational burden shrinks and the AWS abstraction layer gets thicker. From a cost optimization standpoint, the right side is not always better: the steadier and higher the traffic, the cheaper EC2 or containers can be compared with Lambda. The selection criteria are "traffic pattern" and "the team's operational capability."

Week 6 Core Services at a Glance

ServiceCore roleExam points
LambdaEvent-driven function executionCold start vs Provisioned Concurrency, Reserved vs Provisioned, VPC attachment (Hyperplane ENI)
API Gateway RESTRich API featuresAPI Key + Usage Plan, Mapping Templates, AWS service integration, mTLS
API Gateway HTTPLow-cost HTTP APIJWT Authorizer, Lambda integration, 70% cheaper than REST
API Gateway WebSocketReal-time two-wayconnectionId, $connect/$disconnect/$default, server push
Step Functions StandardLong-running orchestrationUp to 1 year, exactly-once, waitForTaskToken, billed per state transition
Step Functions ExpressHigh-throughput workflowsUp to 5 min, at-least/most-once, billed per execution count, 100K req/s
AppSyncManaged GraphQLSubscription (real-time), Pipeline Resolver, N+1 DataLoader
ECRContainer image registryImage scanning, Lifecycle Policy, 3 VPC Endpoints
ECSAWS-native orchestratorTask Role vs Execution Role, awsvpc mode, Blue/Green
EKSManaged KubernetesIRSA, Managed/Self-Managed/Fargate Profiles
FargateServerless container executionFirecracker MicroVM isolation, Spot 70% savings

Lambda Core Review

Lambda specs quick reference:

ItemValue
Maximum execution time15 minutes
Maximum memory10,240 MB (10 GB)
Maximum concurrent executions (Region)Default 1,000 (can be increased)
Burst Concurrency500-3,000/min (varies by Region)
Deployment package (ZIP)50 MB (zipped), 250 MB (unzipped)
Deployment package (Container)Up to 10 GB
Environment variables4 KB
/tmp storage512 MB to 10 GB
Provisioned ConcurrencyConfigurable (pre-warmed execution environments)

Cold start mitigation strategies: Language choice (Python/Node.js are fast, Java/C# are slow), increasing memory (CPU is allocated proportionally), Provisioned Concurrency (keeps warm environments), Lambda SnapStart (snapshot restore for Java 11+, up to 10× improvement).

Reserved vs Provisioned Concurrency:

  • Reserved: "Reserve up to N concurrent executions for this function" — other functions cannot use this capacity. For isolation. Does not fix cold starts.
  • Provisioned: "Always keep N warm execution environments" — 0ms cold start. Incurs additional cost.

⚠️ Trap — Lambda VPC and internet access: When you attach Lambda to a VPC, it cannot access the internet by default. It can reach resources inside the VPC (RDS, ElastiCache), but external APIs and AWS Public Endpoints (the default DynamoDB and S3 endpoints) are blocked. Solutions: a private subnet + NAT Gateway (internet access), or a VPC Gateway/Interface Endpoint (AWS service access). Lambda's Hyperplane ENI has solved the ENI creation delay problem since 2019, but the NAT Gateway cost still exists.

Criteria for Choosing an API Gateway Type

Comparing the 3 API Gateway types:

FeatureREST APIHTTP APIWebSocket API
Base costHigh~70% cheaper than RESTBased on connection time + messages
API Key + Usage PlanYesNoNo
Lambda AuthorizerYesYesYes
JWT Authorizer (external OIDC)NoYesNo
Mapping Templates (VTL)YesNoNo
Direct AWS service integrationYes (DDB, SNS, SQS, etc.)NoNo
Response CachingYesNoNo
mTLS client authenticationYesNoNo
Real-time WebSocketNoNoYes
Best useEnterprise APIs, partner integrationsInternal microservices, mobile backendsChat, games, real-time dashboards

Lambda Authorizer caution: The default caching TTL is 300 seconds. Setting the TTL to 0 invokes the Authorizer Lambda on every request, increasing cost and latency. Set the TTL appropriately, but when permissions must be revoked immediately (token blacklist), TTL 0 is needed. You must understand this trade-off.

Server → client push with the WebSocket API: Store the connectionId in $connect, and when the server POSTs to the Callback URL (execute-api.region.amazonaws.com/{stage}/@connections/{connectionId}), the message is pushed to the client. Server push is impossible without the connectionId.

Going deeper — REST API vs HTTP API decision tree:

Need API Keys + usage limits for external partners?
  → REST API (Usage Plan)

Integrate AWS services (DynamoDB, SQS) directly without Lambda?
  → REST API (AWS Service Integration + Mapping Templates)

JWT authentication from an external OIDC provider (Auth0, Okta)?
  → HTTP API (JWT Authorizer)

Simple Lambda/HTTP backend, cost optimization?
  → HTTP API

Real-time two-way communication?
  → WebSocket API

Criteria for Choosing Step Functions

Standard vs Express decision criteria:

  • Does execution run longer than 5 minutes? → Standard is required
  • Is exactly-once processing needed? (payments, inventory deduction) → Standard
  • High throughput of thousands to hundreds of thousands per second? → Express (100K/s, 1M concurrent executions)
  • Store logs in CloudWatch and minimize cost? → Express (billed per execution count, no charge for state transitions)

The waitForTaskToken pattern — workflows involving people:

  1. Step Functions passes the taskToken from the Task State to SQS/SNS/EventBridge
  2. A person in charge approves or rejects
  3. The processing system calls SendTaskSuccess(taskToken) or SendTaskFailure(taskToken)
  4. Step Functions receives the result and moves on to the next state

If you do not set HeartbeatSeconds, the task waits up to the maximum execution time (the 1-year quota). If you set it, the task fails with States.HeartbeatTimeout when no SendTaskHeartbeat arrives within HeartbeatSeconds, and you must handle it with a Catch block.

The power of Distributed Map: Run 10,000 parallel child workflows to process large amounts of data in S3 in parallel. ToleratedFailurePercentage allows some failures, and ResultWriter stores results in S3 to get around the 256KB state data limit.

Going deeper — the Saga pattern and compensating transactions: In a microservices environment, distributed transactions spanning multiple services cannot use 2PC (2-Phase Commit), because it creates tight coupling between services and reduces availability. The Saga pattern, proposed by Garcia-Molina in 1987, processes each step as a local transaction and, on failure, cancels the already-completed steps in reverse order with compensating transactions. In Step Functions, you implement a Saga with Retry (exponential backoff retries) and Catch + States.ALL (catching all error types). Because a compensating transaction can itself fail, idempotency is important.

Criteria for Choosing a Container Service

ECS vs EKS vs Fargate decision tree:

Need the Kubernetes standard (multi-cloud, open-source ecosystem)?
  → EKS

Need GPU / specialized instances?
  → ECS/EKS + EC2 Launch Type

Minimize node management burden, simple service deployment?
  → ECS + Fargate

Need strong kernel-level security isolation (regulated industry)?
  → Fargate (Firecracker MicroVM)

Complex deployment patterns (CRD, Operator, Helm)?
  → EKS

Run only some workloads serverless in EKS?
  → EKS + Fargate Profiles (but no DaemonSets)

Two patterns for IAM permissions:

  • ECS: Task Role (application code permissions) + Task Execution Role (agent permissions)
  • EKS: IRSA (IAM Roles for Service Accounts) — per-Pod IAM Role based on OIDC tokens

Both patterns share the same principle: "grant IAM permissions per workload, not at the instance/node level."

⚠️ Collected traps — commonly confused concepts:

  1. Task Role vs Task Execution Role: The Execution Role is for the ECS agent to pull from ECR + send CW logs. The Task Role is for the container code to call S3/DDB. Swapping them causes permission errors.

  2. Fargate networking mode: Fargate supports only awsvpc mode. bridge and host are not possible.

  3. 3 ECR VPC Endpoints: ecr.api + ecr.dkr + S3 Gateway Endpoint. If any one is missing, image pulls from a private subnet fail.

  4. IRSA vs Instance Profile: In EKS, if you set only the node Instance Profile, every Pod on the same node gets the same permissions — you need IRSA for per-Pod control.

  5. Standard vs Express: Payment processing (exactly-once, over 5 minutes) = Standard. Order status lookup (high throughput, under 5 minutes) = Express.

Integrated Architecture — Mixing Serverless + Containers

[ User request flow ]

Mobile/Web Client
      │
      ├─ REST/JSON ──→ API Gateway (REST) ──→ Lambda ──→ DynamoDB / S3
      │                                             └──→ SQS → Lambda (async processing)
      │
      ├─ GraphQL ───→ AppSync ──→ DynamoDB / Lambda / OpenSearch
      │              (Real-time Push via Subscription ↓ Client)
      │
      └─ WebSocket → API Gateway (WS) ──→ Lambda ($connect, $default)
                                              └──→ DynamoDB (store connectionId)
                                              └──→ Push to other clients

[ Backend container service ]

ALB → ECS Fargate (awsvpc mode)
        │ Task Role (S3, DynamoDB permissions)
        └──→ RDS Proxy → Aurora Multi-AZ

[ Orchestration ]

EventBridge (schedule / events)
      └──→ Step Functions (Standard)
              ├─ Lambda (each step)
              ├─ ECS Fargate Task (batch processing)
              ├─ waitForTaskToken (human approval)
              └─ Distributed Map (large-scale parallel S3 processing)

Case study — e-commerce order processing system: A typical exam scenario. Order creation (API GW → Lambda → DDB) → payment processing (Step Functions Standard, Saga pattern, exactly-once) → inventory deduction (Lambda → DDB) → shipping request (SQS → ECS Fargate) → real-time shipment tracking updates (AppSync Subscription → Mobile App). Each step has a reason a different service is optimal: payment must be exactly-once, so Standard Step Functions; shipping handling is batch-like, so Fargate; real-time status notifications use AppSync Subscription.

Case study — media processing pipeline: Upload a video to S3 → EventBridge → Step Functions Distributed Map (10,000 chunks processed in parallel, each chunk transcoded by Lambda) → store the results with ResultWriter in S3 → distribute through CloudFront CDN. In this architecture, the Distributed Map in Standard Step Functions can do large-scale parallel processing without AWS Batch or EMR, and when processing fails, it can tolerate some failures with ToleratedFailurePercentage and then reprocess.

A DR Perspective — Availability Design of the Week 6 Services

ServiceBuilt-in HAAdditional DR considerations
LambdaAutomatic (multi-AZ execution)Monitor concurrency limits, configure a DLQ
API GatewayAutomatic (HA within the Region)Multi-Region: Route 53 + API GW in each Region
Step FunctionsAutomatic (service-level HA)Standard: execution history kept 1 year, Express: CloudWatch log retention
AppSyncAutomatic (HA within the Region)Multi-Region: integrate with Global DynamoDB Tables
ECS FargateMulti-AZ subnet configurationALB + spread tasks across at least 2 AZs, mix Fargate Spot + On-Demand
EKSAWS-managed HA control planeMulti-AZ node groups, automatic etcd backups
ECRAutomatic (S3-based durability)Keep images in the DR Region too with cross-Region replication

Going deeper — Lambda Destinations vs DLQ: Both are Lambda failure-handling mechanisms, but their purposes differ. A DLQ (Dead Letter Queue) sends the failed event to SQS or SNS when an asynchronous invocation fails. Lambda Destinations are more powerful: they can handle both success and failure (a DLQ handles only failure), support 4 target types (SQS, SNS, Lambda, EventBridge), and include the function response and context information in addition to the original event. In general, Lambda Destinations are recommended over a DLQ. Failure handling for Event Source Mapping (SQS, Kinesis, DDB Streams) must be configured separately, and ReportBatchItemFailures supports partial batch success.

📝 Practice Questions

Click a choice to reveal the answer and explanation.

Question 1

A Lambda function normally handles only a small number of requests, but every day at 9 AM hundreds of users connect at the same time and cold starts cause it to violate the response latency SLA. What is the best solution?

Question 2

You are providing an API to external SaaS partners. You must limit each partner to 10,000 requests per month, block requests when the limit is exceeded, and provide a per-partner usage dashboard. What is the best API Gateway type and feature?

Question 3

In an order processing system, three steps (payment charge, inventory deduction, shipping request) must run in order. The payment charge must run exactly once, and if any step fails, the previous steps must be canceled (refund, inventory restoration). What is the best architecture?

Question 4

You are building a real-time collaborative document editing service. When multiple users edit the same document, one user's changes must be delivered to the other users immediately. What is the best AWS architecture?

Question 5

You deploy an ECS Fargate service in a private subnet, and the containers must pull images from ECR without internet access. What components are required?

Question 6

In an EKS cluster, the payment service Pod must access only Secrets Manager, and the log collection Pod must access only CloudWatch. When the two Pods run on the same node, how do you grant IAM permissions per Pod?

Question 7

One million new files are uploaded to an S3 bucket every night. Each file must be processed independently and the results stored in DynamoDB, and if the processing failure rate exceeds 5%, the entire job must stop and send a notification. What is the best architecture?

Question 8

In an insurance claims processing system, when a customer submits a claim, a reviewer must approve or reject it within 5 business days. If the reviewer does not respond, an escalation email must be sent. What is the best way to implement this workflow?

Question 9

A startup is launching its initial service, and a backend team of 3 with no Kubernetes experience wants to deploy a container-based API server. Fast launch and minimal operational burden are the priorities. What is the best combination of services?

Question 10

A fintech company provides a multi-tenant API. Each tenant has its own DynamoDB table and S3 bucket, and the Lambda function must access only the correct resources for each tenant. In addition, Lambda cold starts must be prevented to minimize API response latency. What is the best design?

Question 11

A Lambda function is invoked asynchronously to process images. You must capture the events for images that failed processing and reprocess them, and for successfully processed images start a downstream pipeline on a separate EventBridge bus. What is the best configuration?

Question 12

A company is optimizing its AWS serverless services and is reviewing the following workloads: (1) 50,000 order status lookups per second (each lookup completes within 3 seconds), (2) 100 large report generations per month (each report takes 20 minutes). If you use Step Functions, which type should you use for each?

PreviousContainers: ECS, EKS, Fargate, ECRWeek 6 · Day 4Next SQS: How a Message Queue Answers the Questions Distributed Systems AskWeek 7 · Day 1

Official references

  • SAA-C03 official exam page(opens in a new tab)
  • AWS Lambda documentation(opens in a new tab)
  • Amazon ECS · Fargate documentation(opens in a new tab)
  • AWS Step Functions documentation(opens in a new tab)
  • Amazon S3 documentation(opens in a new tab)
  • Amazon SQS documentation(opens in a new tab)

On this page

  • Week 6 Core Services at a Glance
  • Lambda Core Review
  • Criteria for Choosing an API Gateway Type
  • Criteria for Choosing Step Functions
  • Criteria for Choosing a Container Service
  • Integrated Architecture — Mixing Serverless + Containers
  • A DR Perspective — Availability Design of the Week 6 Services
  • Practice Questions