AWS DVA-C02 Cheat Sheet: Lambda, APIs, Eventing, and Debugging

AWS DVA-C02 cheat sheet for Lambda, API Gateway, DynamoDB, SDKs, event-driven design, security, deployment, troubleshooting, optimization, and final review traps.

On this page

Keep this cheat sheet open while drilling questions. Prioritize defaults, failure modes, and the “least-privilege + event-driven” mental model.

KMS: Key Management Service for encryption keys and key-usage control.

DLQ: Dead-letter queue for capturing failed events or messages that should not keep retrying forever.

STS: Security Token Service for issuing temporary AWS credentials.


Quick facts (DVA-C02)

I verified these current AWS exam facts on May 24, 2026.

Item Value
Questions 65 total
Scoring 50 scored + 15 unscored (unscored items are not identified)
Question types Multiple choice and multiple response
Time 130 minutes
Passing score 720 (scaled 100–1000)
Cost 150 USD

Domain weights and review priority

Domain Weight What to compress for final review
Development with AWS Services 32% Lambda, API Gateway, DynamoDB, S3, event sources, SDK behavior, idempotency
Security 26% IAM, resource policies, KMS key policy, Cognito, STS, Secrets Manager, least privilege
Deployment 24% SAM, CloudFormation, CodePipeline, CodeBuild, CodeDeploy, versions, aliases, rollback
Troubleshooting and Optimization 18% CloudWatch, X-Ray, CloudTrail, throttling, retries, latency, concurrency, cost/performance

The highest-weight domain is development, but the exam usually embeds security and troubleshooting inside developer scenarios. A Lambda, API Gateway, DynamoDB, or eventing answer is incomplete if it ignores permissions, retries, duplicates, and observability.

Developer proof stack

DVA-C02 questions usually test whether an application developer can make an AWS integration behave correctly under real production pressure. Before choosing a service, walk the answer through this stack:

  1. Invocation: decide whether the request is synchronous, asynchronous, poll-based, streaming, workflow-driven, or direct SDK/API access.
  2. State change: identify whether the code reads, writes, updates, emits an event, transforms data, or calls a dependency that may fail.
  3. Failure semantics: account for timeout, retry, duplicate delivery, poison messages, partial batch failure, throttling, or downstream unavailability.
  4. Authorization: check caller identity, execution role, resource policy, KMS key policy, tenant boundary, and secret access before widening permissions.
  5. Deployment safety: prefer versioned artifacts, aliases, traffic shifting, tests, alarms, and rollback over direct changes to live code.
  6. Observability: prove the fix with structured logs, metrics, traces, health checks, CloudTrail evidence, and meaningful alarms.

If an answer names the right AWS service but ignores retries, idempotency, auth boundaries, or observability, it is usually incomplete for Developer - Associate.

Official task compression

Development with AWS Services covers application code, Lambda behavior, SDK/API calls, messaging, streams, data stores, testing, Amazon Q Developer, EventBridge, and resilient third-party integrations. Pick the integration pattern first, then add retries, idempotency, tests, and SDK-safe error handling.

Security covers authentication, authorization, bearer tokens, IAM roles, KMS, secrets, data masking, multi-tenant access, and application-level authorization. Secure the caller, the service role, the resource policy, the key, and the sensitive data path.

Deployment covers CI/CD usage, artifacts, infrastructure as code templates, integration tests, automated tests, safe release strategies, and rollback. Developer-level deployment means packaging and using pipelines safely, not designing the whole pipeline from scratch.

Troubleshooting and Optimization covers root cause analysis, logs, metrics, traces, structured logging, custom metrics, readiness probes, caching, concurrency, profiling, and performance bottlenecks. Diagnose from evidence: logs for behavior, metrics for magnitude, traces for path, and CloudTrail for API caller.

Current developer-scope cues

