AWS Developer Associate (DVA-C02) Practice Test
160 free AWS Developer Associate (DVA-C02) practice questions with answers and explanations. No signup required. The AWS Developer Associate (DVA-C02) exam is administered by Amazon Web Services (AWS), with 65 questions, a time limit of 2 hours 10 minutes and a passing score of 720 out of 1000.
Browse all questions & answers
Loading the remaining 60 questions…
Development with AWS Services
25 of 51 questions loaded1. A developer is building a Lambda function triggered by API Gateway that must validate that a required 'email' field is present and properly formatted in the JSON request body before the Lambda code even runs, to reduce unnecessary Lambda invocations for malformed requests. What is the best-fit API Gateway feature for this?
- A. An API Gateway mapping template in the integration request that drops the request body whenever the 'email' field is absent
- B. A REQUEST-type Lambda authorizer with the email field configured as an identity source and a 300-second authorization cache
- C. An API Gateway usage plan with a request quota, so malformed callers exhaust their API key
- D. API Gateway request validation configured with a JSON Schema model on the method request
Show answer & explanation
Answer: D
A request validator attached to the method checks the body against a JSON Schema (draft 4) model, so a missing required 'email' property or one that fails a pattern is rejected with a 400 before the integration runs, and the validation result is written to CloudWatch Logs; the Lambda function is never invoked. Option A transforms the payload with VTL but cannot reject the request; the integration is still invoked, only with an altered body. Option B is an authorization mechanism whose identity sources are headers, query strings, stage variables and context, not the request body, and it invokes a Lambda function of its own on every request. Option C meters and throttles calls per API key; it has no knowledge of the request body and does nothing to stop a single malformed request.2. A developer is writing a Lambda function that processes messages from an SQS standard queue. Occasionally the same message is processed twice, causing duplicate database writes. What is the most appropriate way to address this within the application code?
- A. Convert the queue to a FIFO queue with content-based deduplication, which suppresses duplicates that arrive within the 5-minute deduplication interval
- B. Design the message-processing logic to be idempotent, for example by using a unique message identifier to detect and skip repeated writes
- C. Raise the queue's visibility timeout to its 12-hour maximum so that a received message stays hidden long enough that no second consumer can receive it
- D. Add a redrive policy with maxReceiveCount set to 1 so that any message received a second time is moved to the dead-letter queue instead of reprocessed
Show answer & explanation
Answer: B
Standard queues deliver at least once, so a message that was processed but not deleted before its visibility timeout expired comes back. The fix that belongs in the application is idempotent processing: a conditional write keyed on the message ID (or an idempotency table) turns a repeated delivery into a no-op. Option A only removes duplicates the producer sends within 5 minutes; a consumer-side redelivery after a visibility timeout expiry is still delivered again, and changing the queue type is not an application-code change. Option C only delays redelivery; the message becomes visible again after 12 hours if it was not deleted, and a slow or crashed consumer still causes a second delivery. Option D sends every message that is redelivered once, including messages that failed for a transient reason, straight to the dead-letter queue, losing legitimate retries without preventing the duplicate write.3. A function processes messages from a queue and occasionally fails. What configuration prevents a persistently failing message from blocking the queue indefinitely?
- A. A dead-letter queue configured on the Lambda function's asynchronous invocation settings, which also covers messages from SQS event source mappings
- B. A visibility timeout of 12 hours on the queue, so a failing message stays hidden until the defect is fixed and redeployed
- C. A dead-letter queue with a maximum receive count, so a message exceeding the threshold is moved aside for separate investigation
- D. A message retention period of 14 days with a 15-minute delivery delay, so failing messages age out of the queue
Show answer & explanation
Answer: C
A redrive policy on the source queue with a maximum receive count moves a message to the dead-letter queue after that many failed receives, so a poison message stops being redelivered and can be inspected or redriven later while healthy messages keep flowing; Lambda's documentation says to configure the DLQ on the queue itself for SQS event sources. Option A does not apply here: the function-level dead-letter queue captures only asynchronous invocation failures, and an SQS event source mapping invokes the function synchronously, so the failing message keeps returning to the queue. Option B only delays the next redelivery; the message reappears after the timeout and blocks again, and a 12-hour timeout would also stall every legitimate retry. Option D lets the message be retried for two weeks before silently disappearing, which is data loss rather than investigation, and a delivery delay applies to new messages, not to redeliveries.4. A developer must choose between a queue and a publish-subscribe topic. What distinguishes them?
- A. A queue delivers each message to one consumer, while a topic fans a message out to all subscribers
- B. A topic delivers each message to one subscriber, while a queue broadcasts to all of its consumers
- C. A queue keeps messages up to 14 days, while a topic keeps them until each subscriber acknowledges
- D. A queue accepts messages up to 256 KB, while a topic takes up to 1 MiB and orders them
Show answer & explanation
Answer: A
SQS is point-to-point: a message is received and deleted by one consumer, which distributes work. SNS is publish/subscribe: a message published once is delivered to every subscription (SQS queues, Lambda functions, HTTP endpoints, email), which distributes notification. Subscribing several queues to one topic combines both. Option B inverts the two models; it is the topic that fans out and the queue that hands each message to a single consumer. Option C is wrong about SNS, which does not retain messages at all; delivery is attempted to each subscription and a failed delivery is retried or dropped according to the delivery policy. Option D reverses the limits (SQS accepts up to 1 MiB, SNS up to 256 KB) and misstates ordering, which only FIFO queues and FIFO topics provide.5. A message queue delivers the same message twice to a consumer. How should the consumer be designed?
- A. To fail the invocation on any message ID it has already seen, so the batch returns to the queue and the dead-letter queue receives it
- B. To assume duplicates cannot occur, because at-least-once delivery only redelivers a message after the 14-day retention period
- C. To process only the first message of each batch, because SQS orders redelivered duplicates to the tail of the receive batch
- D. Idempotently, so processing the same message more than once produces the same result as processing it once
Show answer & explanation
Answer: D
At-least-once delivery makes a duplicate a normal event, typically because a consumer processed a message but did not delete it before the visibility timeout expired. An idempotent consumer, one that records processed message IDs or performs naturally repeatable operations such as setting a value instead of incrementing it, produces the same result no matter how many times the message arrives. Option A punishes the whole batch for one duplicate and turns an expected condition into a failure path; the other messages in the batch are retried and the duplicate lands in the DLQ for no reason. Option B is wrong about the mechanism: redelivery happens after the visibility timeout (30 seconds by default), and the retention period is when unconsumed messages are deleted. Option C invents an ordering guarantee; a standard queue makes no promise about where a redelivered message appears in a batch.6. A team is designing an event-driven order processing workflow that must execute a specific sequence of steps (validate order, charge payment, reserve inventory, send confirmation), with built-in error handling, retries, and the ability to visualize execution history for each order. Which AWS service is purpose-built for this?
- A. Amazon EventBridge
- B. AWS Step Functions
- C. AWS Lambda destinations
- D. Amazon SQS
Show answer & explanation
Answer: B
Step Functions is built for exactly this: a state machine runs the steps in order, each Task state has its own Retry and Catch configuration, and every execution has a visual, step-by-step history in the console; Standard workflows run up to a year with exactly-once execution. Option A routes events from sources to targets by matching patterns; a rule has no notion of a sequence of steps, per-step retries inside one workflow, or an execution history for each order. Option C only forwards the result of one asynchronous invocation (success or failure) to another target; it cannot express a multi-step sequence with branching or retries. Option D holds messages for one consumer and provides neither ordering of steps nor any view of how far a particular order has progressed.7. A developer needs to invoke a Lambda function asynchronously and wants failed invocations, after all retries are exhausted, to be automatically captured for later inspection instead of being silently dropped. Which feature should they configure on the Lambda function?
- A. Reserved concurrency of zero on the function, so Lambda holds rejected events in its internal queue until concurrency is restored
- B. A maximum event age of 6 hours and maximum retry attempts of 2 in the function's asynchronous invocation settings
- C. A function URL with AWS_IAM auth, returning failed async invocations to the caller
- D. A dead-letter queue (DLQ) or Lambda destination for failure, targeting SQS or SNS
Show answer & explanation
Answer: D
For asynchronous invocations Lambda retries a function error twice and then discards the event unless a dead-letter queue (a standard SQS queue or SNS topic) or an on-failure destination (SQS, SNS, Lambda, EventBridge or, for failures, S3) is configured; both capture the event for inspection or reprocessing. Option A stops the function from being invoked at all; with reserved concurrency set to zero Lambda sends new events to a dead-letter queue or on-failure destination if one exists and otherwise drops them. Option B describes the default retry settings, which only control how long and how often Lambda retries; when they are exhausted the event is still discarded unless a DLQ or destination exists. Option C is a dedicated HTTPS endpoint for invoking the function; it has no role in retaining events that fail asynchronous processing.8. A developer writes unit tests for code that calls a cloud service API. What approach keeps the tests fast and deterministic?
- A. Calling the live production service from the test suite with a dedicated IAM user whose access keys are checked in
- B. Mocking or stubbing the service client so tests exercise the application's logic without network calls
- C. Skipping tests for any code path that calls an AWS API and covering it with a manual checklist
- D. Adding sleep statements before each assertion so that the service has time to respond before the test evaluates it
Show answer & explanation
Answer: B
Mocking the SDK client isolates the unit under test from network latency, credentials, cost and service state, so the suite is fast and deterministic enough to run on every change; integration tests against a real or emulated service remain a separate, complementary layer. Option A makes tests slow, flaky and expensive, risks mutating production data, and commits long-term credentials to the repository. Option C leaves the code that talks to AWS, usually where the bugs are, without automated coverage. Option D makes the suite slower and still nondeterministic; a fixed sleep is either too short on a bad day or wasted time on a good one.9. A developer needs event data delivered to multiple consumers with the ability to replay past events. Which service model fits?
- A. A streaming service retaining records for a configured period, where consumers track their own position independently
- B. A standard SNS topic fanning each event out to every subscriber at publish time, retaining nothing after delivery has been attempted
- C. An SQS FIFO queue with 14-day retention, where each consumer deletes messages after processing them
- D. An Amazon Data Firehose delivery stream buffering events for up to 900 seconds before writing them to S3
Show answer & explanation
Answer: A
Kinesis Data Streams keeps records for a configurable retention period (24 hours by default, up to 365 days) and each consumer application reads with its own shard iterator or checkpoint, so several consumers process the same records independently and a new or recovering consumer can replay from an earlier position. Option B delivers and forgets: a subscriber that was down or added later never sees past events, because SNS keeps no record after delivery. Option C removes a message once a consumer deletes it, so only one consumer sees each message and there is nothing left to replay. Option D is a delivery pipeline into S3, Redshift or OpenSearch; it does not let consumer applications track a position or read the stream directly.10. A developer must ensure a multi-step workflow with waits, branching and error handling is reliably coordinated. What is the appropriate approach?
- A. A single Lambda function running the whole workflow with sleep calls, since the 15-minute timeout covers most waits
- B. A chain of Lambda functions each invoking the next synchronously, passing state along in the 6 MB response payload
- C. An EventBridge Scheduler rule invoking a checker function every hour to advance whichever step is currently due
- D. A managed workflow orchestration service defining states, transitions and retry behavior declaratively
Show answer & explanation
Answer: D
Step Functions defines the workflow in Amazon States Language: Wait states pause without running compute, Choice states branch, and each Task carries Retry (IntervalSeconds, MaxAttempts, BackoffRate) and Catch definitions; progress is persisted between steps and a Standard workflow can run for up to a year with a visual execution history. Option A pays for compute while it sleeps, loses all progress if the invocation fails, and cannot wait longer than 15 minutes in total. Option B couples every step to the next, makes a failure in step five unwind through five callers, and is bounded by the timeouts and payload limits of synchronous invocation. Option C polls instead of reacting, adds up to an hour of latency to every transition, and forces the developer to write the state tracking that orchestration provides.11. A developer needs to add caching to a REST API built with Amazon API Gateway to reduce load on a backend Lambda function for frequently requested, rarely changing data. Which built-in API Gateway feature should they enable?
- A. API Gateway stage-level caching
- B. API Gateway request validation
- C. API Gateway usage plan quotas
- D. API Gateway method throttling
Show answer & explanation
Answer: A
Stage-level caching stores integration responses for a TTL (300 seconds by default, 3,600 maximum) and answers repeated GET requests from the cache without invoking the Lambda integration, which is exactly the goal for frequently requested, rarely changing data. Option B checks required parameters and validates the body against a JSON Schema model before the integration, returning 400 on failure; it never stores a response. Option C sets a request quota per API key for a day, week or month and throttles above it; every allowed request still invokes the backend. Option D caps the request rate per method and returns 429 Too Many Requests above the limit; it protects the backend by rejecting calls rather than by serving cached responses.12. An application calls a service API and receives a throttling error. What is the correct client behavior?
- A. Fail the operation and return the error to the user, since throttling errors carry an HTTP 4xx status and 4xx errors are never retried by the SDK
- B. Retry with exponential backoff and jitter, since the error indicates the request rate exceeded a limit rather than a permanent failure
- C. Retry immediately in a tight loop, since the SDK's standard mode caps attempts at 3 and adds the backoff for you
- D. Switch the client to another Region for all later requests, since throttling quotas are shared across Regions
Show answer & explanation
Answer: B
A throttling error (ThrottlingException, TooManyRequestsException, ProvisionedThroughputExceededException and similar) means the request rate exceeded a quota, not that the request is invalid, so it is retried with exponential backoff and jitter; the SDK's standard retry mode does this by default with a longer base delay for throttling than for transient errors. Option A misreads the status code: throttling errors are classified as retryable even though they are 4xx responses, and giving up on the first one turns a transient condition into a user-visible failure. Option C hammers a service that is already rejecting requests; the standard mode's backoff applies to the SDK's own retries, and a loop written around them defeats it. Option D moves the workload to Region-scoped resources that may not exist there; quotas are per Region, and the correct response to exceeding one is to slow down or request an increase.13. An application must respond to a client immediately while completing slow work afterward. What pattern applies?
- A. Returning 503 with a Retry-After header so the client resubmits the request later, when the work may be faster
- B. Accepting the request, enqueuing the work, and returning an identifier the client can use to poll for the result
- C. Running the work in the same invocation with Lambda response streaming, sending the 200 status before the body
- D. Holding the connection open until the work is done, raising the API Gateway integration timeout past 29 seconds
Show answer & explanation
Answer: B
The asynchronous request-reply pattern acknowledges the request at once (202 Accepted with a job ID), puts the work on an SQS queue or starts a Step Functions execution, and lets the client poll a status endpoint or receive a callback; the client is not held waiting and the work is not bound by request timeouts. Option D still ties the client and the connection to the duration of the work; a longer integration timeout moves the limit rather than removing it and does nothing for clients that disconnect. Option A does not perform the work at all; it pushes the request back to the client and repeats the same problem on the next attempt. Option C still keeps the client connected for the whole duration, because streaming changes how the response is delivered, not whether the caller must wait for completion.14. An application writes to a NoSQL table and must not overwrite a concurrent update from another process. What mechanism prevents this?
- A. A strongly consistent read of the item immediately before the write, which DynamoDB serializes together with the write as a single unit
- B. A conditional write checking a version attribute or expected value, failing if the item changed since it was read
- C. A TransactWriteItems call wrapping the single update, since a transaction locks the item until the caller commits the change
- D. Enabling DynamoDB Streams with the OLD_IMAGE view type so a downstream function can restore any attribute that was overwritten
Show answer & explanation
Answer: B
Optimistic locking uses a condition expression such as version = :expected (or attribute_not_exists for a create) so that the write is rejected with ConditionalCheckFailedException if another process changed the item after it was read; the caller then re-reads and retries with the new version. Option A is not atomic with the write: a strongly consistent read returns the latest value, but another writer can still update the item in the interval before your write lands. Option C misdescribes transactions, which do not hold locks and, without a ConditionCheck or condition expression, will happily overwrite whatever value is present. Option D acts after the damage is done; a stream lets you detect an overwrite and attempt repair, but it does not prevent the concurrent update from being lost.15. A candidate wants to know the passing threshold for the AWS Certified Developer - Associate exam and how the score is reported. Which statement correctly reflects the official scoring scale and passing score?
- A. Scores are reported on a scale of 0 to 100, and the minimum passing score is 70
- B. Scores are reported on a scale of 100 to 1,000, and the minimum passing score is 500
- C. Scores are reported on a scale of 100 to 1,000, and the minimum passing score is 720
- D. Scores are reported as a raw percentage out of 100%, and the minimum passing score is 72%
Show answer & explanation
Answer: C
AWS reports scores on a scaled range of 100 to 1,000, and the minimum passing score for this exam is 720; the scaling accounts for minor difficulty differences across exam forms, so it is not simply a raw percentage. Option D incorrectly describes the scale as a raw percentage rather than the official 100-1,000 scaled score. Option A uses the wrong scale entirely (0-100). Option B uses the correct scale but the wrong passing threshold — 500, not 720, which would misinform a candidate about how many correct answers are actually needed to pass.16. A development team wants to package a Lambda function along with several third-party npm libraries that total 80 MB. Which deployment approach best fits this scenario while keeping the deployment package manageable?
- A. Store the dependencies in DynamoDB and load them at invocation time
- B. Require every invocation to download the dependencies from the internet before running the handler
- C. Inline the entire dependency tree directly in the Lambda console code editor
- D. Package the dependencies as a Lambda layer and attach the layer to the function
Show answer & explanation
Answer: D
Lambda layers let you separate shared dependencies from function code, keeping the deployment package smaller, enabling reuse across functions, and avoiding editing large payloads inline. The console code editor (C) only supports small inline edits and can't handle large dependency trees. DynamoDB (A) is a database, not a binary/code artifact store, and loading binaries from it at runtime is impractical. Downloading dependencies at invocation time (B) adds latency and violates Lambda's stateless, fast-start execution model.17. An application uploads a 5 GB file to object storage over an unreliable connection. What approach is appropriate?
- A. A single PutObject request with a Content-MD5 checksum, since 5 GB is the largest object one PUT accepts
- B. S3 Transfer Acceleration on the bucket, which routes the upload through a CloudFront edge and retries dropped packets
- C. Multipart upload, which splits the object into parts that can be uploaded in parallel and retried individually
- D. Splitting the file into separate 100 MB objects with a lifecycle rule that reassembles them after upload
Show answer & explanation
Answer: C
Multipart upload splits the object into parts of 5 MiB to 5 GiB (up to 10,000 parts), uploads them in parallel and retries only the parts that fail, so a dropped connection costs one part rather than the whole transfer; AWS recommends it once objects reach about 100 MB, and a lifecycle rule should abort incomplete uploads that would otherwise keep billing. Option A sits exactly at the single-PUT limit with no retry granularity: any interruption restarts the entire 5 GB transfer, and the checksum only detects corruption after the fact. Option B reduces latency by entering the AWS network at an edge location, but the transfer is still one request and a broken connection still starts it over. Option D describes a lifecycle action that does not exist; lifecycle rules transition, expire and abort incomplete multipart uploads, they never concatenate objects.18. A developer is building a serverless API using API Gateway and Lambda. The Lambda function needs to write logs that include the full request payload for debugging, but the team is worried about excessive CloudWatch Logs costs in production. What is the best approach?
- A. Set the function's log format to JSON with the application log level at DEBUG in every stage, and move the log group to the Infrequent Access log class
- B. Log the full payload at INFO level on every invocation and shorten the log group's retention period to 1 day so that the stored volume stays small
- C. Use environment variables to set a LOG_LEVEL, and only emit verbose payload logs when the level is DEBUG, disabling that level in production
- D. Write the payload to the function's /tmp directory and ship it to S3 with a lifecycle rule, bypassing CloudWatch Logs ingestion charges entirely
Show answer & explanation
Answer: C
CloudWatch Logs bills mainly on ingested volume, so the lever is how much the function emits in production. Reading a LOG_LEVEL environment variable and emitting the payload only at DEBUG keeps the detail available in dev and test while production emits INFO and above; the same idea is what Lambda's JSON log-level filtering and Powertools loggers implement. Option A leaves DEBUG on in production, so every payload is still ingested; the Infrequent Access class only lowers the ingestion price and removes metric filters, subscription filters and Live Tail, which the team may need. Option B still ingests every payload; retention only shortens how long stored data is kept and does not reduce the ingestion charge that drives the cost. Option D puts logs in ephemeral, per-environment storage (512 MB by default) that disappears when the environment is recycled, adds a custom shipping path, and removes the payload from the centralized log stream used for debugging.19. A developer wants their Lambda function, written in Node.js, to reuse a database connection across multiple invocations to reduce cold-start overhead and connection churn. Where should the connection be initialized to achieve this?
- A. Inside the handler but guarded by a check of the invocation's request ID, so a new connection opens only when the request ID changes
- B. In a Lambda layer's initialization script, since code packaged in a layer runs once per account and is shared by every function using it
- C. Outside the handler function, at the top level of the module, so it runs once per execution environment and is reused across warm invocations
- D. In the function's environment variables as a serialized connection string that the SDK rehydrates into an open socket on each invocation
Show answer & explanation
Answer: C
Code at module scope runs during the Init phase, once per execution environment, and objects it creates stay in memory while the environment is reused for warm invocations. Lambda's execution environment lifecycle documentation recommends exactly this for database connections, with a check that the connection is still alive. Option A opens a new connection on every invocation, because the request ID is different for every request; it adds a check without adding any reuse. Option B misunderstands layers, which only add files to /opt of the deployment package; nothing in a layer runs per account or shares live objects across functions. Option D cannot work because environment variables hold strings (4 KB in total); a TCP connection is a live object that cannot be serialized into configuration.20. Of the 65 total items on the AWS Certified Developer - Associate exam, how many actually count toward the candidate's final score, and what happens to the rest?
- A. All 65 questions are scored, but the 15 hardest items are dropped from the raw total before conversion to the 100 to 1,000 scale
- B. 60 questions are scored, and 5 are unscored survey items about the testing experience that appear after the 130-minute section
- C. 55 questions are scored, and 10 are unscored items that AWS flags at the end of the exam so candidates know which did not count
- D. 50 questions are scored, and 15 are unscored items used by AWS to evaluate future questions without affecting the candidate's score
Show answer & explanation
Answer: D
The DVA-C02 exam guide states that the exam includes 50 questions that affect the score and 15 unscored questions that AWS uses to evaluate items for future use as scored questions; the unscored questions are not identified on the exam, and the whole set is answered within the 130-minute session. Option C has the wrong split and invents an identification step; AWS says explicitly that the unscored questions are not identified on the exam. Option A invents a dropping rule; scaled scoring equates difficulty across exam forms, it does not discard the hardest 15 items, and only 50 items are scored to begin with. Option B has the wrong split and confuses the unscored content items with a post-exam survey; the unscored questions are regular exam questions mixed into the timed section.21. A serverless function experiences elevated latency on the first invocation after a period of inactivity. What causes this?
- A. A cold start, where the execution environment must be initialized and the runtime and dependencies loaded before the handler runs
- B. A throttled start, where the function waited for the account's 1,000 concurrent execution limit to free a slot before the handler could run
- C. A frozen /tmp restore, where Lambda reloads up to 10,240 MB of ephemeral storage from S3 before the handler runs
- D. A DNS warm-up, where the runtime's first call to a Regional endpoint waits for Route 53 resolution and caches it for 60 seconds
Show answer & explanation
Answer: A
After a period without requests Lambda has no initialized execution environment, so the next invocation pays the Init phase: download the code, start the runtime and run the code outside the handler. That cold start is what makes the first invocation slower; subsequent invocations reuse the warm environment. Option B describes throttling, which produces 429 errors or queued asynchronous events rather than a slow success, and a lightly used function is nowhere near the concurrency limit. Option C invents a mechanism; /tmp is ephemeral storage that persists only while the environment lives and is never restored from S3. Option D attributes the delay to name resolution, which takes milliseconds and does not explain the hundreds of milliseconds to seconds of runtime and dependency initialization.22. An application uses DynamoDB to store user session data and must handle sudden bursts of read traffic without throttling, while keeping cost predictable for a mostly steady baseline load. Which DynamoDB capacity mode addresses this best?
- A. Provisioned capacity mode with auto scaling configured to react to demand changes
- B. Provisioned capacity mode with a fixed number of read/write capacity units and no auto scaling
- C. DynamoDB Accelerator (DAX) used as a replacement for capacity planning
- D. On-demand capacity mode for all tables regardless of traffic pattern
Show answer & explanation
Answer: A
Provisioned capacity with auto scaling lets a table scale read/write throughput up during bursts and back down during steady periods, giving predictable baseline cost with burst tolerance. Pure on-demand (D) is simpler but can be less cost-predictable for steady, well-understood workloads. A fixed provisioned setting with no auto scaling (B) throttles during unexpected bursts. DAX (C) is a caching layer that reduces read latency and load on the table but does not itself manage or replace write/read capacity provisioning.23. A company runs a Lambda function that reads and writes items to DynamoDB. The team wants to guarantee that a specific attribute update only happens if another attribute has not changed since it was last read by the client, to avoid overwriting concurrent updates. What DynamoDB feature should the developer use in the write request?
- A. A TransactWriteItems call, because transactions serialize all concurrent writes to the item
- B. A conditional write expression on the UpdateItem or PutItem call
- C. A strongly consistent read (ConsistentRead=true) of the item immediately before the write
- D. DynamoDB Streams with the NEW_AND_OLD_IMAGES view type to detect overwrites downstream
Show answer & explanation
Answer: B
A ConditionExpression on UpdateItem or PutItem implements optimistic concurrency: the write succeeds only if the condition (for example, version = :expected) still holds, otherwise DynamoDB rejects it with ConditionalCheckFailedException and the client re-reads and retries. Option A makes the writes atomic and isolated but does not compare the attribute with what the client read; without a ConditionCheck or condition expression the transaction still overwrites the concurrent update. Option C returns the latest committed value but leaves the gap between the read and the write open, so another writer can still change the item in between. Option D records the change after it has already happened; a stream lets you observe an overwrite, not prevent it.24. A team is building a microservices application where several Lambda functions need to publish domain events that multiple independent subscribers (an SQS queue, an email notification Lambda, and a third-party HTTPS endpoint) should all receive. Which AWS service is the best fit for fanning out a single event to multiple independent subscribers?
- A. Amazon SQS
- B. AWS Step Functions
- C. Amazon Kinesis Data Streams
- D. Amazon SNS
Show answer & explanation
Answer: D
SNS is publish/subscribe: one Publish call delivers the message to every subscription on the topic, and SQS queues, Lambda functions and HTTPS endpoints are all supported subscription protocols, with filter policies to route subsets of events. Option A delivers each message to one consumer, which then deletes it; three subscribers would compete for messages rather than each receiving every event. Option B orchestrates the steps of one workflow with retries and history; it is not a broadcast mechanism for independent subscribers. Option C does allow multiple consumer applications to read the same records, but it requires shard management, a consumer library or enhanced fan-out and offers no native delivery to email or HTTPS endpoints; it is heavier than a simple notification fan-out.25. A REST API integration calls a backend report service that sometimes needs 45 seconds to respond, and clients receive a 504 from API Gateway. What is true about the integration timeout?
- A. It defaults to 29,000 milliseconds and is raised by enabling response streaming on the method
- B. It defaults to 29,000 milliseconds and cannot be changed, so the backend work must be made asynchronous
- C. It defaults to 29,000 milliseconds and can be raised above 29 seconds for Regional or private APIs
- D. It defaults to 30,000 milliseconds and can be raised to 900,000 for any REST API endpoint type
Show answer & explanation
Answer: C
The integration timeout is a custom value between 50 and 29,000 milliseconds, defaulting to 29,000, and AWS permits raising it beyond 29 seconds for Regional or private APIs only, so an edge-optimized API would still cut off at 29 seconds. Option B is the older blanket statement and is now too strong. Option D misstates both the default and the ceiling. Response streaming (A) changes how a response body is transferred and does not extend the integration timeout.
Security
25 of 42 questions loaded26. A browser must upload directly to object storage without the application proxying the bytes, while the application controls who may upload. What mechanism achieves this?
- A. A bucket policy granting s3:PutObject to the anonymous principal on the upload prefix, with Block Public Access enabled
- B. Cognito unauthenticated identities with an IAM role allowing s3:PutObject on the whole bucket via the identity pool ID
- C. The application's own access key pair delivered to the browser over TLS and rotated every 90 days by IAM key rotation
- D. A pre-signed URL generated by the application, granting time-limited permission for a specific operation on a specific object
Show answer & explanation
Answer: D
A presigned URL (or presigned POST) is generated with the application's credentials for one HTTP method, one object key and an expiration (up to 7 days with IAM user credentials, no longer than the session for role credentials); the browser uploads directly to S3 while the server decides who gets a URL and for what. Option A is self-contradicting: Block Public Access rejects a bucket policy that grants access to the anonymous principal, and if it were disabled anyone on the internet could write anything to the prefix. Option B hands every visitor the same guest role with write access to the entire bucket, so the application no longer controls who may upload or where. Option C puts long-term credentials in client-side code where every user can read them; rotation shortens the exposure but does not make the design acceptable.27. An API must reject requests exceeding a defined rate per client. Where is this best enforced?
- A. In the client SDK by asking each caller to set AWS_MAX_ATTEMPTS to 1 so it stops retrying when throttled
- B. At the API gateway layer through usage plans or throttling, before the request reaches backend compute
- C. At the database with RDS Proxy's MaxConnectionsPercent setting, rejecting clients over their share
- D. Inside the Lambda handler with a DynamoDB counter per client, returning 429 after the request has already been processed
Show answer & explanation
Answer: B
API Gateway enforces rate and burst limits with a token bucket at the account, stage, method and, through usage plans with API keys, per-client level, returning 429 Too Many Requests before the integration runs; an abusive client therefore consumes no Lambda or database capacity. Option D pays the full backend cost before saying no, so the limit protects nothing, and it adds a DynamoDB write to every request. Option C sizes the database connection pool for the proxy as a whole; it has no notion of an API client and rejects connections, not requests. Option A depends on the client's goodwill; a client that ignores the setting, or is malicious, is not limited at all, and retries are not the same thing as request rate.28. A company's application stores customer records in Amazon S3 and needs to ensure that data is encrypted at rest, with AWS managing the encryption keys automatically without any additional developer configuration on each PutObject call. Which S3 encryption option satisfies this with the least operational overhead?
- A. Client-side encryption where the application encrypts data before uploading
- B. Server-side encryption with Amazon S3 managed keys (SSE-S3)
- C. Server-side encryption with customer-provided keys (SSE-C), supplying a new key on every request
- D. No encryption, relying solely on bucket policies to restrict access
Show answer & explanation
Answer: B
SSE-S3 has AWS manage the encryption keys entirely, encrypting objects automatically at rest with no extra per-request key management from the developer, matching the 'least operational overhead' requirement. Client-side encryption (A) requires the application itself to manage encryption and keys, adding developer overhead. SSE-C (C) requires the caller to supply and manage the encryption key on every request, which is more operational burden, not less. Relying only on bucket policies (D) controls access but does not encrypt data at rest, and does not meet the stated encryption requirement.29. A developer's Lambda function needs to decrypt a value that was encrypted using an AWS KMS customer managed key. The function's execution role currently has no KMS permissions. Which IAM permission model change is required for the decryption call to succeed?
- A. The execution role needs kms:Decrypt permission on the specific key, and the key's key policy must also allow that role to use the key
- B. Grant kms:Decrypt to the execution role in an IAM policy only, since a key policy cannot restrict principals in the key's account
- C. Add kms:Decrypt to the Lambda function's resource-based policy, since KMS evaluates the policy on the calling resource, not the role
- D. Attach the AWSLambdaBasicExecutionRole managed policy, which already includes kms:Decrypt on every customer managed key
Show answer & explanation
Answer: A
KMS is unusual among AWS services: a key policy does not automatically trust the account, so an IAM policy can grant kms:Decrypt only if the key policy allows it (the default 'Enable IAM User Permissions' statement) or names the role directly. The execution role therefore needs kms:Decrypt on the key, and the key policy must permit that role to use the key. Option B gets the model backwards; without a key policy statement that enables IAM policies or names the role, IAM allow statements for the key are ineffective even inside the same account. Option C confuses two resource policies; the function's resource-based policy controls who may invoke the function, while access to the key is decided by the key policy together with the caller's IAM policy. Option D is wrong about the managed policy, which grants only the CloudWatch Logs permissions (CreateLogGroup, CreateLogStream, PutLogEvents) and nothing in KMS.30. A Lambda function needs to read objects from an S3 bucket and write items to a DynamoDB table, but should not have any broader account permissions. What is the most secure way to grant it exactly the permissions it needs?
- A. Grant the Lambda function's execution role full access to all S3 buckets and DynamoDB tables in the account to avoid future permission errors
- B. Attach the AdministratorAccess managed policy to the function's execution role for simplicity
- C. Create an IAM execution role with a custom policy granting only the specific S3 and DynamoDB actions and resources required
- D. Embed an IAM user's long-term access key and secret directly in the function's environment variables
Show answer & explanation
Answer: C
Following least privilege, a custom IAM policy attached to the function's execution role that scopes exactly the needed S3 and DynamoDB actions/resources is the secure, correct pattern for Lambda permissions. AdministratorAccess (B) grants far more permission than needed, violating least privilege and increasing blast radius if compromised. Embedding long-term IAM user credentials in environment variables (D) is an anti-pattern; Lambda execution roles already provide temporary, automatically rotated credentials, so static keys are unnecessary and risky. Granting full access to all S3 buckets and DynamoDB tables (A) is also overly broad and violates least privilege.31. An application running on an EC2 instance needs to call the S3 API. The security team requires that no long-term access keys ever be stored on the instance. What is the recommended way to grant the application AWS API permissions?
- A. Store an IAM user's access key pair in an encrypted file on the instance's EBS volume and decrypt it at startup with a KMS key
- B. Call sts:GetSessionToken with an IAM user's credentials to obtain a 12-hour session token at startup
- C. Create an IAM user for each instance and rotate its access keys every 90 days with a scheduled Lambda function
- D. Attach an IAM role to the EC2 instance profile, so the instance retrieves temporary credentials automatically
Show answer & explanation
Answer: D
An IAM role attached through the instance profile makes the instance metadata service supply temporary credentials that are rotated automatically before they expire, and the SDK credential provider chain picks them up with no keys on disk, which satisfies the security team's requirement. Option A still places a long-term access key pair on the instance; encrypting the file changes where the key is exposed, not the fact that it is stored there. Option C still stores long-term keys on every instance and multiplies the credentials to manage; rotation shortens the exposure window but does not remove the stored key. Option B needs the IAM user's long-term access keys on the instance to sign the GetSessionToken call in the first place, so the requirement is violated before the session token exists.32. An application must authenticate end users and obtain scoped, temporary credentials for them to access resources directly. Which approach fits?
- A. An IAM user created per end user by the application at sign-up, with an access key pair returned after sign-in
- B. A single IAM user whose access keys are shared by every end user and rotated every 90 days by a scheduled function
- C. A user identity service issuing tokens exchanged for temporary credentials through role assumption, scoped per user
- D. The application's own execution role assumed directly by the browser, using the instance metadata credentials
Show answer & explanation
Answer: C
Federation through Cognito (a user pool for authentication, an identity pool to exchange the token for STS credentials) gives each user short-lived credentials from a role whose policy can be scoped with the user's identity, so users reach only their own resources and nothing durable has to be issued or revoked per person. Option A creates a durable IAM principal per person, which does not scale, hands long-term keys to devices and leaves every credential to be rotated and revoked individually. Option B cannot distinguish one user from another, so nothing prevents an authenticated user from reading another user's data, and one leaked key exposes everyone. Option D exposes the server's own permissions to every client and, because the metadata credentials belong to the host, gives users far more than their own resources.33. A serverless function must retrieve a database password at runtime. What is the appropriate mechanism?
- A. Retrieving it from a managed secrets service using the function's execution role, caching it across warm invocations
- B. Storing it as a plaintext environment variable, since Lambda encrypts environment variables at rest with an AWS managed key
- C. Embedding it in the deployment package as a constant, since the package is encrypted at rest in Lambda's managed code storage
- D. Passing it in the event payload on every call, since payloads are never logged and vanish when the invocation ends
Show answer & explanation
Answer: A
Fetching the password from Secrets Manager (or a SecureString parameter) with the execution role gives centralized rotation, access logging and revocation, and caching the value outside the handler, or using the Parameters and Secrets Lambda extension with its 300-second default TTL, avoids a lookup on every invocation. Option B exposes the value to anyone with lambda:GetFunctionConfiguration, in the console and in deployment templates; encryption at rest does not hide it from those readers, and it cannot be rotated without redeploying. Option C bakes the secret into an artifact that is copied into every build, repository and version; encryption of code storage does nothing for the developers and pipelines that handle the package. Option D hands the secret to every caller and puts it in a payload that can appear in logs, traces and dead-letter queues; the caller should never possess it at all.34. A company stores application secrets, such as database passwords, and wants them automatically rotated on a schedule without custom rotation code being written for supported database engines, while also being retrievable by Lambda functions at runtime. Which AWS service best fits this requirement?
- A. AWS Systems Manager Parameter Store
- B. AWS Key Management Service
- C. AWS Secrets Manager
- D. AWS CloudHSM
Show answer & explanation
Answer: C
Secrets Manager offers managed rotation for Amazon RDS, Aurora, DocumentDB and Redshift credentials with no rotation code, Lambda-based rotation for anything else, versions with AWSCURRENT and AWSPREVIOUS staging labels, and a GetSecretValue API the function calls with its execution role (optionally cached through the Parameters and Secrets Lambda extension). Option A stores SecureString values encrypted with KMS (4 KB standard, 8 KB advanced) but has no built-in rotation; you would have to write and schedule the rotation yourself. Option B manages encryption keys and performs cryptographic operations; it does not store or rotate application passwords. Option D provides dedicated hardware security modules for key material; it is not a secrets store and has no rotation workflow for database credentials.35. A company wants developers calling their internal APIs hosted on API Gateway to authenticate using short-lived AWS Signature Version 4 signed requests derived from IAM credentials, rather than managing separate API keys. Which API Gateway authorization option supports this?
- A. API key authorization with usage plans as the sole mechanism
- B. No authorization, relying only on network-level security groups
- C. Resource policies attached to an unrelated S3 bucket
- D. IAM authorization on the API Gateway method
Show answer & explanation
Answer: D
IAM authorization on an API Gateway method requires callers to sign requests with SigV4 using valid IAM credentials, letting API Gateway verify the caller's identity and permissions without separate API keys. API keys with usage plans (A) are meant primarily for throttling/quota tracking of API consumers and are not tied to IAM credential based SigV4 signing. Relying only on security groups (B) does not apply to API Gateway's HTTP-level access (API Gateway does not sit behind customer-managed security groups the way EC2 does for regional REST APIs invoked over the internet), and provides no request-level identity authorization. An S3 bucket resource policy (C) governs access to S3 objects, not to API Gateway API methods.36. A mobile application needs to let users sign in with Google or Facebook and then obtain temporary AWS credentials to directly access an S3 bucket and DynamoDB table, without the app managing any long-term AWS credentials. Which AWS service combination is designed for this?
- A. Amazon Cognito User Pools alone, whose ID and access JWTs are accepted by Amazon S3 and DynamoDB as AWS credentials
- B. AWS IAM Identity Center permission sets assigned to each Google or Facebook user, issuing 12-hour console session credentials
- C. AWS STS GetSessionToken called by the app with an IAM user's access keys embedded in the mobile binary, refreshed every hour
- D. Amazon Cognito Identity Pools (Federated Identities) exchanging federated tokens for temporary IAM credentials via STS
Show answer & explanation
Answer: D
An identity pool is a directory of federated identities that exchanges a Google or Facebook token (or a user pool token) for temporary AWS credentials through AssumeRoleWithWebIdentity, with an authenticated IAM role that scopes what the app may do against S3 and DynamoDB; no long-term keys ever reach the device. Option A issues OIDC JSON Web Tokens for authentication; S3 and DynamoDB require SigV4-signed requests with IAM credentials, which a user pool by itself does not vend. Option B is the workforce single sign-on service for employees using the console and CLI; it does not federate consumer identities from social providers for a mobile app. Option C embeds long-term IAM user keys in the app, which is exactly what the requirement forbids and which anyone who unpacks the binary can extract.37. A developer must grant a function permission to read from one specific storage prefix and nothing else. What does the policy require?
- A. An action limited to read operations and a resource ARN scoped to that prefix, rather than a wildcard over the whole bucket
- B. The AmazonS3ReadOnlyAccess managed policy on the execution role, since managed policies can be narrowed later with a permissions boundary
- C. s3:* on the bucket ARN with a Deny statement for every other prefix, since explicit denies are evaluated before any allow
- D. No IAM policy at all, since a Lambda function inherits the S3 permissions of the account's root user unless it is restricted
Show answer & explanation
Answer: A
Least privilege is expressed in both dimensions of a statement: the Action list (s3:GetObject, and s3:ListBucket with a prefix condition if listing is needed) and the Resource ARN arn:aws:s3:::bucket/prefix/*; a wildcard over the bucket or over all actions grants far more than the function needs. Option B grants read access to every bucket in the account, and a permissions boundary is a separate guardrail that has to be designed and attached; convenience grants are rarely narrowed later. Option C allows every S3 action, including delete and write, on the one prefix and relies on a growing deny list that must be maintained as prefixes are added; it is the opposite of a minimal allow. Option D is false: a function has exactly the permissions of its execution role and inherits nothing from the account; with no policy it cannot read the bucket at all.38. A developer caches API responses at the gateway. What must be considered about the cache key?
- A. Whether it fits in the 1,048,576-byte maximum cacheable response size, since larger keys are truncated
- B. Whether it includes the parameters that vary the response, since omitting one returns another caller's result
- C. Whether the TTL is below the 300-second default, since API Gateway evicts entries by time, never by key
- D. Whether the cache capacity is at least 0.5 GB, since smaller caches hash every request to a single key
Show answer & explanation
Answer: B
API Gateway caches per stage and forms the cache key from the method and path plus the query strings, headers or path parameters you explicitly mark as cache key parameters. If a parameter that changes the response, most dangerously a user identifier or Authorization header, is not part of the key, one caller's cached response is served to another; this defect appears only under concurrent use by different callers. Option A mixes up two limits: 1,048,576 bytes is the largest response API Gateway will cache, and keys are not truncated; a request whose response is too large is simply not cached. Option C is not the correctness issue; entries can also be invalidated per request with Cache-Control: max-age=0 by an authorized caller, and a short TTL merely shortens how long a cross-caller leak lasts. Option D invents a behavior; 0.5 GB is simply the smallest cache size available, and capacity affects hit rate and throughput, not how keys are formed.39. An S3 bucket must invoke a Lambda function on object creation. The function's execution role already allows s3:GetObject, but the notification cannot be saved. What is missing?
- A. An execution role trust policy that adds s3.amazonaws.com as a principal permitted to assume the role
- B. An execution role permission allowing lambda:InvokeFunction on the function's own ARN
- C. A bucket policy allowing the function's execution role to call s3:PutBucketNotification
- D. A resource-based policy on the function allowing s3.amazonaws.com to call lambda:InvokeFunction
Show answer & explanation
Answer: D
Two distinct policies govern a Lambda function: the execution role says what the function may do, and the resource-based policy says who may invoke it, so an event source such as S3 needs an invoke permission on the function. The trust policy (A) controls who can assume the execution role, which is the Lambda service, not S3. Granting the function permission to invoke itself (B) addresses nothing. A bucket policy (C) governs access to the bucket rather than permission to invoke the function.40. A compliance reviewer asks whether enabling automatic rotation on a customer managed KMS key will break existing ciphertext or require application changes. What is the accurate answer?
- A. Old ciphertext must be re-encrypted with ReEncrypt before the rotation date, since prior material is deleted
- B. Old ciphertext still decrypts, but applications must specify the key material version on every Decrypt call
- C. Old ciphertext still decrypts only if the application pins the key by alias rather than by key ID or key ARN
- D. Old ciphertext still decrypts because KMS keeps prior key material, and the key ID and ARN do not change
Show answer & explanation
Answer: D
Rotation changes only the current key material used for new encryption; AWS KMS retains all prior material for keys it generates and automatically selects the right version on decrypt, and the KMS key remains the same logical resource with an unchanged key ID and ARN. Nothing must be re-encrypted (A), since material is deleted only when the key itself is deleted. Callers cannot and need not choose a material version (B). Aliases (C) are a naming convenience and have no bearing on decryption after rotation.41. A configuration value of about 6 KB must be stored in Systems Manager Parameter Store. The developer's PutParameter call fails on size. What explains the failure and the fix?
- A. Standard parameters cap the value at 4 KB; creating it as an advanced parameter raises the cap to 8 KB
- B. Standard parameters cap the value at 4 KB; enabling higher throughput on the account raises the cap to 8 KB
- C. Standard parameters cap the value at 4 KB; storing it as a SecureString raises the cap to 8 KB per value
- D. Standard parameters cap the value at 8 KB; only advanced parameters may exceed that, up to 64 KB
Show answer & explanation
Answer: A
The standard tier allows a 4 KB maximum value and 10,000 parameters per account and Region, while the advanced tier allows 8 KB, 100,000 parameters, and parameter policies, at a cost. Higher throughput (B) is a separate setting that raises transactions per second and changes no size limit. SecureString (C) describes encryption with KMS, not capacity. Option D inflates both numbers; 8 KB is the advanced ceiling, and a parameter cannot be downgraded from advanced back to standard.42. A database credential in Secrets Manager must rotate without any window in which running applications are rejected by the database. Which rotation strategy meets that requirement?
- A. The single user strategy combined with a longer rotation schedule to shrink the affected window
- B. The alternating users strategy, which avoids needing a separate superuser secret to clone the user
- C. The single user strategy, which updates the password in place and is the simpler option to operate
- D. The alternating users strategy, which keeps one credential usable while the other is being rotated
Show answer & explanation
Answer: D
The alternating users strategy maintains two credentials that swap roles, so one stays valid while the other rotates, which is why AWS recommends it for production availability. The single user strategy (C and A) changes the password of one user and leaves a brief period in which the old password is rejected, and lengthening the schedule reduces how often that happens without removing it. Option B names the right strategy but the wrong detail: alternating users requires a superuser secret to manage the second account.43. Code running on an EC2 instance with an instance profile generates presigned S3 URLs and requests a 24-hour expiration. Users report the links stop working after a few hours. Why?
- A. Presigned URLs require the requester to re-sign the request with SigV4 every hour, which the SDK does only while resident
- B. Presigned URLs generated with temporary credentials expire when those credentials do, typically about 6 hours here
- C. Presigned URLs are capped at 12 hours whenever they are generated by code rather than by the S3 console
- D. Presigned URLs stop working once the object's last modified timestamp changes, which replication triggered
Show answer & explanation
Answer: B
A presigned URL expires at its stated time or when the credentials that signed it expire, whichever comes first; instance profile credentials are temporary and valid for roughly six hours, so a 24-hour request cannot be honoured. The 12-hour figure in option C is the S3 console ceiling, while the CLI and SDKs allow up to 7 days with long-term IAM user credentials. Object modification (D) does not invalidate a signature. A presigned URL is signed once at creation and never re-signed by the holder (A).44. A photo app lets visitors browse a limited public gallery before signing in, and signed-in users then access their own S3 prefix. How should an identity pool be configured?
- A. Assign one unauthenticated role, and elevate it with a session policy once the user completes sign-in
- B. Assign one authenticated role and one unauthenticated role, each scoped to what that class of visitor may do
- C. Assign one authenticated role, and have the app use the account's long-term keys for anonymous browsing
- D. Assign one authenticated role, and let unauthenticated visitors call S3 through a public bucket ACL instead
Show answer & explanation
Answer: B
Identity pools support both guest and authenticated identities and let you attach a separate IAM role to each, so unauthenticated visitors get a narrow scope of access that widens once they authenticate through a provider. Distributing account keys to clients (C) is a severe anti-pattern and defeats the purpose of the identity pool. Public bucket ACLs (D) expose the objects to everyone, not just app visitors. Option A discards the authenticated role that the pool is designed to assume after sign-in.45. A bucket storing millions of small objects with SSE-KMS is generating a large AWS KMS bill driven by request volume. Which change reduces KMS requests without abandoning KMS keys?
- A. Switch the bucket default encryption to SSE-C so the application supplies the key on each request
- B. Switch the bucket to a KMS key in another Region so requests are billed against the cheaper Region
- C. Enable object versioning so repeated writes of the same key reuse the data key from the prior version
- D. Enable an S3 Bucket Key on the bucket, which cuts request traffic from S3 to KMS by up to 99 percent
Show answer & explanation
Answer: D
An S3 Bucket Key has KMS generate a bucket-level key that S3 uses for a limited time to derive per-object data keys, reducing request traffic to KMS by up to 99 percent, and it also changes the encryption context to the bucket ARN. SSE-C (A) abandons KMS entirely and pushes key custody to the caller. A KMS key used with a bucket must be in the same Region as that bucket, so option B is not possible. Versioning (C) retains object history and generates more encrypted objects, not fewer key requests.46. An application uploads objects to a bucket that uses SSE-KMS with a customer managed key, and a separate reporting role downloads them. Which permissions does each principal need on the key?
- A. The uploader needs kms:Decrypt and kms:Encrypt, and the downloader needs only s3:GetObject
- B. Both principals need kms:GenerateDataKey, since S3 generates a fresh data key on every request
- C. The uploader needs kms:GenerateDataKey and the downloader needs kms:Decrypt on the key
- D. The uploader needs kms:Encrypt and the downloader needs kms:ReEncryptFrom on the key
Show answer & explanation
Answer: C
To PutObject with an SSE-KMS key you need kms:GenerateDataKey, because S3 requests a data key to encrypt the object, and to download it you need kms:Decrypt so the encrypted data key can be unwrapped. A multipart upload needs both. Option D names operations S3 does not use for this flow. Option A leaves the reader unable to decrypt, since the bucket policy alone cannot grant key use. Option B gives the downloader a permission that does not decrypt anything.47. A security standard requires key material to change every 180 days. The team plans to use automatic rotation on their symmetric customer managed key. What should they tell the auditor?
- A. Automatic rotation accepts a custom rotation period, with 365 days applying only when none is specified
- B. Automatic rotation accepts a custom period only on multi-Region keys, where replicas synchronize material
- C. Automatic rotation accepts a custom period only on keys with imported material of EXTERNAL origin
- D. Automatic rotation runs on a fixed annual schedule, so a 180-day requirement needs manual replacement keys
Show answer & explanation
Answer: A
When automatic rotation is enabled on a symmetric customer managed key you may specify a custom rotation period, and the default value of 365 days applies only if RotationPeriodInDays is omitted. The fixed annual schedule in option D is what applies to AWS managed keys, which customers cannot change. Multi-Region keys (B) support rotation as a shared property but are not a precondition for a custom period. Keys with EXTERNAL origin (C) support on-demand rotation, not automatic rotation.48. A developer generates a presigned URL for an object their role can read, then the role's read permission on that prefix is removed. What happens to links that were already handed out?
- A. They stop working only after the bucket policy is updated to add an explicit deny for that prefix
- B. They keep working until the stated expiration, because the signature captured the earlier permissions
- C. They stop working, because the URL carries the creator's permissions as evaluated when it is used
- D. They keep working for objects created before the change and fail for objects created after it
Show answer & explanation
Answer: C
A presigned URL grants exactly the access its creator has, and access is evaluated at the time the URL is used, so revoking, deleting, or deactivating the underlying credentials or permissions stops the link even though its expiration has not arrived. Option B assumes the signature freezes an authorization decision, which it does not. Object creation dates (D) play no part in the evaluation. An explicit deny (A) would certainly block the request, but removing the allow is already sufficient because IAM is deny by default.49. During a Secrets Manager rotation, an application calling GetSecretValue with no version specified keeps receiving the old credential even though a new one has been created. Which staging label explains this?
- A. The new version carries AWSPENDING, and GetSecretValue returns AWSCURRENT unless a version is named
- B. The new version carries AWSCURRENT immediately, but clients cache the old value for up to 10 minutes
- C. The new version carries AWSPREVIOUS until testSecret passes, and GetSecretValue always returns AWSCURRENT
- D. The new version carries no label until finishSecret runs, and unlabeled versions are returned last
Show answer & explanation
Answer: A
Rotation runs createSecret, setSecret, testSecret, and finishSecret; the new version is labeled AWSPENDING at creation and only becomes AWSCURRENT when finishSecret moves the label, at which point the old version becomes AWSPREVIOUS. GetSecretValue returns AWSCURRENT by default, so the old value is correct until the swap. Option C reverses the labels, option B asserts a swap that has not happened yet and a cache Secrets Manager does not impose, and option D misdescribes the labeling, since the pending version is labeled from the moment it is created.50. A build must read a database password at build time without the value ever appearing in the project's plaintext environment variables. Which buildspec construct is intended for this?
- A. An env/exported-variables entry, which passes the resolved value on to later stages of the pipeline
- B. A cache/paths entry pointing at the credentials file so it is restored rather than committed to source
- C. An env/variables entry, which CodeBuild encrypts at rest and decrypts only for the running build container
- D. An env/secrets-manager entry, which resolves a secret reference key into a local environment variable name
Show answer & explanation
Answer: D
The secrets-manager mapping takes a reference key of the form secret-id:json-key:version-stage:version-id and binds the resolved value to a local environment variable, which is the documented alternative to plaintext variables. The variables block (C) is explicitly discouraged for sensitive values because it is visible in the console and the CLI. Exported variables (A) deliberately publish values to later pipeline stages and cannot carry Secrets Manager or Parameter Store secrets at all. Caching a credentials file (B) simply stores the secret somewhere else.
Deployment
25 of 38 questions loaded51. A developer needs to make an EC2-hosted application connect to a private RDS database that lives in a different VPC within the same AWS Region, without traversing the public internet and without using a NAT gateway or VPN. Which AWS networking feature is the best fit?
- A. An interface VPC endpoint (AWS PrivateLink) for the rds.amazonaws.com API in the EC2 instance's VPC, with private DNS names enabled
- B. A gateway VPC endpoint for Amazon RDS in the EC2 subnet's route table, since gateway endpoints are free of charge
- C. An RDS read replica created in the EC2 instance's VPC, with the application pointed at the replica's endpoint
- D. VPC peering connection between the two VPCs, with route table entries directing traffic to the peered CIDR range
Show answer & explanation
Answer: D
A VPC peering connection links two VPCs with non-overlapping CIDR blocks so that instances communicate over private IP addresses across the AWS network; after both sides add routes to the peer CIDR and the RDS security group allows the instance, traffic never crosses the internet, a NAT gateway or a VPN. Option A reaches the RDS control-plane API (DescribeDBInstances and similar), not the database's TCP endpoint; PrivateLink does not connect you to a database listener in another VPC. Option B does not exist: gateway endpoints are available only for Amazon S3 and DynamoDB. Option C gives the application a read-only copy; writes would still have to reach the primary in the other VPC, which is the problem the question is asking you to solve.52. A team defines infrastructure declaratively so environments can be recreated identically. What benefit does this provide beyond automation?
- A. The infrastructure becomes immune to configuration drift, because CloudFormation rejects console or CLI changes to resources it manages
- B. The infrastructure definition becomes reviewable and version-controlled, so changes carry the same history and approval as application code
- C. The infrastructure no longer needs integration testing, because a template that passes cfn-lint is guaranteed to deploy without errors
- D. The underlying resources stop incurring charges between deployments, because a template only bills while a stack update is running
Show answer & explanation
Answer: B
Infrastructure as code turns environment changes into commits: they are diffed, peer reviewed, versioned and revertible, and a change set shows what a deployment will do before it runs. Drift is still possible when someone changes a resource outside the tooling, which is why CloudFormation offers drift detection to find and correct it. Option A overstates the control: CloudFormation does not block out-of-band changes; drift detection reports them (MODIFIED, DELETED, IN_SYNC) after the fact. Option C confuses linting with testing; cfn-lint checks template syntax and some rules, but a valid template can still fail at deploy time or produce infrastructure that does not behave as intended. Option D misunderstands billing; the resources a template creates are billed the same as resources created any other way.53. A team wants to deploy updates to an application running on Amazon ECS behind an Application Load Balancer with zero downtime, automatically running new task definitions alongside old ones and shifting traffic once health checks pass, with the ability to roll back automatically on failed health checks. Which deployment controller/service integration fits this best?
- A. AWS Direct Connect with a redundant virtual interface
- B. ECS with AWS CodeDeploy blue/green deployment integration
- C. Manually stopping all running tasks and starting new ones in a single step with no health check gating
- D. Amazon S3 static website hosting with versioned objects
Show answer & explanation
Answer: B
ECS's CodeDeploy blue/green deployment integration provisions a new (green) task set alongside the running (blue) one, uses ALB target group health checks to validate the new set, shifts traffic over, and can automatically roll back if health checks or CloudWatch alarms fail — matching every requirement described. Manually stopping and starting all tasks at once (C) causes downtime and provides no automated health-check gating or rollback. S3 static website hosting (D) serves static files and is unrelated to container orchestration or ECS deployments. Direct Connect (A) is a dedicated network link between on-premises infrastructure and AWS, entirely unrelated to application deployment strategy.54. A build pipeline produces an artifact that fails only in production. What practice most reduces this class of problem?
- A. Rebuilding from source at each environment boundary so that every environment's dependencies are resolved against its own base image
- B. Promoting the identical artifact through each environment and keeping environment differences to externalized configuration
- C. Testing only in production behind a feature flag, since it is the only environment whose configuration is certain to match
- D. Reducing the number of tests in the pipeline so builds reach production before dependency versions can drift
Show answer & explanation
Answer: B
Failures that appear only in production live in the differences between environments; promoting one immutable artifact (the same zip, container digest or CloudFormation package) through development, staging and production removes the build itself as a variable and confines every remaining difference to configuration that can be compared. Option A reintroduces the variable being eliminated; dependency resolution or toolchain versions can differ between the tested build and the deployed one. Option C removes the safety net; a feature flag limits blast radius but does not test the artifact before real users hit it. Option D trades away verification for speed and misdiagnoses the cause, which is environment difference rather than the time between build and deploy.55. A company's Lambda function needs to access resources in a private VPC subnet (such as an RDS instance with no public endpoint) but must also be able to call public AWS service endpoints like DynamoDB and S3. What must the developer configure to satisfy both requirements?
- A. Attach the Lambda function to the private VPC/subnets with an appropriate security group, and provide outbound connectivity to AWS public services via a NAT gateway or VPC endpoints
- B. Attach the Lambda function to a public subnet with an internet gateway route and auto-assign public IPv4 enabled, so its ENI receives a public address that reaches DynamoDB and S3 directly
- C. Attach the Lambda function to the private subnets and add the AWSLambdaVPCAccessExecutionRole managed policy, which grants the function's ENIs internet egress through the Lambda-managed VPC
- D. Keep the function outside the VPC and enable public accessibility on the RDS instance with a security group rule for the Lambda service's IP ranges
Show answer & explanation
Answer: A
Once a function is attached to a VPC it can reach only what that VPC can reach, so the private RDS instance is accessible but public AWS endpoints are not; the documented answer is a NAT gateway in a public subnet or, cheaper and more direct, a gateway endpoint for S3 and DynamoDB (or interface endpoints for other services), with a security group that allows the required traffic. Option B does not work: Lambda's documentation states that connecting a function to a public subnet gives it neither internet access nor a public IP address; the ENI is always private. Option C misreads the managed policy, which only lets the Lambda service create and manage the network interfaces (ec2:CreateNetworkInterface and related actions); it provides no route to the internet. Option D abandons the private-connectivity requirement by exposing the database publicly, and Lambda has no published set of IP ranges to allow in a security group.56. A CI/CD pipeline built with AWS CodePipeline needs to run unit tests and build a deployment artifact from source code before deploying it. Which AWS service is typically used as the build stage within CodePipeline to compile code and run tests?
- A. Amazon EventBridge
- B. AWS Direct Connect
- C. AWS CodeBuild
- D. AWS CodeCommit
Show answer & explanation
Answer: C
CodeBuild is a managed build service that compiles source code, runs tests, and produces deployment-ready artifacts, and it's the standard build-stage action integrated into CodePipeline. CodeCommit (D) is a managed Git source-control repository service, used for storing source code, not for building or testing it. EventBridge (A) is an event bus for routing events between AWS services and applications, not a build/test execution service. Direct Connect (B) is a dedicated network connection service between on-premises and AWS, entirely unrelated to CI/CD build processes.57. A developer discovers that a deployed function's environment variable containing a value was changed manually in the console. What is the risk?
- A. The deployed state no longer matches the declared configuration, so the next automated deployment silently reverts the change
- B. The function is marked as drifted and refuses to execute until drift detection is run and the stack is updated
- C. The change is written back to the source repository by CloudFormation, creating an unreviewed commit on the main branch
- D. There is no risk, because CloudFormation treats the console value as authoritative and updates the template to match on the next deploy
Show answer & explanation
Answer: A
An out-of-band edit creates drift between the running configuration and the declared one; the pipeline knows nothing about it, so the next deployment applies the template's value and silently undoes the change, a confusing failure because the system worked until an unrelated release. The fix is to change the declared configuration and deploy it. Option B misstates both facts: the function keeps running with the edited value, and drift detection only reports MODIFIED resources, it never blocks execution. Option C invents a write-back; CloudFormation does not modify source repositories and drift is not propagated anywhere automatically. Option D has the direction backwards: the template is the source of truth and its value overwrites the console change on the next deployment.58. An application's configuration differs between development, staging and production. What is the recommended approach?
- A. Externalizing configuration into a parameter or configuration service resolved at runtime by environment, so one artifact deploys everywhere
- B. Editing the configuration directly on each server after deployment and recording the change in a CloudTrail-backed change ticket for auditability
- C. Maintaining a Git branch per environment with its own configuration files, merging development into staging and staging into production
- D. Building one deployment artifact per environment with the values compiled in, so each build is tested against exactly the configuration it will run with
Show answer & explanation
Answer: A
Keeping environment-specific values in Systems Manager Parameter Store, AWS AppConfig or Secrets Manager and resolving them at startup means the artifact promoted to production is byte-for-byte the one that passed staging; only the configuration differs, and it can be changed and audited without a rebuild. Option D means the production binary is a different build from the one that was tested, so a dependency or toolchain difference can reach production untested. Option C lets the branches diverge over time, mixes configuration changes with code changes in every merge, and still produces a different build per environment. Option B leaves servers in states nobody can reproduce; CloudTrail records AWS API calls, not edits made over SSH, so the ticket documents intent rather than what is actually running.59. A developer wants CloudFormation to automatically undo all resource changes if a stack update fails partway through, returning the stack to its last known good state without manual intervention. Which CloudFormation behavior provides this by default?
- A. Drift detection
- B. Nested stack change sets executed in DisableRollback=true mode
- C. Automatic rollback on stack update failure
- D. Stack termination protection
Show answer & explanation
Answer: C
By default, if a CloudFormation stack update fails, CloudFormation automatically rolls back the changes to restore the stack to its last successful state, requiring no manual intervention. Stack termination protection (D) simply prevents a stack from being accidentally deleted, it has nothing to do with handling failed updates. Drift detection (A) identifies when actual resource configuration has diverged from the stack's template, it does not perform any rollback action. Explicitly setting DisableRollback=true (B) would do the opposite of what's needed — it prevents automatic rollback, leaving the stack in a partially updated/failed state for manual troubleshooting.60. A containerized application must be deployed with a new image version. What practice avoids ambiguity about what is running?
- A. Always deploying the latest tag, since ECR refuses a push that would move it to a different image digest
- B. Rebuilding the image on each host at deployment time from the same Dockerfile and base image
- C. Enabling ECR image scanning on push so that only vulnerability-free images receive the tag
- D. Referencing an immutable image tag or digest rather than a mutable tag such as latest
Show answer & explanation
Answer: D
A mutable tag such as latest can point at different content over time, so two hosts pulling the same tag may run different code and a rollback may not return to the previous state. Pinning a unique version tag or the sha256 digest (and turning on tag immutability in ECR) makes what is running unambiguous and reproducible. Option A is wrong about ECR, which lets a mutable tag move to a new digest on every push unless tag immutability is enabled on the repository; that is the ambiguity being avoided. Option B produces a different image on every host, because base image and package resolution can change between builds; nothing guarantees the hosts run identical code. Option C is a security control, not an identity control; scanning does not fix the fact that a tag can be reassigned.61. A developer must roll back a deployment quickly after a defect reaches production. What makes rollback reliable?
- A. Reverting the source commit and waiting for the pipeline to rebuild, test and redeploy the previous version
- B. Restoring the database from the most recent automated snapshot and then redeploying the current artifact
- C. Retaining the previous artifact version and ensuring database changes are backward compatible with it
- D. Editing the deployed code on each instance by hand, since a hotfix is faster than any redeployment
Show answer & explanation
Answer: C
Rollback is only quick if the previous artifact is still available to redeploy (a kept Lambda version, container digest or S3 object) and only safe if the schema migration that shipped with the release still works with the old code, which is why expand-and-contract migrations are the enabling practice. Option A is the slow path at exactly the moment speed matters most; a rebuild and full pipeline run can take far longer than redeploying a retained artifact. Option B throws away every transaction since the snapshot and keeps the defective code running; it is data loss, not rollback. Option D produces inconsistent servers with no record of what runs where, and the next automated deployment overwrites the edits.62. A team wants their CodePipeline deployment to automatically pause and require a manual approval action before the production deployment stage runs, so a release manager can review changes first. How can this be configured?
- A. Disable the inbound transition into the production stage and have the release manager re-enable it after reviewing each change
- B. Insert a CodeBuild action that polls an SNS topic and fails until an approval message is published
- C. Configure an EventBridge rule on the pipeline's Stage Execution State Change event to call StopPipelineExecution before production
- D. Add a manual approval action to the pipeline stage immediately before the production deployment stage
Show answer & explanation
Answer: D
A manual approval action is a built-in CodePipeline action type: the execution stops at the action, optionally publishes an SNS notification with a review URL and comments, and resumes when someone with codepipeline:PutApprovalResult approves; if nobody responds within seven days the action fails. Option A is a coarse on/off switch for the whole stage rather than a per-execution approval: once re-enabled it lets every queued and subsequent revision through, and it records no approver, comment or timeout. Option B burns build minutes polling and gives the release manager nothing to review in the console; it is a fragile imitation of a feature CodePipeline already provides. Option C stops the execution outside the pipeline's own control flow; a stopped execution does not resume with an approval, and no review link or approver record is produced.63. A team is deploying a new version of a Lambda-backed API and wants to gradually shift a small percentage of production traffic to the new version, monitoring error rates before shifting all traffic, with automatic rollback if CloudWatch alarms trigger. Which AWS deployment approach fits this best?
- A. AWS Elastic Beanstalk traffic-splitting deployments applied to the Lambda function, sending 10 percent of sessions to the new version for 5 minutes
- B. AWS CodeDeploy with a Lambda deployment configuration using canary or linear traffic shifting and CloudWatch alarm rollback
- C. An Amazon API Gateway canary release on the stage, pointing the canary at the function's $LATEST version and promoting it when the stage's 5XX alarm stays OK
- D. A Lambda alias with weighted routing between two versions, updated by hand from 10 to 100 percent after the team reviews the Errors metric
Show answer & explanation
Answer: B
CodeDeploy's Lambda compute platform shifts alias traffic with predefined canary (for example Canary10Percent5Minutes) or linear (Linear10PercentEvery1Minute) configurations, runs optional pre- and post-traffic hooks, and rolls back automatically when a CloudWatch alarm attached to the deployment group fires; AWS SAM exposes the same mechanism through DeploymentPreference. Option A applies only to Elastic Beanstalk EC2 environments behind an Application Load Balancer; Elastic Beanstalk does not deploy Lambda functions. Option C shifts traffic between API Gateway stage deployments, not between Lambda versions, and API Gateway has no automatic rollback tied to an alarm; $LATEST is also the unpublished version, which should not receive canary traffic. Option D is manual: someone has to watch the metric and move the weights, and nothing rolls the alias back automatically when errors rise.64. A team uses AWS Elastic Beanstalk to host a web application and needs zero-downtime deployments where a full new set of instances is provisioned, verified healthy, and then production traffic is switched over — allowing an immediate rollback by switching back if problems are found. Which Elastic Beanstalk deployment policy matches this description?
- A. Blue/green using a swap of environment URLs (CNAME swap) between a new and existing environment
- B. Immutable, which launches a full set of new instances in a second Auto Scaling group inside the same environment before terminating the old ones
- C. Rolling with additional batch, which launches one extra batch of new instances first so that capacity never drops while each batch is updated in place
- D. Traffic splitting, which sends a configured percentage of new client sessions to a temporary Auto Scaling group for an evaluation period
Show answer & explanation
Answer: A
Blue/green in Elastic Beanstalk means deploying the new version to a separate environment, testing it, and then choosing Swap environment URLs so the CNAME records of the two environments are exchanged; traffic moves instantly and swapping back is the rollback, which is the only option that keeps two independently addressable environments. Option B does provision a fresh fleet, but inside the existing environment with a single URL; there is no second environment to swap back to, and rollback means another deployment. Option C updates the existing instances batch by batch in place; it maintains capacity during the update but never provisions a complete parallel set of instances. Option D is Elastic Beanstalk's canary test within one environment (it requires an Application Load Balancer); traffic is split gradually rather than switched, and there is no URL swap.65. A deployment must shift traffic gradually to a new version and roll back automatically if error rates rise. Which deployment strategy is this?
- A. In-place deployment with the CodeDeployDefault.OneAtATime configuration and a manual rollback command
- B. Blue/green with an all-at-once traffic reroute after a 5-minute wait on the new fleet
- C. Canary or linear traffic shifting with automated rollback triggered by alarm state
- D. Immutable deployment recreating the whole environment from scratch each release
Show answer & explanation
Answer: C
Canary (a small first increment, then the rest after an interval) and linear (equal increments at fixed intervals) traffic shifting expose only part of the traffic to the new version while metrics are watched, and CodeDeploy rolls back automatically when an alarm attached to the deployment fires; blue/green switches everything at once and offers fast rollback without gradual exposure. Option A updates instances one by one in place with no traffic percentage control, and rollback depends on a human noticing and acting. Option B provisions a parallel fleet but moves 100 percent of traffic in one step after the wait; it is not gradual and the rollback described is manual. Option D replaces the fleet but says nothing about shifting traffic in steps or rolling back on an alarm, which are the two properties the question asks for.66. A developer wants to define their application's AWS resources — a Lambda function, an API Gateway API, and a DynamoDB table — as code, and deploy them together as a single versioned unit that can be repeatedly and consistently redeployed across environments. Which AWS service is designed for this?
- A. AWS Systems Manager Automation runbooks with approval steps
- B. AWS Elastic Beanstalk saved configurations per environment
- C. AWS Config conformance packs applied to each account
- D. AWS CloudFormation (or the AWS SAM framework built on top of it)
Show answer & explanation
Answer: D
CloudFormation provisions a set of related resources from a template as one stack that can be versioned, diffed with change sets, updated and rolled back; AWS SAM adds serverless resource types (AWS::Serverless::Function, Api, SimpleTable) that transform into CloudFormation, so a Lambda function, API and DynamoDB table deploy together as one unit. Option A runs procedural steps against existing resources with an approval workflow; it is not a declarative, versioned definition of a stack of resources. Option B captures the settings of an Elastic Beanstalk environment (instances, load balancer, platform) and cannot define a Lambda function, an API Gateway API or a DynamoDB table. Option C packages AWS Config rules that evaluate whether resources comply with policy after they exist; conformance packs do not create application resources.67. A buildspec pulls a value with env/parameter-store, and the build fails immediately with an access denied error from Systems Manager. What is the fix?
- A. Add the ssm:GetParameters action to the buildspec's env/variables block as an inline permission
- B. Move the reference from env/parameter-store to env/exported-variables, which resolves at build start
- C. Convert the parameter to the advanced tier, because the standard tier is unavailable to build projects
- D. Add the ssm:GetParameters action to the CodeBuild service role for the parameter in question
Show answer & explanation
Answer: D
To let CodeBuild retrieve custom environment variables stored in Parameter Store you must add the ssm:GetParameters action to the CodeBuild service role. Permissions live in IAM, not in a buildspec variables block (A). Exported variables (B) publish values to later pipeline stages and cannot fetch a parameter, and they cannot carry Parameter Store secrets at all. Parameter tiers (C) control size, count, and policies, and standard parameters are perfectly usable from a build.68. A team adds an ApplicationStop script that gracefully shuts down their service. On the very first deployment to a new instance the script does not run, and on the second it does. What explains this?
- A. ApplicationStop runs only in blue/green deployments on original instances, never on replacement instances
- B. ApplicationStop uses the AppSpec file from the previous successful revision, which does not yet exist
- C. ApplicationStop is reserved for the CodeDeploy agent and cannot run customer scripts on any deployment
- D. ApplicationStop runs only after DownloadBundle, so a first deployment skips it while the bundle is fetched
Show answer & explanation
Answer: B
ApplicationStop occurs before the new revision is downloaded and uses the AppSpec file and scripts from the last successfully deployed revision, so on a brand-new instance there is nothing to run and the hook is skipped. The hooks reserved for the agent are DownloadBundle, Install, BlockTraffic, and AllowTraffic, not ApplicationStop (C). ApplicationStop runs before DownloadBundle, not after (D). It does run on blue/green replacement instances, which contradicts option A.69. A deployment group for EC2 instances is created without naming a deployment configuration. How will CodeDeploy roll the revision out across the nine instances in the group?
- A. To four instances at a time, because CodeDeployDefault.HalfAtATime is the default configuration
- B. To one instance per Availability Zone at a time, because zonal configuration is applied by default
- C. To all nine instances at once, because CodeDeployDefault.AllAtOnce is the default configuration
- D. To one instance at a time, because CodeDeployDefault.OneAtATime is the default configuration
Show answer & explanation
Answer: D
When no deployment configuration is specified, CodeDeploy uses CodeDeployDefault.OneAtATime, which deploys to a single instance at a time and fails as soon as any but the last instance fails. AllAtOnce (C) and HalfAtATime (A) are the other predefined choices but must be selected deliberately. Option B describes the zonal configuration feature, which has no predefined configuration at all and requires creating a custom one.70. A release manager selects CodeDeployDefault.LambdaCanary10Percent15Minutes for a Lambda deployment. What traffic pattern should the team expect during the deployment window?
- A. 10 percent of traffic shifts immediately, and the remaining 90 percent shifts 15 minutes later
- B. 10 percent of traffic shifts every 15 minutes until all traffic reaches the new function version
- C. 15 percent of traffic shifts immediately, and the rest shifts in 10 percent increments each minute
- D. 10 percent of traffic shifts immediately and holds for 15 minutes before rolling back automatically
Show answer & explanation
Answer: A
A canary configuration shifts traffic in exactly two increments: 10 percent first, then the remaining 90 percent after the named interval, here 15 minutes. Option B describes a linear configuration such as LambdaLinear10PercentEvery3Minutes, which moves 10 percent at each interval until everything has shifted. Option C garbles both numbers. Rollback (D) is not automatic at the end of a canary; it happens only when a CloudWatch alarm or a validation hook fails.71. A CodeBuild project must authenticate to Amazon ECR before compiling and then push the image afterwards. Where do those two commands belong in a version 0.2 buildspec?
- A. Sign in during the finally block of install so the credentials survive a failed dependency step
- B. Sign in during install and push during build, leaving post_build for notifications only
- C. Sign in during pre_build and push during post_build, with compilation in the build phase
- D. Sign in during pre_build and push during the artifacts block, which uploads the image for you
Show answer & explanation
Answer: C
AWS documents pre_build as the phase for actions such as signing in to Amazon ECR or installing npm dependencies, and post_build as the phase for packaging and pushing an image. The install phase (B) is recommended only for installing packages into the build environment. The artifacts block (D) uploads files to the S3 output location and cannot push a container image. A finally block (A) runs after the commands of its own phase, including on failure, and is not where a login belongs.72. A build produces target/app.jar plus a nested reports directory, but the uploaded artifact preserves the full directory tree and the deploy step cannot find the jar. Which settings flatten the output?
- A. Set reports/base-directory to target and reports/discard-paths to yes in the buildspec
- B. Set artifacts/base-directory to target and artifacts/discard-paths to yes in the buildspec
- C. Set artifacts/name to target and artifacts/s3-prefix to yes so paths collapse at upload time
- D. Set artifacts/exclude-paths to target and cache/paths to the reports directory in the buildspec
Show answer & explanation
Answer: B
base-directory tells CodeBuild which top-level directory to resolve file patterns against, and discard-paths set to yes places every matched file directly in the output rather than preserving its directory structure. Option C misuses name, which labels the artifact, and s3-prefix, which takes a prefix string rather than a boolean. exclude-paths and cache paths (D) remove files from the artifact and persist directories between builds respectively. The reports block (A) governs test report files, not build artifacts.73. A SAM template declares a function with DeploymentPreference of type Linear10PercentEvery2Minutes but the deployment fails because there is no alias to shift traffic against. Which property is missing?
- A. AutoPublishAlias, which publishes a new version on each code change and points the named alias at it
- B. ProvisionedConcurrencyConfig, which must be declared before CodeDeploy can shift weighted traffic
- C. ReservedConcurrentExecutions, which CodeDeploy uses to hold capacity for the outgoing version
- D. VersionDescription, which SAM uses to name the immutable version that traffic is shifted toward
Show answer & explanation
Answer: A
AutoPublishAlias detects code changes, publishes a new version, and creates or updates the named alias, giving CodeDeploy the alias it needs for weighted shifting. Provisioned concurrency (B) reduces cold starts and is never a precondition for a gradual deployment. Reserved concurrency (C) caps scaling and plays no part in traffic shifting. VersionDescription (D) is metadata on the published version and does not create the alias.74. A brand-new serverless application is deployed for the first time with a SAM DeploymentPreference already configured, and CodeDeploy reports it has nothing to shift traffic from. What is the recommended approach?
- A. Deploy once into a separate stack, then import the published version into the original stack
- B. Deploy once with AutoPublishAlias only, then add DeploymentPreference on the second deployment
- C. Deploy once with DeploymentPreference set to AllAtOnce, then switch to a canary configuration later
- D. Deploy once with the Alarms property removed, since alarms block the first gradual deployment
Show answer & explanation
Answer: B
CodeDeploy requires a previously deployed function version to shift traffic away from, so AWS documents a two-step first release: deploy with AutoPublishAlias to establish the alias and an initial version, then add DeploymentPreference. Option C still performs a CodeDeploy deployment on the first pass and does not create the missing prior version cleanly. Alarms (D) trigger rollback and are not what blocks the first release. A second stack and resource import (A) is unnecessary complexity.75. An ECS blue/green deployment routes a test listener to the replacement task set so integration tests can run before customers are moved. Which hook runs after the test listener is serving traffic?
- A. ValidateService, which is the last hook in the deployment and confirms the release succeeded
- B. AfterInstall, which runs once the replacement task set is created and associated with a target group
- C. AfterAllowTestTraffic, which runs after the test listener serves traffic to the replacement task set
- D. BeforeAllowTraffic, which runs after the second target group is associated but before the traffic shift
Show answer & explanation
Answer: C
AfterAllowTestTraffic runs once the test listener is serving the replacement task set, and a failure there can trigger a rollback, which is exactly the validation window described. AfterInstall (B) fires earlier, when the replacement task set exists but no test traffic has flowed. BeforeAllowTraffic (D) fires later, after the second target group is associated but before production traffic shifts. ValidateService (A) is an EC2 and on-premises hook and does not exist in an ECS deployment.
Troubleshooting and Optimization
25 of 29 questions loaded76. A developer is debugging a distributed serverless application spanning API Gateway, Lambda, and DynamoDB, and wants a single view showing the full request path with latency at each hop to identify which component is the bottleneck. Which combination of instrumentation is most appropriate?
- A. Enable API Gateway execution logging at INFO with full request data and correlate $context.requestId with the Lambda REPORT line and DynamoDB CloudTrail data events
- B. Enable CloudWatch Lambda Insights and Contributor Insights for DynamoDB, which together render the API Gateway to Lambda to DynamoDB path with per-hop latency
- C. Enable VPC Flow Logs on the subnets used by the Lambda function and query the packet timestamps between the API Gateway, Lambda and DynamoDB endpoints
- D. Enable AWS X-Ray active tracing on API Gateway and Lambda, and ensure the DynamoDB SDK calls are instrumented so they appear as subsegments in the trace
Show answer & explanation
Answer: D
X-Ray builds one trace per request: API Gateway with active tracing emits the first segment and propagates the X-Amzn-Trace-Id header, the Lambda service and function add their segments, and an instrumented DynamoDB client records a subsegment for each call, so the trace timeline and service map show the latency of every hop side by side. Option A requires stitching three different log sources together by hand and still yields no per-hop timing; CloudTrail data events record that a DynamoDB call happened, not how long it took. Option B misdescribes both features: Lambda Insights reports CPU, memory and network for the function, and Contributor Insights shows the most accessed keys in a table; neither draws a request path. Option C captures IP-level flow metadata for traffic in your VPC; API Gateway and the DynamoDB service endpoint are not in that path, and flow logs never show application request latency.77. A serverless application's Lambda function occasionally times out when calling a downstream third-party HTTP API. The developer wants to understand exactly how much time is spent in the Lambda function's own code versus waiting on the external HTTP call, across many invocations. Which AWS service is best suited to visualize this breakdown?
- A. CloudWatch Lambda Insights, which reports CPU, memory and network use per invocation
- B. Logs Insights queries over the REPORT line's Duration and Billed Duration fields
- C. AWS CloudTrail Lake queries joining the Lambda Invoke event with the third-party API's HTTP calls made during the invocation
- D. AWS X-Ray with the X-Ray SDK instrumenting the outbound HTTP call as a subsegment
Show answer & explanation
Answer: D
With active tracing on the function and the X-Ray SDK wrapping the outbound HTTP client, each trace shows the function segment with a subsegment for the downstream call, so the time inside the handler and the time waiting on the third-party API are separated per request and aggregated on the service map. Option A gives resource-level metrics (CPU, memory, network) per invocation; it does not attribute wall-clock time to an individual outbound call. Option B shows only the total duration of each invocation; the REPORT line has no breakdown of where inside the invocation the time went. Option C records AWS API activity, not HTTP calls to a third-party endpoint, and carries no latency data for them.78. A NoSQL query returns fewer items than expected along with a pagination token. What does this mean?
- A. The result set exceeded the response size limit, and the caller must issue further requests using the token to retrieve remaining items
- B. The table's provisioned read capacity was exhausted midway, and the token lets the caller resume once the 1-minute throttling window has passed
- C. The items after the token are stored in a global secondary index, and the caller must repeat the query against that index to retrieve them
- D. The query's FilterExpression removed the remaining items, and the token confirms that no further matching data exists in the table
Show answer & explanation
Answer: A
Query and Scan return at most 1 MB of data per call (or the number set by Limit) and include LastEvaluatedKey when they stopped at a page boundary; the caller passes it as ExclusiveStartKey until a response has no LastEvaluatedKey. Treating the first page as the whole result silently drops data as the table grows. Option B confuses pagination with throttling; exceeding capacity raises ProvisionedThroughputExceededException, and pagination tokens are returned on successful reads. Option C invents a storage split; a table's items are not moved to an index, and a query returns items from whatever table or index it was issued against. Option D gets the token's meaning backwards: because the filter is applied after the 1 MB read, a page can even return zero items and still carry a LastEvaluatedKey, which means keep paging.79. A Lambda function that queries an RDS database is experiencing intermittent 'too many connections' errors under moderate concurrent load, even though the function's own logic is correct. What is the most likely root cause and appropriate fix?
- A. Each concurrent Lambda execution environment opens its own database connection, and without a connection pooler such as RDS Proxy the number of concurrent connections can exceed the database's connection limit
- B. The function's execution role lacks the rds-db:connect permission needed for IAM database authentication, so the database rejects each new session with 'too many connections' until the policy is corrected
- C. Lambda is reusing one frozen connection across all concurrent invocations, so the database sees a single client holding every slot; setting reserved concurrency to 1 releases the extra connections
- D. The database's max_connections parameter is being consumed by RDS Performance Insights and Enhanced Monitoring agents; disabling both features frees the connection slots the function needs
Show answer & explanation
Answer: A
Lambda scales by adding execution environments, and each one that initializes a database client holds its own connection, so a burst of concurrency can open more connections than the instance class allows. RDS Proxy pools and multiplexes those connections in front of the database, which is the recommended fix for serverless clients. Option B would produce an authentication or access-denied error, not 'too many connections'; a missing IAM permission never consumes a connection slot. Option C describes the opposite of how Lambda works: environments never share a connection, and throttling the function to a single environment would cripple the application rather than fix the root cause. Option D blames monitoring features that do not hold client connections; the connections are coming from the many concurrent function environments.80. A developer needs to fetch a specific set of attributes from many items with known keys in one round trip. Which operation is appropriate?
- A. A parallel Scan with a FilterExpression on the key attribute and TotalSegments set equal to the number of items wanted
- B. A batch get operation retrieving multiple items by key, with a projection limiting the attributes returned
- C. A TransactGetItems call, which retrieves up to 100 items and costs one read capacity unit per item, the same as a batch get
- D. A Query against a global secondary index for each key, issued in parallel and merged in the application code
Show answer & explanation
Answer: B
BatchGetItem fetches up to 100 items (16 MB) by primary key in one request, retrieving them in parallel, and a ProjectionExpression returns only the attributes you name; any keys returned in UnprocessedKeys are retried with backoff. Option A reads and pays for the entire table before filtering, so its cost grows with table size regardless of how few items match; a scan is the most expensive way to answer a key-based lookup. Option C does retrieve up to 100 items, but it is the wrong tool and the cost claim is false: transactions perform two underlying reads per item, and they exist for a consistent snapshot, not for bulk retrieval. Option D issues one request per key and requires an index that is unnecessary when the primary keys are already known.81. A developer must distinguish between a 4xx and a 5xx response from a service API. What does each indicate about retry behavior?
- A. 4xx indicates the request was accepted but is still processing and should be polled again, while 5xx indicates a permanent outage that must never be retried
- B. 4xx indicates a signing or clock-skew failure that the SDK repairs by refreshing credentials, while 5xx indicates the caller's payload exceeded a size quota
- C. 4xx generally indicates a client-side problem that retrying will not fix, except throttling, while 5xx indicates a server-side condition that is often worth retrying
- D. Both classes are retried identically by the SDK's standard mode, which makes 3 attempts with a 20-second backoff cap regardless of whether the error is 4xx or 5xx
Show answer & explanation
Answer: C
The SDKs classify errors by code: validation, access-denied and not-found errors (4xx) are returned immediately because retrying cannot fix the request, throttling errors (also 4xx) are retried with a longer backoff, and 500, 502, 503 and 504 responses are treated as transient and retried; retry logic must therefore inspect the error code, not just the status class. Option A misdescribes both classes: 4xx means the request itself was rejected, and 5xx errors are the ones most often transient and worth retrying. Option B invents meanings; a signature or clock-skew problem is one specific 4xx cause among many, and an oversized payload is reported as a 4xx validation error, not a 5xx. Option D is wrong about the SDK, which returns non-retryable 4xx errors such as ValidationException immediately and applies the 3-attempt backoff only to transient and throttling errors.82. An application's Lambda function frequently receives a 'Rate Exceeded' throttling error when calling a downstream AWS service API directly via the SDK. What is the recommended coding pattern to handle this gracefully instead of failing immediately?
- A. Set AWS_MAX_ATTEMPTS to 1 and AWS_RETRY_MODE to legacy so the SDK returns the throttling error immediately to the caller
- B. Retry the call at a fixed 50 ms interval up to 20 times, since the SDK's standard retry mode already adds the required jitter on the caller's behalf
- C. Raise the function's reserved concurrency so more execution environments spread the calls across the service
- D. Implement exponential backoff with jitter when retrying the throttled API call, ideally using the SDK's built-in retry configuration
Show answer & explanation
Answer: D
Throttling means the service is asking the caller to slow down. Exponential backoff with full jitter spreads retries over a widening random window (the SDK's standard mode makes 3 attempts by default, with a 1,000 ms base delay for throttling errors and a 20-second cap), which lets the service recover instead of being hit by synchronized retries. Option A turns retries off entirely, so every throttled call fails on the first attempt, and legacy mode exists only for backward compatibility. Option B is a tight fixed-interval loop that ignores backoff and misreads standard mode: the SDK's jitter applies to the SDK's own retries, not to a loop the application writes around them. Option C adds callers, which increases the request rate against a service that is already rejecting requests; the downstream quota is independent of the function's concurrency.83. A developer adds structured logging to a service. What advantage does structured output have over free-text log lines?
- A. Fields can be queried, filtered and aggregated directly, rather than requiring pattern matching against arbitrary text
- B. Structured entries are stored in the Infrequent Access log class automatically, cutting the ingestion cost by half for every function
- C. Structured entries are compressed before ingestion, so CloudWatch Logs bills them at a lower per-gigabyte rate than free-text lines
- D. Structured entries are exempt from the 256 KB event size limit and from the retention setting until they are queried
Show answer & explanation
Answer: A
Emitting JSON fields lets CloudWatch Logs Insights discover the fields and filter, aggregate and chart on them (for example, stats avg(duration) by route), and lets metric filters match on field values, without regular expressions that break whenever a message is reworded; the trade-off is more bytes per entry, not fewer. Option B confuses format with storage class; the log class is chosen when the log group is created and cannot be changed, and it is unrelated to how entries are formatted. Option C invents a pricing rule; ingestion is billed per gigabyte regardless of format, and JSON entries are usually larger than the equivalent sentence. Option D invents exemptions; the 256 KB event limit and the retention policy apply to every event in the log group.84. A developer instruments an application with distributed tracing. What does it provide that logs alone do not?
- A. A per-minute count of requests, errors and throttles for each service, aggregated into CloudWatch metrics with 15-month retention
- B. A record of every AWS API call made by each service's role, including caller identity and source IP, retained for 90 days
- C. A line-by-line profile of CPU time inside the handler code, sampled every 10 ms and attributed to the source file and function
- D. A connected view of a single request's path across services with timing at each segment, revealing where latency accumulates
Show answer & explanation
Answer: D
A trace collects the segments and subsegments that one request generated across services and shows them on a timeline, so you can see which downstream call accounts for the latency; logs scattered across services cannot reconstruct that path without a shared correlation ID and manual joining. Option A describes metrics: they show how many requests were slow or failed per service, not the path of one request or where inside it the time went. Option B describes CloudTrail event history; it is an audit record of control-plane and some data-plane calls and carries no request latency. Option C describes a code profiler, which shows where CPU time goes inside one process; it cannot follow a request into another service.85. A function's memory allocation is increased and its execution time falls. Why does this occur?
- A. Higher memory settings move the function onto Graviton processors, which finish the same code faster at a lower per-millisecond price than x86
- B. CPU and other resources are allocated proportionally to memory, so raising memory can shorten duration and sometimes reduce total cost
- C. Higher memory settings extend the execution environment's lifetime, so more invocations land on a warm environment and skip the Init phase
- D. Higher memory settings raise the ephemeral /tmp allocation, so the function spends less time evicting cached files
Show answer & explanation
Answer: B
Lambda allocates CPU in proportion to memory (a function reaches one full vCPU at 1,769 MB), so a CPU-bound function runs faster with more memory, and because billing is memory multiplied by duration the shorter run can cost the same or less; the optimum is found by measuring, for example with the Lambda Power Tuning tool. Option A confuses two independent settings; the architecture (x86_64 or arm64) is chosen separately from memory, and memory never moves a function between processor types. Option C invents a relationship; how long Lambda keeps an idle environment is not controlled by the memory setting, and a warm start does not shorten the handler's own work. Option D is wrong because /tmp size is configured independently (512 MB to 10,240 MB) and has nothing to do with how fast the handler's code executes.86. A Lambda function that processes DynamoDB Streams records is falling behind, and CloudWatch shows the IteratorAge metric steadily increasing. What does a rising IteratorAge most directly indicate, and what is a reasonable first remediation step?
- A. Records are expiring from the stream's 24-hour retention window before the function reads them; enabling point-in-time recovery on the table extends the window to 35 days
- B. The consumer Lambda function is not processing records as fast as they arrive; increasing the function's concurrency or batch processing efficiency is a reasonable first step
- C. The function's batch reads are being throttled against the table's provisioned read capacity; lowering BatchSize to 1 and adding read capacity units to the table will clear the backlog
- D. The event source mapping's shard iterator has expired because it was created with the LATEST starting position; deleting and re-creating the mapping with TRIM_HORIZON resets the metric
Show answer & explanation
Answer: B
IteratorAge is the age of the last record in a batch when Lambda reads it, so a steadily rising value means records are being written faster than the consumer drains them. Raising ParallelizationFactor (1 to 10 concurrent batches per shard, still ordered per item), making each batch cheaper to process, or filtering unneeded events are the documented first responses. Option A confuses two features: DynamoDB Streams records do live for 24 hours, but point-in-time recovery is a backup feature for the table and has no effect on stream retention or on the consumer's lag. Option C is wrong because reading a DynamoDB stream does not consume the table's read capacity units, and a batch size of 1 makes the function process fewer records per invocation, so the lag grows. Option D would make the metric worse, not better: re-creating the mapping at TRIM_HORIZON re-reads the oldest retained records, and the starting position has nothing to do with sustained lag.87. A developer notices that a Lambda function has high p99 latency only on the first invocation after periods of inactivity, but subsequent invocations are fast. What AWS Lambda concept explains this pattern, and what is a common way to mitigate it for latency-sensitive workloads?
- A. Execution environment recycling every few hours; raising the function timeout to its 15-minute maximum keeps the environment alive between invocations
- B. Cold starts caused by new execution environment initialization; provisioned concurrency can keep initialized environments warm and ready
- C. Lambda's concurrency scaling rate of 1,000 environments every 10 seconds; setting reserved concurrency to 1 pins a single environment in place
- D. ENI creation for VPC-attached functions on each invocation; moving the function to a public subnet gives it a persistent network interface
Show answer & explanation
Answer: B
The first request after idle time lands on a new execution environment, so Lambda must download the code, start the runtime and run the initialization code before the handler; that Init phase is the cold start. Provisioned concurrency keeps a configured number of environments initialized, so those requests skip the cold start (SnapStart is an alternative for Java, Python and .NET). Option A confuses the invocation timeout with environment lifetime; the timeout bounds one invocation and has no effect on how long an idle environment is kept. Option C misapplies two concurrency controls: the scaling rate governs bursts, and reserved concurrency caps how many environments may run without keeping any of them warm. Option D is outdated and wrong: Hyperplane ENIs are created when the VPC configuration is saved and shared by environments, and a public subnet gives a Lambda function neither a public IP nor faster starts.88. A function's execution duration is close to its configured timeout and occasionally exceeds it. What should be evaluated first?
- A. Whether the function's memory is below 1,769 MB, since a function with less than one full vCPU cannot finish inside a 15-minute timeout
- B. Whether the function's execution role has too many attached policies, since IAM policy evaluation time counts toward the timeout
- C. Whether a downstream call lacks its own timeout, since an unbounded dependency can consume the entire execution budget
- D. Whether the deployment package exceeds 50 MB zipped, since Lambda re-downloads oversized packages on every invocation
Show answer & explanation
Answer: C
A dependency call without a client-side timeout can hang until the function itself is killed, which turns a slow downstream call into a hard failure with no useful error. Setting the SDK or HTTP client timeout below the function timeout lets the code catch the failure, retry or degrade, and return something meaningful. Option A misuses a real number: 1,769 MB is where a function gets one full vCPU, but smaller functions finish fine; memory affects speed, not the ability to complete. Option B invents an overhead; IAM authorization happens before the invocation starts and does not consume the function's execution time. Option D is wrong twice: 50 MB is the limit for direct upload, not a performance threshold, and code is downloaded once per execution environment, not per invocation.89. An incident review needs one-minute resolution CloudWatch metrics from three weeks ago, and the console returns only coarser data. What retention behaviour explains this?
- A. One-minute data is kept for 3 hours, after which it is aggregated to 1-minute points for 15 months
- B. One-minute data is kept for 15 days only when detailed monitoring is enabled on the source resource
- C. One-minute data is kept for 15 days, after which it is aggregated and retrievable only at 5-minute resolution
- D. One-minute data is kept for 63 days, after which it is aggregated and retrievable only at 1-hour resolution
Show answer & explanation
Answer: C
CloudWatch keeps 60-second data points for 15 days, 300-second points for 63 days, and 3,600-second points for 455 days, aggregating shorter periods into longer ones as they age, so three-week-old data is available at five-minute resolution. Option D assigns the 63-day figure to the wrong period. The three-hour window in option A belongs to sub-minute high-resolution custom metrics. Detailed monitoring (B) determines whether a service publishes at one-minute intervals but does not change retention.90. Application logs in CloudWatch Logs must be streamed in near real time to a Lambda function for enrichment. What should the developer expect from a subscription filter?
- A. The payload arrives as plain JSON log events, since compression applies only to Firehose destinations
- B. The payload arrives base64 encoded only, since gzip is applied when the destination is Kinesis
- C. The payload arrives as a presigned S3 URL that the function must fetch to read the batch of events
- D. The payload arrives base64 encoded and gzip compressed, so the function must decode and decompress it
Show answer & explanation
Answer: D
Logs sent to a subscription destination are base64 encoded and compressed with gzip, which is why the documented Lambda example gunzips the buffer before parsing; the supported destinations are Kinesis Data Streams, Firehose, Lambda, and OpenSearch Service. Options A and B invent destination-specific encodings that the documentation does not make. Option C describes a pull model that subscription filters do not use, since events are pushed to the destination.91. A latency-sensitive function has 50 units of provisioned concurrency. During peaks, some requests still show initialization latency. Which metric confirms that traffic is exceeding the provisioned pool?
- A. ClaimedAccountConcurrency, which reports concurrency unavailable for on-demand invocations in the Region
- B. ProvisionedConcurrencyUtilization, which reports the share of the allocation currently in use
- C. ProvisionedConcurrencySpilloverInvocations, which counts invocations served by standard concurrency
- D. ProvisionedConcurrencyInvocations, which counts invocations served by pre-initialized environments
Show answer & explanation
Answer: C
Spillover invocations are those served by standard concurrency because all provisioned environments were busy, so a non-zero value is direct evidence of overflow and its attendant cold starts. Utilization (B) approaches 1 as the pool fills but does not prove it was exceeded, and Lambda stops emitting it when the function is idle. ProvisionedConcurrencyInvocations (D) counts the requests that did use the warm pool. ClaimedAccountConcurrency (A) is a Region-wide figure that says nothing about one function's peaks.92. An X-Ray service map shows a node with a high fault rate but a low error rate. What kind of responses is that node returning?
- A. Mostly 429 responses, which X-Ray classifies as faults separately from other server-side failures
- B. Mostly timeouts, which X-Ray classifies as faults while every HTTP status is counted as an error
- C. Mostly 5xx responses, which X-Ray classifies as faults, while 4xx responses are counted as errors
- D. Mostly 4xx responses, which X-Ray classifies as faults because the caller supplied a bad request
Show answer & explanation
Answer: C
X-Ray classifies 400-series responses as errors, 500-series responses as faults, and 429 Too Many Requests as throttles, so a high fault rate with few errors points at server-side failures rather than malformed requests. Option D swaps the two categories. Option A assigns 429 to the fault bucket even though throttling has its own classification. Option B collapses every status into errors, which would leave the fault metric meaningless.93. A batch job repeatedly calls one DynamoDB table from a single client and receives frequent throttling responses, and the team can tolerate added latency. Which SDK retry mode is designed for this case?
- A. Adaptive mode, which adds a client-side rate limiter that can delay even the initial request
- B. Legacy mode, which is standardized across SDKs and applies error-type-specific backoff timing
- C. Adaptive mode, which is the general default and is recommended whenever a client serves many tenants
- D. Standard mode, which retries with exponential backoff and jitter and never delays the first attempt
Show answer & explanation
Answer: A
Adaptive mode includes everything in standard mode plus a client-side rate limiter that tracks throttling responses and can delay or block the initial request, and AWS recommends it precisely for a single-resource, throttling-heavy, latency-tolerant workload. Standard mode (D) is the sensible default but never throttles the first attempt itself. Legacy mode (B) is the opposite of standardized and varies by SDK. Option C contradicts the guidance: adaptive is not the general default and is discouraged for multi-tenant clients, where one resource's throttling would slow every request.94. A metric filter is created on a log group to count occurrences of a specific error string, and the resulting metric shows nothing for errors logged earlier that day. Why?
- A. Metric filters publish data points only when a default value of zero is configured on the filter
- B. Metric filters publish data points only after the log group is subscribed to a delivery destination
- C. Metric filters publish data points only for events that arrive after the filter is created
- D. Metric filters publish data points for the retention period of the log group once they are created
Show answer & explanation
Answer: C
Filters do not retroactively filter data; they publish metric data points only for events that occur after the filter was created, which is why a backfill requires Logs Insights instead. Option D assumes retroactive evaluation over the retention window. A default value (A) makes the metric report zero during periods with no matches, avoiding gaps, but it does not reach back in time. Subscription filters (B) stream events to a destination and are a separate feature from metric filters.95. An asynchronously invoked Lambda function shows a rising AsyncEventAge metric and a growing gap between AsyncEventsReceived and Invocations. What do these two signals together indicate?
- A. Events are queued but not yet invoked, so the next step is to inspect the Errors and Throttles metrics
- B. Events are being delivered twice, so the next step is to make the handler idempotent before retrying
- C. Events are exceeding the 6 MB synchronous payload quota, so the next step is to shrink the event body
- D. Events are being filtered out by the event source mapping, so the next step is to widen the filter criteria
Show answer & explanation
Answer: A
AsyncEventAge measures the time between Lambda queueing an event and invoking the function, and it grows when events are retried after invocation failures or throttling; a mismatch between AsyncEventsReceived and Invocations points to the same backlog, so the documented next step is to check Errors for function faults and Throttles for concurrency limits. Duplicate delivery (B) would not lift the age metric. Payload size (C) would fail the invoke outright rather than queue it. Filter criteria (D) apply to event source mappings, not to asynchronous invocation.96. A Lambda function calls another AWS service and its own timeout fires while the SDK is still retrying a failed request. The team wants the SDK to give up sooner. Which setting changes that?
- A. AWS_RETRY_ATTEMPTS, a Lambda-specific variable that overrides the SDK configuration for the runtime
- B. AWS_MAX_ATTEMPTS, which counts the initial request plus retries and defaults to 3 for most services
- C. AWS_MAX_ATTEMPTS, which counts only the retries after the initial request and defaults to 3 attempts
- D. AWS_RETRY_MODE, which must be set to legacy because standard mode ignores any attempt ceiling
Show answer & explanation
Answer: B
Max attempts counts the total attempts including the initial request, so the default of 3 means one request and up to two retries, and setting it to 1 disables retries entirely; the value can come from AWS_MAX_ATTEMPTS, the max_attempts config key, or client code, in that order of precedence. Option C miscounts the initial request. Standard mode honours the ceiling, so option D is unnecessary and legacy mode is discouraged. Option A names a variable that does not exist.97. A service has X-Ray enabled with no custom sampling rules. A developer expects every request to be traced but sees only a fraction. What is the default sampling behaviour?
- A. The first ten requests each second are recorded, plus one percent of any additional requests
- B. Five percent of all requests are recorded, with no reservoir guaranteeing a minimum trace rate
- C. All requests are recorded for the first minute after deployment, then five percent thereafter
- D. The first request each second is recorded, plus five percent of any additional requests
Show answer & explanation
Answer: D
The default rule records the first request each second as a reservoir, which guarantees at least one trace per second while the service is serving requests, and then samples five percent of additional requests at a fixed rate. Options A and C invent different reservoirs and windows. Option B names the right rate but drops the reservoir, which is the part that keeps low-traffic services visible; both halves of the rule can be changed by editing the default rule or adding higher-priority rules.98. An alarm watches a metric that a function emits only when an error occurs, and it keeps flipping to INSUFFICIENT_DATA during quiet periods. Which missing data treatment removes the noise?
- A. notBreaching, which treats missing points as within the threshold so quiet periods keep the alarm OK
- B. missing, the default setting, which keeps the alarm in its current state through quiet periods
- C. ignore, which transitions the alarm to INSUFFICIENT_DATA only after the evaluation range fills
- D. breaching, which treats missing points as violating the threshold so quiet periods raise the alarm
Show answer & explanation
Answer: A
For a metric that reports only when something goes wrong, AWS recommends treating missing data as notBreaching so absent points count as good and the alarm stays OK. breaching (D) would do the opposite and fire on silence. The default is missing, which sends the alarm to INSUFFICIENT_DATA when all points in the evaluation range are absent, so option B both misdescribes it and restates the problem. ignore is the setting that retains the current state, which is what option C wrongly attributes to missing.99. A developer wants to search X-Ray traces by a customer identifier and also attach a large request payload for later reading. How should each piece of data be recorded?
- A. The identifier as an annotation and the payload as metadata, since only annotations are indexed
- B. Both as annotations, since X-Ray indexes every key on a segment for use in filter expressions
- C. Both as metadata, and the search performed with a CloudWatch Logs Insights query over the trace logs
- D. The identifier as metadata and the payload as an annotation, since annotations accept structured objects
Show answer & explanation
Answer: A
Annotations are simple key-value pairs that X-Ray indexes for filter expressions, with up to 50 indexed per trace, while metadata accepts values of any type including objects and lists but is not indexed and cannot be searched. Option D reverses the two. Option B assumes everything is indexed, which would make the distinction meaningless. Option C abandons the searchable path X-Ray already provides for the identifier.100. A trading application publishes a custom metric with StorageResolution set to 1 and needs an alarm that reacts within seconds. What alarm periods are available?
- A. A high-resolution alarm with a period of 1, 5, or 10 seconds, matching the metric's storage resolution
- B. A high-resolution alarm with a period of 10 or 30 seconds, available only on AWS namespace metrics
- C. Only multiples of 60 seconds, because alarms always evaluate on standard one-minute boundaries
- D. A high-resolution alarm with a period of 10 or 30 seconds, or a regular alarm on any multiple of 60
Show answer & explanation
Answer: D
High-resolution metrics can be read at 1, 5, 10, 30, or any multiple of 60 seconds, but alarms on them accept only a 10-second or 30-second high-resolution period or any multiple of 60 seconds, with a higher charge for the two short periods. Option C denies the feature outright. Option A confuses retrieval periods with alarm periods. Option B inverts availability: metrics produced by AWS services are standard resolution by default, and high resolution is something you choose when publishing a custom metric.
Showing 100 of 160 questions.
Key facts: AWS Developer Associate (DVA-C02) exam
- Questions
- 65
- Time limit
- 2h 10m
- Passing score
- 720/1000
- Exam fee
- $150
- Governing body
- Amazon Web Services (AWS)
This free AWS Developer Associate (DVA-C02) practice test has 160 original questions written from Amazon Web Services (AWS)'s official sources, last checked against them on July 18, 2026, 100 of them listed on this page and the rest loaded by the drill. Every question shows a worked explanation, and nothing here requires a signup.
The questions are grouped under four outline areas: Deployment, Development with AWS Services, Security and Troubleshooting and Optimization.
As of 2026, the AWS Developer Associate (DVA-C02) exam fee is $150.
Questions by topic in the AWS Developer Associate (DVA-C02) practice bank
Counts describe our practice categories, which may subdivide official domains. They are not the exam’s official topic weights.
About these practice questions
These are original study questions written from published exam objectives—not recalled, copied, or confidential live-exam items. Always confirm current coverage with the official sources linked on this page.
Exam format and study resources
AWS certifications
In the same family
More in this category
- Microsoft Certified: Azure Administrator Associate (Exam AZ-104)
- Microsoft Azure AI Fundamentals
- Microsoft Certified: Azure Fundamentals (AZ-900)
- Cisco Certified Network Associate (200-301 CCNA)
- Cisco Certified Support Technician (CCST) Networking
- Certified Information Systems Security Professional (CISSP)
- Certified Kubernetes Administrator (CKA)
- Claude Certified Associate – Foundations
- CompTIA A+ (Core 1: 220-1201 and Core 2: 220-1202)
Get a free AWS Developer Associate (DVA-C02) study plan
A week-by-week plan plus new practice questions, straight to your inbox.
Official sources
The official documents our facts about this exam are taken from.
- AWS Certified Developer - Associate (DVA-C02) Exam GuideAWSdocs.aws.amazon.com
- AWS Certified Developer - Associate (Exam Overview)AWSaws.amazon.com
- AWS Certification Policies - Before TestingAWSaws.amazon.com
- Schedule an AWS Certification ExamAWSaws.amazon.com
- AWS Certification Exams (Pearson VUE)Pearson VUEpearsonvue.com
Last verified against AWS's official sources:
Frequently asked questions
How many questions are on the AWS Certified Developer - Associate exam, and how much time do I get?
The exam contains 65 questions, which are either multiple choice or multiple response, and you are given 130 minutes to complete it. Of those 65 questions, only 50 affect your score — the other 15 are unscored questions that do not count toward your result. Since unscored questions are not identified during the exam, treat every question as if it counts. The timing works out to exactly two minutes per question, so full-length timed practice sets are the most realistic way to build the pacing you'll need on test day.
What score do I need to pass the AWS Developer - Associate exam?
You need a minimum passing score of 720, reported on a scaled score range of 100 to 1,000. Your scaled score is derived from your performance on the 50 scored questions; the 15 unscored questions have no effect on your result. Because scoring is scaled rather than a simple percentage, there is no fixed number of correct answers that guarantees a pass — so don't waste exam time trying to guess which questions 'don't count.' Instead, use timed practice exams beforehand to confirm you're consistently performing well above the passing threshold.
Which exam domains should I spend the most practice time on?
The official exam guide defines 4 content domains: Development with AWS Services (32% of scored content), Security (26%), Deployment (24%), and Troubleshooting and Optimization (18%). Development and Security together make up 58% of your scored content, so hands-on fluency with core AWS services and security patterns should anchor your preparation. That said, don't neglect the smallest domain — at 18%, Troubleshooting and Optimization still represents roughly 9 of the 50 scored questions, which is more than enough to swing a borderline result.
How much does the exam cost, and how does scheduling work?
The exam costs 150 USD to register. You schedule it with Pearson VUE from your AWS Certification account, which routes you to Pearson VUE's scheduling system. You can take the exam either at a physical Pearson VUE test center or as an OnVUE online proctored exam, and most online-proctored appointments are available 24 hours a day, 7 days a week — useful if you want an early-morning or late-night slot. If plans change, you can reschedule up to 24 hours before your scheduled exam time, but each appointment can only be rescheduled twice, so it's wise to book once your practice scores are consistently strong. After you pass, the credential is valid for 3 years.