Cue Exam-safe interpretation
Amazon Q Developer Development assistance is in scope, but the exam still tests your AWS service and code reasoning.
SDK/API behavior Handle retries, throttling, pagination, exceptions, idempotency, and credentials correctly.
Unit and integration tests Use local/SAM tests and mocked external dependencies where appropriate.
Structured logs and custom metrics Emit searchable logs and meaningful CloudWatch metrics instead of only plain text logs.
Application-level auth Cognito/IAM proves identity; application code may still need tenant/record-level authorization.
EventBridge event routing Use event patterns and target configuration instead of defaulting to custom router code.
Readiness and health checks A deployment answer is stronger when health evidence can stop or roll back a bad release.
Third-party integrations Add timeout, retry with jitter, circuit breaker/fallback, and idempotent side effects.

Developer boundary cues

AWS frames DVA-C02 as a developer implementation exam, not a broad architecture or administration exam. Use that boundary to reject overbuilt answers:

  • If the question asks for application behavior, prefer code, SDK, integration, retry, idempotency, or observability fixes before redesigning the entire architecture.
  • If the question asks for CI/CD use, focus on packaging, artifacts, testing, deployment strategies, and rollback; do not assume the answer is to design a brand-new pipeline.
  • If the question asks about authorization, include application-level tenant and record checks where the user identity alone is not enough.
  • If the question asks about networking, solve the application access path, VPC endpoint, Lambda VPC, or service integration issue; do not drift into designing Direct Connect or full VPC architecture unless the stem explicitly requires it.

How DVA-C02 questions work (fast strategy)

  • Treat most integrations as at-least-once delivery → design idempotency and safe retries.
  • If the question says least operational overhead, prefer managed services and native integrations.
  • If you see AccessDenied, separate concerns: identity policy vs resource policy vs KMS key policy.
  • Read the last sentence first to capture the constraint (cost, performance, availability, security, operational effort).

Question-type traps

Question type Exam-day habit
Multiple choice Identify the integration pattern first: synchronous API, async event, queue, stream, workflow, or deployment.
Multiple response Include every required layer: service fit, IAM/KMS/resource policy, retry/failure behavior, and monitoring.

Unanswered questions are incorrect and there is no penalty for guessing. Do not spend too long on one eventing scenario; mark it, answer easier SDK/IAM/default questions, then return.

Invocation chooser

Use this when the answer choices compare request/response, event, or queue-driven patterns.

    flowchart TD
	  S["Scenario"] --> A["Need immediate response?"]
	  A -->|yes| B["Sync API path: API Gateway + Lambda + direct response"]
	  A -->|no| C["Async / event path"]
	  C --> D["SQS, SNS, EventBridge, or stream source?"]
	  D --> E["Choose queue, fanout, routing, or stream polling"]
	  E --> F["Make retries and duplicates safe"]

Scenario eliminations

Stem clue Eliminate first Keep in play
producer and consumer must be decoupled with retries direct synchronous Lambda chain SQS, DLQ, idempotent worker
one event must notify many independent consumers one shared queue only SNS fanout to SQS subscriptions
event routing depends on source/detail pattern custom routing code by default EventBridge rules and targets
request may retry a write operation handler with no duplicate protection idempotency key and conditional write
API path has strict latency and heavy work do everything synchronously return fast and move heavy work to queue/event flow
AccessDenied with encrypted data identity policy only identity policy, resource policy, and KMS key policy
new DynamoDB access pattern after launch table scan GSI and key-aware Query pattern
safer Lambda rollout with rollback overwrite $LATEST directly versions, aliases, CodeDeploy canary/linear rollout, alarms

DVA-C02 distractors often choose the right service but miss failure semantics. Keep the answer only if it handles duplicates, throttling, permissions, and observability for the named integration.

Developer evidence map

Stem evidence Strong answer includes Reject answers that
“third-party API is unreliable” timeout, retry with backoff+jitter, circuit breaker/fallback, idempotent call design retry forever or block the entire synchronous request path
“same request may be retried” idempotency key, conditional write, safe retry response assume a network timeout means the write failed
“multi-tenant application” authenticated identity, tenant claim/context, application-level authorization, partition/key design rely only on broad service-level IAM
“SDK call returns many results” pagination handling and throttling backoff read one page and assume the result set is complete
“encrypted cross-account data fails” IAM allow, resource policy, KMS key policy/grants, correct principal fix only the identity policy
“deployment should fail safely” version/alias, canary or linear shift, alarms, rollback deploy directly to $LATEST without health checks
“debug production latency” CloudWatch metrics/logs plus X-Ray traces and correlation IDs inspect only code without runtime evidence
“optimize hot reads” cache, key-aware query, DAX/ElastiCache/CloudFront where fit add Scan or increase retries first

Runtime diagnosis chain

Use this before choosing a fix for API, Lambda, DynamoDB, queue, or deployment symptoms.

    flowchart LR
	  S["Symptom"] --> L["Logs: handler behavior"]
	  L --> M["Metrics: rate, latency, errors, throttles"]
	  M --> T["Traces: downstream path"]
	  T --> A["Audit: caller, config, deployment"]
	  A --> F["Fix: permission, retry, capacity, code, cache, or rollback"]

The developer exam rewards evidence-based debugging. A strong answer usually names the signal source first, then applies the smallest safe fix without widening IAM, masking duplicates, or bypassing the deployment path.

Symptom-to-signal map

Symptom in the stem Check first Strong first fix
API returns 502 or 504 API Gateway execution logs, Lambda logs, timeout settings, integration response fix handler error/timeout or adjust integration behavior, not DNS
API returns 429 API Gateway throttles, Lambda concurrency, downstream capacity, client retry rate tune throttles/concurrency/backoff and protect downstream dependencies
Lambda duration suddenly increased CloudWatch duration, memory/CPU setting, X-Ray downstream segment, recent deployment right-size memory, reduce slow downstream calls, or roll back a bad release
messages pile up in SQS ApproximateAgeOfOldestMessage, Lambda errors, visibility timeout, DLQ redrive count fix poison message handling, scale workers, align visibility timeout
duplicate records appear retry path, idempotency table, conditional writes, message deduplication add idempotency keys and conditional writes before blaming SQS
DynamoDB reads are slow or costly Query vs Scan, key condition, GSI fit, hot partition metrics redesign access pattern, add GSI, cache hot reads, avoid Scan
access fails only for encrypted resource IAM policy, resource policy, KMS key policy/grants, caller principal fix the missing policy layer narrowly
deployment broke only one stage stage variables, alias/version, deployment events, config differences compare environment config and roll back through the pipeline

Retry and idempotency chooser

Situation Retry approach Idempotency control
client retries a synchronous write bounded retry with backoff; return previous result when possible request ID plus conditional DynamoDB write
Lambda async invocation fails use async retry settings plus destination or DLQ event ID or business key stored before side effects
SQS worker fails one record in a batch partial batch response and DLQ/redrive policy per-message idempotency key
stream record blocks shard progress bisect/partial failure handling where supported processed-record marker and safe replay
third-party API is flaky timeout, backoff with jitter, circuit breaker, fallback external request key and compensation path
deployment health alarms fire stop traffic shift and roll back immutable version, alias, and deployment event history

Authorization boundary map

Access path Required checks Common distractor
Lambda reads S3 object execution role, bucket policy if cross-account, KMS key if encrypted adding s3:* without key permission
API client invokes route authorizer/IAM policy, API resource policy if used, route/stage deployment API key as primary authentication
app user accesses tenant record Cognito/JWT identity plus app-level tenant check and key design broad IAM role that trusts every authenticated user
Lambda writes DynamoDB execution role action/resource, condition keys if needed, table/index target scanning then filtering unauthorized rows
service assumes cross-account role trust policy, caller permission, target role policy, SCP boundary editing only the caller identity policy
code decrypts a secret Secrets Manager or Parameter Store permission plus KMS decrypt permission storing secret in plaintext environment variable

DVA-C02 answer sequence

Use this when the stem is about API, event, storage, or auth choices.

    flowchart TD
	  S["Scenario"] --> T["Is it sync or async?"]
	  T --> I["Is it direct invoke, fanout, event routing, or storage access?"]
	  I --> A["Pick API Gateway, Lambda, SQS, SNS, EventBridge, or S3 pattern"]
	  A --> R["Add auth, retries, idempotency, and least privilege"]
	  R --> V["Verify latency, permissions, and failure behavior"]

Final 20-minute recall (exam day)

Cue -> best answer (pattern map)

If the question says… Usually best answer
Decouple producer/consumer with retries SQS
Fanout one event to many consumers SNS -> SQS subscriptions
Event routing by pattern/source EventBridge
Keep Lambda safe under retries/duplicates Idempotency key + conditional write
Reduce Lambda cold starts for strict latency Provisioned Concurrency
Mobile/web user auth Cognito User Pools
Temporary AWS credentials for app users Cognito Identity Pools / STS
Rotate secrets automatically Secrets Manager
Global edge caching for API/static CloudFront
Private AWS service access from VPC VPC endpoints (gateway/interface as applicable)

Integration pattern chooser

Requirement Best first fit Failure control to remember
Immediate request/response API API Gateway + Lambda or service integration Timeouts, validation, auth, throttling
Durable background work SQS + Lambda worker Visibility timeout, DLQ, idempotency
Notify many independent systems SNS fanout, often to SQS Filter policies, per-consumer retry isolation
Route events by source/detail EventBridge Rule pattern, target retry/DLQ, schema awareness
Ordered stream processing Kinesis or DynamoDB Streams Shard ordering, batch failure handling
Multi-step workflow with retries/waits Step Functions Retry/Catch, state output, execution history
Direct object upload/download S3 presigned URL Expiration, permissions, content constraints

Must-memorize DVA defaults

Topic Fast recall
Lambda sync invoke No automatic retry by Lambda
Lambda async invoke Automatic retries + DLQ/destination options
Lambda with SQS/streams Poll-based retries; duplicates possible
SQS visibility timeout Keep greater than Lambda processing timeout
DynamoDB write safety Use conditional expressions for concurrency/idempotency
IAM policy evaluation Explicit deny always wins

Last-minute traps

  • Assuming event delivery is exactly-once.
  • Forgetting KMS key policy in cross-account encryption scenarios.
  • Using Scan when Query + proper keys/indexes are expected.
  • Keeping heavy work on synchronous API path instead of async queue/event flow.

1) Request + event flow (mental model)

    flowchart LR
	  C[Client] -->|HTTPS| APIGW[API Gateway]
	  APIGW -->|IAM/Cognito/Lambda authorizer| L[Lambda]
	  L --> DDB[(DynamoDB)]
	  L --> S3[(S3)]
	  L --> EB[EventBridge]
	  EB --> SQS[(SQS)]
	  SQS --> L2[Lambda worker]
	  L2 --> CW[(CloudWatch Logs/Metrics)]
	  L2 --> XR[(X-Ray Traces)]

High-yield takeaway: professional “developer” answers usually combine authn/authz, decoupling, and observability (logs/metrics/traces).


2) Lambda — invocation types, retries, and concurrency

Invocation types (memorize the retry model)

Invocation model Common triggers Retry behavior (what the exam expects) Failure handling knobs
Synchronous (request/response) API Gateway → Lambda No automatic retries by Lambda Caller retry, app-level retry, redesign to async
Asynchronous (event) EventBridge, SNS, S3 → Lambda Automatic retries (default is multiple attempts) Async destinations / DLQ, max event age
Poll-based event source mapping SQS, DynamoDB Streams, Kinesis → Lambda Retries until success; stream failures can block progress DLQ/on-failure destination, partial batch, bisect batch

Defaults that matter (common “gotchas”)

  • Idempotency: retries and duplicates happen (SQS, async Lambda, EventBridge). Make handlers safe to run multiple times.
  • Timeout alignment: downstream timeouts must be lower than upstream timeouts (API Gateway → Lambda → DB).
  • Memory != only memory: in Lambda, more memory also means more CPU → often faster and cheaper overall.
  • VPC networking: Lambda in a VPC can’t reach the public internet without a NAT; for AWS services, prefer VPC endpoints over NAT.
  • Reserved concurrency: cap blast radius (protect downstream services and cost).
  • Provisioned concurrency: reduce cold starts for latency-sensitive endpoints.

Partial batch failure (SQS and streams)

Without partial batch response, one failure can cause the whole batch to be retried. Prefer partial batch response when supported.

Lambda batch response format (concept)

1{
2  "batchItemFailures": [
3    { "itemIdentifier": "message-or-record-id" }
4  ]
5}

Idempotency pattern (practical)

Common approach: store a request key (for example, requestId) in DynamoDB with TTL.

11) Put idempotency key with condition attribute_not_exists(PK)
22) If conditional check fails -> return cached result / treat as already processed
33) Process work -> write result

3) API Gateway — picks, auth, throttling

REST API vs HTTP API vs WebSocket API

Need Best-fit Why it wins (DVA framing)
Usage plans, API keys, advanced REST features REST API “Full-featured API Gateway”
Lower cost + simpler HTTP routing HTTP API “Cheaper and faster” (fewer features)
Real-time bidirectional messaging WebSocket API Connection-oriented messaging

Auth options (very common on DVA)

Need Best-fit Notes
AWS-to-AWS or signed clients IAM auth (SigV4) Great for service-to-service, not human logins
User authentication with tokens Cognito authorizer Validate JWTs from a Cognito user pool
Custom logic / external JWTs Lambda authorizer You own token validation and caching behavior

API keys: not “security” by themselves; they’re primarily for usage plans and throttling/quota.


Throttling “chain”

If you see throttling, check the whole chain:

  1. API Gateway throttles (per-stage, per-route, usage plan)
  2. Lambda concurrency throttles
  3. Downstream throttles (DynamoDB RCUs/WCUs, SNS/SQS, etc.)

API Gateway decision traps

Stem clue Better answer Why
JWT-based user auth Cognito authorizer or JWT authorizer where fit API keys are not user authentication.
AWS service-to-service caller IAM/SigV4 Avoid custom token logic when AWS identity is the caller.
Custom token validation Lambda authorizer Put custom auth logic outside the business handler.
Request shape must be rejected early Request validation/mapping Do not let invalid payloads reach downstream code.
Heavy work behind API Return quickly and enqueue work API timeouts and client retries create duplicate-risk pressure.
Usage quotas for API consumers Usage plan/API key This manages usage; it is not primary security.

IAM policy: allow invoking one API route (copy-ready)

 1{
 2  "Version": "2012-10-17",
 3  "Statement": [
 4    {
 5      "Effect": "Allow",
 6      "Action": "execute-api:Invoke",
 7      "Resource": "arn:aws:execute-api:REGION:ACCOUNT:apiId/stage/GET/items"
 8    }
 9  ]
10}

4) DynamoDB — keys, indexes, streams, throttling

The “wins questions” checklist

  • Prefer Query over Scan (Scan is a frequent distractor).
  • Design keys to avoid hot partitions (high-cardinality partition keys help).
  • Use conditional writes for correctness (idempotency, optimistic locking).
  • Treat throttling as normal: implement exponential backoff + jitter.

Access pattern chooser (fast table)

Need Operation
Fetch one item by full key GetItem
Fetch a set by partition key (+ sort key conditions) Query
Bulk read without keys (rarely best in prod) Scan

DynamoDB troubleshooting chooser

Symptom Likely issue Better answer
High latency from table reads Scan or poor key access Query by partition key, add GSI for access pattern, or cache hot reads
Throttling on one key Hot partition Redesign partition key/write distribution; add backoff+jitter
Duplicate writes after retry No idempotency guard Conditional write with idempotency key
Lost update / race condition Blind overwrite Conditional expression or optimistic locking
New query needed after launch Missing access pattern Add a GSI instead of scanning the base table
Stream processor stuck retrying Poison record in batch Partial batch failure handling, DLQ/on-failure destination, bisect strategy where fit

Indexes: GSI vs LSI (high-yield differences)

Feature GSI LSI
When created Any time At table creation
Partition key Can be different Same as table
Consistent reads Eventually consistent only Can support consistent reads
Capacity Separate (provisioned) / managed (on-demand) Shares table capacity model

Rule: if you need a new access pattern later, it’s usually a GSI.


Conditional write (concept)

1PutItem with ConditionExpression: attribute_not_exists(PK)

This shows up in questions about idempotency and race prevention.


Streams (common trigger)

Use DynamoDB Streams when you need to react to table changes:

  • Trigger Lambda on item inserts/updates/deletes
  • Build event-driven projections or caches

Gotcha: stream processing is ordered per shard; failures can block progress until handled (configure retries/handling).


5) S3 + CloudFront — presigned URLs, encryption, edge caching

Storage picker (CLF-level simple, DVA-level useful)

Need Best-fit
Object storage S3
Block storage for EC2 EBS
Shared POSIX file system EFS

Presigned URLs (classic DVA pattern)

Best for direct-to-S3 upload/download without proxying files through your app.

    sequenceDiagram
	  participant C as Client
	  participant API as API (Lambda)
	  participant S3 as S3
	  C->>API: Request upload URL
	  API-->>C: Pre-signed URL
	  C->>S3: PUT object (direct)

CLI example:

1aws s3 presign s3://my-bucket/path/file.bin --expires-in 3600

S3 encryption choices (high-yield)

Option What it means When it’s best
SSE-S3 S3-managed keys Simple default encryption
SSE-KMS KMS-managed keys Auditability/control requirements
Client-side App encrypts before upload Strict compliance and key custody needs

Common “AccessDenied” cause: KMS key policy doesn’t allow the caller/service to use the key.


CloudFront basics (what you need for DVA)

  • Use CloudFront when you need caching, global performance, and TLS at the edge.
  • If you need private S3 content, use Origin Access Control (OAC) (or older OAI patterns) instead of a public bucket.
  • Invalidation fixes stale content, but design caching headers/TTLs first.

6) Eventing & orchestration — SQS, SNS, EventBridge, Kinesis, Step Functions

Which one should you pick?

Need Best-fit
Decouple workloads with a durable buffer SQS
Fan-out notifications to many subscribers SNS
Route events by pattern across services/accounts EventBridge
Ordered, high-throughput streaming ingestion Kinesis
Workflow with steps, retries, wait states Step Functions

SNS → SQS fanout (high-yield pattern)

    flowchart LR
	  Pub[Publisher] --> T[SNS Topic]
	  T --> Q1[SQS Queue A]
	  T --> Q2[SQS Queue B]
	  Q1 --> L1[Lambda Worker A]
	  Q2 --> L2[Lambda Worker B]
	  Q1 --> DLQ1[DLQ]
	  Q2 --> DLQ2[DLQ]

Why it wins: SNS handles fanout; SQS gives durability and independent retry per consumer.


SQS: the defaults and gotchas you actually get tested on

  • Visibility timeout must exceed max processing time (or extend it).
  • DLQ catches poison messages (after max receives).
  • Long polling reduces empty receives and cost.
  • FIFO vs Standard matters for ordering and duplicates.
Queue type When to choose Key behavior
Standard Highest throughput, best-effort ordering At-least-once; duplicates possible
FIFO Ordered processing per group Ordering + deduplication support

SNS: what shows up on DVA

  • Use filter policies (message attributes) to route messages to specific subscribers.
  • SNS is great for “notify many”; pair with SQS when you need durable consumption and retries.

Event failure and retry chooser

Pattern Failure behavior to design for Exam-safe control
SNS to Lambda Async delivery and retries DLQ/destination, idempotent handler
SNS to SQS Durable per-subscriber queue Redrive policy and filter policy
SQS to Lambda Polling retries until success Visibility timeout, partial batch response, DLQ
EventBridge target Retry policy and optional DLQ Rule pattern, target permissions, DLQ
DynamoDB Streams to Lambda Ordered shard processing can stall Partial batch response/bisect handling and idempotent processing
Kinesis to Lambda Ordered shard batches and replay Checkpoint/batch handling, retries, concurrency tuning

EventBridge: what it’s for

  • Event bus + rules: route events based on patterns.
  • Useful when you want a consistent event model across AWS services and SaaS integrations.
  • Supports DLQ/retry configurations for targets (conceptually: “reliable delivery”).

Kinesis: when it’s the best answer

Pick Kinesis when you need:

  • High-throughput streaming ingest
  • Ordered processing within shards
  • Multiple consumers reading the same stream

If you just need a durable buffer for background jobs, SQS is often simpler.


Step Functions (workflow)

Type Best for Key point
Standard Longer workflows and exact orchestration Durable and auditable
Express High-volume short workflows Optimized for throughput

Retry + Catch snippet (Amazon States Language)

 1{
 2  "StartAt": "Work",
 3  "States": {
 4    "Work": {
 5      "Type": "Task",
 6      "Resource": "arn:aws:states:::lambda:invoke",
 7      "Retry": [
 8        {
 9          "ErrorEquals": ["States.ALL"],
10          "IntervalSeconds": 2,
11          "MaxAttempts": 3,
12          "BackoffRate": 2.0
13        }
14      ],
15      "Catch": [
16        {
17          "ErrorEquals": ["States.ALL"],
18          "Next": "Failed"
19        }
20      ],
21      "End": true
22    },
23    "Failed": { "Type": "Fail" }
24  }
25}

7) Security “best answers” — IAM, Cognito, KMS, secrets

IAM evaluation (always true)

  • Default deny.
  • Explicit deny overrides any allow.
  • Permissions can come from identity policies + resource policies; KMS also depends on key policy.

Prefer roles + temporary credentials (STS)

  • Apps on AWS should use roles (Lambda execution role, EC2 instance profile, task role).
  • Avoid long-lived access keys in code.

Cross-account AssumeRole (trust policy example)

 1{
 2  "Version": "2012-10-17",
 3  "Statement": [
 4    {
 5      "Effect": "Allow",
 6      "Principal": { "AWS": "arn:aws:iam::111122223333:role/CallerRole" },
 7      "Action": "sts:AssumeRole"
 8    }
 9  ]
10}

Cognito: User Pool vs Identity Pool

Need Use Why
Authenticate users and get JWTs User Pool User directory + tokens
Get temporary AWS creds for a user Identity Pool Federated identities → STS credentials

Common pattern: API Gateway uses a Cognito User Pool authorizer to validate JWTs.

Security implementation chooser

Requirement Use Watch for
App calls AWS service Execution role/task role/instance profile Avoid static access keys in code.
Human or external identity signs in Cognito User Pool or federated IdP Authenticated does not automatically mean authorized for every record.
User needs AWS credentials Cognito Identity Pool or STS assume role Scope role permissions tightly.
Cross-account service access AssumeRole plus trust and permissions policy Resource policies and SCP/KMS can still block access.
Encrypt/decrypt with KMS IAM plus KMS key policy/grants Key policy is often the missing layer.
Secret rotation Secrets Manager Parameter Store is fine for config, but rotation cue points to Secrets Manager.
Sensitive logs or payloads Mask/redact before logging CloudWatch Logs can become a data-exposure path.

Secrets Manager vs Parameter Store

Need Best-fit
Rotating secrets (DB creds, API keys) Secrets Manager
Config parameters (often cheaper/simpler) SSM Parameter Store

Exam cue: if you see “automatic rotation,” choose Secrets Manager.


IAM policy: allow only one DynamoDB table (copy-ready)

 1{
 2  "Version": "2012-10-17",
 3  "Statement": [
 4    {
 5      "Effect": "Allow",
 6      "Action": [
 7        "dynamodb:GetItem",
 8        "dynamodb:PutItem",
 9        "dynamodb:Query",
10        "dynamodb:UpdateItem"
11      ],
12      "Resource": "arn:aws:dynamodb:REGION:ACCOUNT:table/MyTable"
13    }
14  ]
15}

8) Deployment & IaC — SAM/CloudFormation/CDK + Code* + safe rollouts

CI/CD mental model (what’s happening)

    flowchart LR
	  Repo[Source Repo] --> Pipe[CodePipeline]
	  Pipe --> Build[CodeBuild]
	  Build --> Artifacts[(S3 Artifacts)]
	  Artifacts --> Deploy[CloudFormation/SAM/CodeDeploy]
	  Deploy --> Alias[Lambda Alias/Version]

Lambda safe deployments (versions + aliases)

High-yield terms:

  • Version: immutable snapshot of code/config.
  • Alias: pointer to a version (used for traffic shifting).
  • CodeDeploy for Lambda: canary/linear/all-at-once traffic shifting with automated rollback on alarms.

Deployment evidence map

Stem clue Strong answer Weak answer
“repeatable deployment” CloudFormation/SAM/CDK template Manual console steps only
“serverless app package” SAM build/package/deploy or pipeline using artifacts Zip upload without IaC when repeatability is required
“safe Lambda rollout” Version, alias, CodeDeploy canary/linear, CloudWatch alarms Update $LATEST directly
“rollback after alarm” Deployment preference with alarms and rollback Wait for users to report errors
“test external dependency” Mock API/integration tests Call production third-party service from every test
“many accounts/regions” StackSets or pipeline roles where appropriate Copy/paste manual stacks

SAM snippet (Lambda + API + deployment preference)

 1Resources:
 2  Api:
 3    Type: AWS::Serverless::Api
 4  Fn:
 5    Type: AWS::Serverless::Function
 6    Properties:
 7      Handler: app.handler
 8      Runtime: nodejs20.x
 9      AutoPublishAlias: live
10      DeploymentPreference:
11        Type: Canary10Percent5Minutes
12      Events:
13        Get:
14          Type: Api
15          Properties:
16            RestApiId: !Ref Api
17            Path: /items
18            Method: get

Exam cue: if you see “minimize risk” and “automatic rollback,” think CodeDeploy traffic shifting + alarms.


CloudFormation troubleshooting (fast)

  • If a stack fails, read stack events from the failure upwards.
  • “Roll back” problems often come from missing IAM permissions, missing dependencies, or invalid parameters.

9) Troubleshooting & optimization — CloudWatch, X-Ray, CloudTrail

Observability “stack” (DVA level)

  • CloudWatch Logs: what happened (application logs)
  • CloudWatch Metrics/Alarms: how often/how bad (rates, latency, errors)
  • X-Ray: where time is spent (service map, traces)
  • CloudTrail: who did what (API audit trail)

Observability decision chooser

Need Best fit Developer habit
Search errors in app logs CloudWatch Logs Insights Use structured logs and correlation/request IDs.
Alarm on business or app condition CloudWatch custom metric or EMF Emit counts/latency/error dimensions from code.
Find slow downstream dependency X-Ray traces and annotations Trace service calls, not just handler duration.
Know which principal changed config CloudTrail Use for API caller/audit evidence, not app latency.
Show health at a glance Dashboard and alarms Tie to SLO-like signals: errors, latency, throttles, DLQ age.
Notify operations SNS/EventBridge alarm action Avoid alerts with no owner or action path.

Fast eliminations table

Symptom Likely cause What to check first
API Gateway 502/504 Lambda error/timeout Lambda logs, Lambda timeout vs API timeout
429 / throttling API Gateway/Lambda/DynamoDB throttles Metrics, concurrency, capacity, backoff
AccessDenied IAM/resource/KMS key policy mismatch Evaluate each policy layer separately
SQS redrive to DLQ Poison message or too-short visibility timeout Visibility timeout, retries, handler idempotency
Lambda can’t reach internet Lambda in VPC without NAT VPC routing, NAT, VPC endpoints

CloudWatch Logs Insights (copy-ready)

1fields @timestamp, @message
2| filter @message like /ERROR|Exception|Task timed out/
3| sort @timestamp desc
4| limit 50

Retry strategy (what “best answer” looks like)

  • Use exponential backoff + jitter for throttling and transient errors.
  • Make retries safe via idempotency keys (especially for payments/orders).

Pseudo:

1sleep(random(0, base * 2^attempt)); retry

Performance quick wins (common themes)

  • Reduce Lambda cold starts with provisioned concurrency and smaller init work.
  • Use Query + proper keys/indexes in DynamoDB; add a GSI for new access patterns.
  • Use caching when appropriate (CloudFront, ElastiCache, DynamoDB DAX) to reduce hot reads.
  • Keep synchronous APIs fast; push heavy work to async (SQS/EventBridge + worker).

Next: drill by objective

  • Use Resources to keep the official exam guide and primary service docs nearby.
  • Use the FAQ when you need a quick reset on exam depth and what to memorize.
  • Keep this cheat sheet open while you drill event-driven, retry, and permission scenarios.

Quiz

Loading quiz…
Revised on Monday, June 15, 2026