Curated

Troubleshooting and Optimization (4.1–4.3)

0 votes

Questions66

  1. Question 1

    Troubleshooting and Optimization

    Which log level is most appropriate for detailed variable values used during troubleshooting rather than routine production operation?

    Show the answer

    Correct answerB. DEBUG

    AWhy not this: INFO normally records routine operational events, such as successful application startup.

    BWhy this is right: DEBUG is intended for detailed diagnostic information such as intermediate variable values.

    CWhy not this: ERROR indicates a failure, not ordinary diagnostic details.

    DWhy not this: WARN indicates a potential problem or unexpected condition that does not necessarily stop processing.

    DEBUG identifies detailed diagnostic information useful during troubleshooting. INFO records routine operational events rather than fine-grained diagnostic values.

    Open this question
  2. Question 2

    Troubleshooting and Optimization

    An API queues work that several Lambda functions process, each with its own invocation ID; distributed traces are sampled. How should developers reliably link application logs for each business operation?

    Show the answer

    Correct answerA. Propagate an operation ID and include it in every related log

    AWhy this is right: An operation-level correlation ID survives asynchronous boundaries and links all related application log entries.

    BWhy not this: Tracing provides execution context but does not replace application logs containing business events and state.

    CWhy not this: Each invocation has a different ID, so invocation IDs alone do not link the complete business operation.

    DWhy not this: Concurrent operations can share timestamps and functions, making timestamp-based matching unreliable.

    A correlation ID propagated through queued messages links logs across separate invocations for the same operation. Lambda invocation IDs identify individual invocations, not the entire business operation.

    Open this question
  3. Question 3

    Troubleshooting and Optimization

    Which logging approach makes application events easiest to filter by user ID and action in Amazon CloudWatch Logs Insights?

    Show the answer

    Correct answerB. Write JSON events with consistent field names

    AWhy not this: Metrics record measurements rather than detailed application events; user ID dimensions also create high cardinality.

    BWhy this is right: CloudWatch Logs Insights can discover JSON fields, making consistent user ID and action fields easy to query.

    CWhy not this: Trace annotations support trace filtering but do not provide structured application log records.

    DWhy not this: Varying field labels make consistent filtering harder and can require custom parsing.

    Structured JSON logs with consistent field names let CloudWatch Logs Insights discover and filter application event fields. Metrics summarize measurements rather than preserve detailed event records.

    Open this question
  4. Question 4

    Troubleshooting and Optimization

    An application logs complete HTTP request headers to CloudWatch Logs, including bearer tokens. Developers need request context for troubleshooting without storing credentials. What should they do?

    Show the answer

    Correct answerA. Allowlist safe header fields and omit tokens before logging

    AWhy this is right: Selecting safe fields before emission preserves troubleshooting context without recording bearer tokens.

    BWhy not this: Short retention reduces storage duration but still records credentials during that period.

    CWhy not this: Encryption protects data at rest but does not prevent credentials from being stored in logs.

    DWhy not this: Access restrictions reduce exposure but still leave credentials stored in the logs.

    Allowlisting safe fields prevents credentials from entering logs while preserving useful request context. Encryption protects stored logs but still stores the bearer tokens.

    Open this question
  5. Question 5

    Troubleshooting and Optimization

    An API Gateway REST API returns HTTP 502 with “Malformed Lambda proxy response.” What should the developer check first?

    Show the answer

    Correct answerB. The Lambda response structure

    AWhy not this: Request throttling normally produces HTTP 429, not a malformed-response error.

    BWhy this is right: API Gateway rejects a proxy response that does not follow its required response structure.

    CWhy not this: The execution role controls access to AWS resources, not the structure of the function's returned response.

    DWhy not this: Reserved concurrency limits invocation capacity rather than determining the response format.

    A Lambda proxy response must follow API Gateway's expected structure, including a string body. An execution-role permission failure does not explain an explicitly malformed proxy response.

    Open this question
  6. Question 6

    Troubleshooting and Optimization

    A slow request's trace shows three sequential DynamoDB attempts totaling 120 ms, separated by retry waits totaling 2.8 seconds. The first attempts report throttling, the last succeeds, and Lambda reports no errors. What BEST explains the request's latency?

    Show the answer

    Correct answerC. Retry backoff dominated latency despite eventual application success

    AWhy not this: The attempts total only 120 ms, far less than the measured retry waits.

    BWhy not this: The supplied timing attributes the delay to retry waits, not function initialization.

    CWhy this is right: The trace attributes 2.8 seconds to waits between throttled attempts, even though the request eventually succeeds.

    DWhy not this: The traced function and DynamoDB attempts show that the request reached the integration.

    The retry waits account for far more elapsed time than the DynamoDB attempts. A successful final attempt explains the absence of Lambda errors; it does not mean the request avoided throttling or retry delays.

    Open this question
  7. Question 7

    Troubleshooting and Optimization

    A Python Lambda invocation reports “Handler 'process' missing on module 'app'.” Which configuration should the developer verify?

    Show the answer

    Correct answerD. The function's runtime handler setting

    AWhy not this: Memory allocation affects available resources, not which callable the runtime looks for.

    BWhy not this: Environment variables supply configuration values but do not select the Python entry point.

    CWhy not this: The execution timeout limits runtime duration after invocation begins; it does not resolve a missing callable.

    DWhy this is right: The handler setting must match the deployed module name and the callable defined within it.

    The Python handler setting identifies the module and callable Lambda invokes. A missing-handler error indicates that the configured callable cannot be found; increasing the timeout does not fix handler resolution.

    Open this question
  8. Question 8

    Troubleshooting and Optimization

    An SQS-triggered Lambda function has ReportBatchItemFailures enabled and records failed message IDs, but throws an exception after processing each batch containing a failure. Successfully processed messages are retried too. Which change fixes this behavior?

    Show the answer

    Correct answerA. Return the failed message IDs without throwing

    AWhy this is right: Returning the required partial batch response allows Lambda to retry only the reported failed messages.

    BWhy not this: A higher redrive threshold allows more retries without changing which messages are retried.

    CWhy not this: A longer visibility timeout delays retries but does not prevent an exception from failing the entire batch.

    DWhy not this: Maximum concurrency limits parallel processing; it does not change batch failure reporting.

    With ReportBatchItemFailures enabled, the handler must return the failed message identifiers in the required response structure. Throwing an exception fails the entire batch; a longer visibility timeout only delays its retry.

    Open this question
  9. Question 9

    Troubleshooting and Optimization

    An application receives HTTP 200 from DynamoDB BatchWriteItem, but some requested items are missing. The response contains UnprocessedItems, and the application checks only the HTTP status. What should the developer change?

    Show the answer

    Correct answerB. Retry the unprocessed requests with exponential backoff

    AWhy not this: Strongly consistent reads reflect completed writes but cannot perform unprocessed writes.

    BWhy this is right: UnprocessedItems identifies requests that need retrying, and exponential backoff helps avoid repeated throttling.

    CWhy not this: Increasing batch size does not resolve unprocessed writes and can exceed the operation's limits.

    DWhy not this: HTTP 200 confirms a successful API response, not that every requested batch write completed.

    BatchWriteItem can return HTTP 200 while leaving some writes unprocessed. Retry the requests returned in UnprocessedItems with exponential backoff; strongly consistent reads cannot complete writes that were never processed.

    Open this question
  10. Question 10

    Troubleshooting and Optimization

    A Lambda consumer processes an SQS FIFO queue whose messages all use one message group ID, although orders are independent. The backlog grows with only one active invocation; how should the developer increase parallelism while preserving message order within each order?

    Show the answer

    Correct answerD. Use the order ID as the message group ID.

    AWhy not this: Visibility timeout controls when unprocessed messages become visible again, not parallelism across groups.

    BWhy not this: Separate groups for individual messages allow messages from the same order to be processed out of order.

    CWhy not this: Additional concurrency cannot overcome the serialization imposed by a single FIFO message group.

    DWhy this is right: Grouping by order preserves each order's sequence while allowing different orders to be processed concurrently.

    FIFO queues allow concurrent processing across message groups while preserving order within each group. Using order IDs enables parallel processing of independent orders; a unique group for every message would lose ordering within an order.

    Open this question
  11. Question 11

    Troubleshooting and Optimization

    A CPU-bound Lambda function uses little of its configured memory but misses its execution-time target. Which actions should a developer take to find a better-performing, cost-effective configuration? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Compare execution duration and invocation cost across memory settings.D. Benchmark higher memory settings to obtain more CPU capacity.

    AWhy this is right: Measuring duration and cost reveals which configuration meets the performance target economically.

    BWhy not this: A timeout controls how long execution may run; it does not change the CPU allocated to an invocation.

    CWhy not this: Ephemeral storage increases available temporary disk space, not CPU allocation.

    DWhy this is right: Higher Lambda memory settings provide more CPU capacity, which can reduce CPU-bound execution time.

    EWhy not this: Reserved concurrency controls simultaneous executions, not the CPU capacity of an individual invocation.

    Lambda allocates CPU in proportion to configured memory, so higher memory can improve CPU-bound execution even when memory usage is low. Compare duration and cost because faster execution can offset the higher memory rate; timeout changes do not add CPU.

    Open this question
  12. Question 12

    Troubleshooting and Optimization

    A Lambda function must have 10 initialized execution environments ready before traffic arrives, but must never exceed 40 concurrent executions to protect a database. Which configuration meets both requirements?

    Show the answer

    Correct answerA. Set reserved concurrency to 40 and provisioned concurrency to 10.

    AWhy this is right: Reserved concurrency provides the ceiling of 40, and provisioned concurrency prepares the required 10 environments.

    BWhy not this: This prepares 40 environments rather than the specified 10, adding unnecessary provisioned capacity.

    CWhy not this: A reserved concurrency setting of 10 prevents the function from reaching the required capacity of 40.

    DWhy not this: Provisioned concurrency prepares environments but does not prevent on-demand concurrency from exceeding 40.

    Reserved concurrency caps the function at 40 concurrent executions, while provisioned concurrency prepares 10 initialized environments. Provisioned concurrency alone is not a concurrency ceiling; additional invocations can use on-demand environments.

    Open this question
  13. Question 13

    Troubleshooting and Optimization

    A Lambda function's reserved concurrency is 100, and each execution environment opens its own connection to an Amazon RDS for MySQL instance that allows 80 connections. During traffic spikes the database rejects connections. Which change BEST lets the function keep scaling to 100 without exhausting database connections?

    Show the answer

    Correct answerB. Route the function's database connections through Amazon RDS Proxy.

    AWhy not this: Provisioned environments still open one connection each, so 100 of them still exceed the database's limit.

    BWhy this is right: RDS Proxy multiplexes many client connections over a pooled set of database connections.

    CWhy not this: Waiting longer does not add database connections; requests still fail or queue behind the limit.

    DWhy not this: Reuse avoids reconnecting within one environment, but 100 concurrent environments still need 100 connections.

    RDS Proxy pools and shares a smaller set of database connections among many concurrent Lambda execution environments, so the function can scale to its concurrency limit without exceeding the database's connection limit. Reusing a connection per environment still leaves up to 100 environments each holding one connection.

    Open this question
  14. Question 14

    Troubleshooting and Optimization

    Which AWS feature automatically adjusts the number of EC2 instances to maintain a target average CPU utilization?

    Show the answer

    Correct answerB. Amazon EC2 Auto Scaling target tracking

    AWhy not this: Automatic discovery helps clients find cache nodes, not scale application EC2 instances.

    BWhy this is right: Target tracking adjusts Auto Scaling group capacity to maintain the configured utilization target.

    CWhy not this: Provisioned concurrency prepares Lambda execution environments rather than managing EC2 instances.

    DWhy not this: Subscription filters route matching log events; they do not manage EC2 instance counts.

    An EC2 Auto Scaling target tracking policy adjusts group capacity to maintain a target metric such as average CPU utilization. CloudWatch Logs subscription filters deliver log events rather than adjust instance counts.

    Open this question
  15. Question 15

    Troubleshooting and Optimization

    A complete AWS X-Ray trace shows a 2-second application segment containing a single 100-ms downstream HTTP subsegment and no other subsegments. Where should the developer investigate the remaining elapsed time first?

    Show the answer

    Correct answerA. Within application work outside the HTTP subsegment

    AWhy this is right: Approximately 1.9 seconds lies outside the instrumented downstream call and needs investigation.

    BWhy not this: Network time recorded within the HTTP subsegment is already included in its 100-ms duration.

    CWhy not this: Retries recorded within the subsegment would be included in its measured duration.

    DWhy not this: Processing represented by the downstream call is contained within its 100-ms subsegment.

    The downstream subsegment accounts for only 100 ms of the enclosing 2-second segment. Investigate application work or waits outside that subsegment; downstream processing and network time captured by the HTTP subsegment cannot explain the remaining 1.9 seconds.

    Open this question
  16. Question 16

    Troubleshooting and Optimization

    An API's average latency remains near 100 ms, but its p99 latency rises from 250 ms to 3 seconds under similar traffic. What should the developer conclude?

    Show the answer

    Correct answerC. The slowest requests have become substantially slower.

    AWhy not this: Latency statistics alone do not establish an increase in server errors.

    BWhy not this: The 99th percentile describes the upper tail, not the latency experienced by most requests.

    CWhy this is right: The increase in p99 reveals worse tail latency despite a nearly unchanged average.

    DWhy not this: Latency percentiles do not measure request volume, and the scenario specifies similar traffic.

    A higher p99 indicates worsening latency near the slow end of the request distribution, even when the average barely changes. It does not mean most requests take 3 seconds; that would affect the average much more substantially.

    Open this question
  17. Question 17

    Troubleshooting and Optimization

    JSON application logs contain endpoint, requestId, and status; retries can produce repeated failure events for one requestId. Which CloudWatch Logs Insights query identifies endpoints with more than 100 distinct failed requests in the selected time range?

    Show the answer

    Correct answerD. filter status >= 500 | stats count_distinct(requestId) as failures by endpoint | filter failures > 100

    AWhy not this: Counting events includes repeated failure records for the same request and can inflate the result.

    BWhy not this: Without filtering status, the aggregation counts successful requests as well as failed requests.

    CWhy not this: Grouping by requestId makes each group's distinct request count one, preventing the threshold from being met.

    DWhy this is right: Filtering failures before counting distinct request IDs per endpoint avoids counting repeated failure events.

    Filter failure events, count distinct request IDs per endpoint, then filter the aggregated counts. Counting events instead would inflate totals when retries produce repeated failure records for the same request.

    Open this question
  18. Question 18

    Troubleshooting and Optimization

    What does a CloudWatch Logs log stream represent?

    Show the answer

    Correct answerD. A sequence of log events from the same source

    AWhy not this: An execution path across services is represented by a distributed trace.

    BWhy not this: Numerical time-series summaries are metrics, not log streams.

    CWhy not this: A log group contains streams and provides settings such as retention, rather than containing other log groups.

    DWhy this is right: CloudWatch Logs defines a log stream as a sequence of events sharing the same source.

    A log stream is a sequence of log events that share the same source. A log group contains log streams and defines shared settings such as retention; it is not itself a stream.

    Open this question
  19. Question 19

    Troubleshooting and Optimization

    Application log messages use the format "operation=checkout duration=1250ms" without structured fields. Which CloudWatch Logs Insights query extracts the duration and returns events exceeding 1000 ms?

    Show the answer

    Correct answerC. parse @message "operation=* duration=*ms" as operation, duration | filter duration > 1000

    AWhy not this: There is no automatically discovered @duration field for this custom unstructured message.

    BWhy not this: The query extracts duration but aggregates all durations instead of returning only slow events.

    CWhy this is right: The parse pattern extracts duration, allowing the filter to select values greater than 1000.

    DWhy not this: The text filter matches exactly 1000 ms rather than extracting and comparing larger durations.

    The parse command extracts duration from the unstructured message so a numeric filter can select slow events. Matching the literal text duration=1000ms finds that exact value, not durations greater than 1000 ms.

    Open this question
  20. Question 20

    Troubleshooting and Optimization

    An application publishes a custom queue-depth metric every second, but the code leaves StorageResolution at its default. Developers need one-second metric resolution. What should they change?

    Show the answer

    Correct answerB. Set StorageResolution to 1.

    AWhy not this: Timestamp precision does not select the metric's storage resolution.

    BWhy this is right: StorageResolution of 1 selects high-resolution storage for the custom metric.

    CWhy not this: Count describes the measurement's unit, not its storage resolution.

    DWhy not this: A dashboard period changes presentation, not the resolution used when the metric was published.

    Setting StorageResolution to 1 publishes a high-resolution custom metric with one-second resolution. Publishing frequently or choosing a short dashboard period does not change a standard-resolution metric into a high-resolution metric.

    Open this question
  21. Question 21

    Troubleshooting and Optimization

    A checkout service emits a custom latency metric for each request. Developers need comparisons by deployment environment without creating a separate metric for every request. Which implementation choices meet these needs? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Keep request IDs in logs rather than metric dimensions.C. Use a bounded Environment dimension such as staging or production.

    AWhy this is right: Logs retain request-level context without making each request a separate metric identity.

    BWhy not this: Latency belongs in the metric value; using exact measurements as dimensions creates excessive cardinality.

    CWhy this is right: A small, stable set of environment values supports comparisons with controlled metric cardinality.

    DWhy not this: Unique request IDs create distinct dimension combinations and therefore separate metrics for individual requests.

    EWhy not this: Request-specific timestamps in names create separate metrics instead of a reusable latency time series.

    A bounded Environment dimension supports environment comparisons, while keeping request IDs in logs avoids per-request metric identities. Unique request IDs as dimensions create high cardinality because each dimension combination identifies a separate metric.

    Open this question
  22. Question 22

    Troubleshooting and Optimization

    Which AWS API operation lets application code publish a custom metric directly to Amazon CloudWatch?

    Show the answer

    Correct answerA. PutMetricData

    AWhy this is right: PutMetricData submits custom metric measurements to Amazon CloudWatch.

    BWhy not this: PutMetricAlarm creates or updates an alarm rather than submitting metric measurements.

    CWhy not this: PutLogEvents sends log events to CloudWatch Logs rather than directly publishing metric data.

    DWhy not this: PutTraceSegments sends trace segment documents to AWS X-Ray rather than publishing CloudWatch metrics.

    PutMetricData publishes custom metric data to CloudWatch. PutMetricAlarm configures an alarm that evaluates metrics; it does not publish their measured values.

    Open this question
  23. Question 23

    Troubleshooting and Optimization

    An application batches varied request durations into CloudWatch custom metrics. Developers need to calculate p99 without publishing each sample separately. How should the code represent each batch?

    Show the answer

    Correct answerA. Publish distinct durations in Values with their frequencies in Counts.

    AWhy this is right: Values and Counts preserve each distinct duration and its frequency, allowing CloudWatch to calculate percentiles.

    BWhy not this: A batch average discards the distribution and cannot reproduce the requests' p99.

    CWhy not this: A maximum preserves only an extreme value; a dimension does not supply the missing sample distribution.

    DWhy not this: A statistic set loses the distribution; varied samples generally do not meet CloudWatch's conditions for percentile retrieval.

    Values and Counts retain the sample distribution needed for percentile calculations while batching repeated values. A statistic set generally cannot support percentiles for varied samples because it does not retain their distribution.

    Open this question
  24. Question 24

    Troubleshooting and Optimization

    A Lambda consumer processes an SQS FIFO batch sequentially with partial batch responses enabled, and processing fails midway through the batch. To preserve ordering and avoid retrying completed messages, how should the consumer handle the remaining batch?

    Show the answer

    Correct answerB. Stop processing and report failed and unprocessed messages.

    AWhy not this: Reporting success removes failed work from the queue instead of allowing it to be retried.

    BWhy this is right: Stopping and reporting failed and unprocessed messages preserves ordering without retrying completed messages.

    CWhy not this: Reporting completed messages as failures causes unnecessary retries and can repeat their side effects.

    DWhy not this: Continuing after a failure can process later messages before the failed message succeeds, violating ordering.

    For FIFO partial batch handling, stop after the first failure and return the failed and unprocessed message identifiers. Reporting the entire batch would unnecessarily retry messages that already completed successfully.

    Open this question
  25. Question 25

    Troubleshooting and Optimization

    Which EC2 instance category is designed for applications that hold large datasets in RAM?

    Show the answer

    Correct answerD. Memory optimized

    AWhy not this: General purpose instances balance compute, memory, and networking rather than emphasizing RAM.

    BWhy not this: Storage optimized instances emphasize local storage throughput and I/O performance.

    CWhy not this: Compute optimized instances emphasize processing capacity rather than large memory capacity.

    DWhy this is right: Memory optimized instances provide capacity suited to large in-memory datasets.

    Memory optimized instances are designed for workloads that process large datasets in memory. Storage optimized instances target demanding local-storage workloads rather than large RAM requirements.

    Open this question
  26. Question 26

    Troubleshooting and Optimization

    A Lambda function fails with out-of-memory errors while parsing documents, and its reported maximum memory usage reaches its configured limit. Which change directly addresses the failure?

    Show the answer

    Correct answerB. Increase the function's memory allocation.

    AWhy not this: Provisioned concurrency prepares execution environments but does not increase their individual memory capacity.

    BWhy this is right: More memory gives the invocation additional RAM for document parsing.

    CWhy not this: A longer timeout allows more execution time but does not increase available RAM.

    DWhy not this: Ephemeral storage provides disk space in /tmp rather than additional RAM.

    Increasing memory allocation gives each invocation more RAM for parsing documents. Ephemeral storage increases disk space in /tmp, not the memory available to hold parsed objects.

    Open this question
  27. Question 27

    Troubleshooting and Optimization

    An order service publishes events that billing and inventory must each process independently, including during temporary consumer outages. Which messaging design BEST meets these requirements?

    Show the answer

    Correct answerD. One SNS topic with a separate SQS queue per service

    AWhy not this: Consumers sharing a queue compete for messages, so each service would not receive every event.

    BWhy not this: Direct HTTP delivery lacks a separate durable queue backlog that each service can process after an outage.

    CWhy not this: Alternating delivery divides events between services rather than delivering every event to each service.

    DWhy this is right: Each subscribed queue receives events and retains its own backlog while its consumer is unavailable.

    SNS fan-out to separate SQS queues gives each service its own durable event backlog. Consumers sharing one SQS queue compete for messages instead of each receiving every event.

    Open this question
  28. Question 28

    Troubleshooting and Optimization

    An application on a burstable EC2 instance in Standard mode slows after sustained CPU activity; its CPU credit balance reaches zero while memory remains sufficient. The application needs sustained CPU performance without surplus-credit charges. Which change is BEST?

    Show the answer

    Correct answerC. Move to a suitably sized non-burstable instance.

    AWhy not this: A larger burstable instance still depends on its baseline and credits; it does not directly remove the constraint.

    BWhy not this: Unlimited mode can incur surplus-credit charges when sustained CPU usage exceeds the baseline.

    CWhy this is right: Non-burstable instances provide sustained CPU capacity without relying on accumulated CPU credits.

    DWhy not this: Caching might reduce repeated work, but no cacheable workload is established and CPU capacity remains constrained.

    A suitably sized non-burstable instance provides sustained CPU capacity without CPU-credit accounting. Unlimited mode can sustain performance beyond the baseline, but sustained excess usage can incur surplus-credit charges.

    Open this question
  29. Question 29

    Troubleshooting and Optimization

    An operator has not received an Amazon SNS email subscription confirmation. What must happen before the subscription can receive alarm notifications?

    Show the answer

    Correct answerA. The recipient must confirm the subscription using the SNS confirmation email.

    AWhy this is right: SNS requires recipient confirmation before delivering topic notifications to an email subscription.

    BWhy not this: SNS email recipients do not need IAM users to confirm subscriptions or receive notifications.

    CWhy not this: Dashboard viewing access does not confirm an SNS email subscription.

    DWhy not this: Delivery status logging does not change a subscription from pending confirmation to confirmed.

    An SNS email subscription remains pending until the recipient confirms it using the confirmation email. Delivery status logging does not confirm a subscription or authorize email delivery.

    Open this question
  30. Question 30

    Troubleshooting and Optimization

    A team needs an email only when a particular AWS CodePipeline pipeline execution succeeds, not when its final action succeeds. Which configuration should the developer use?

    Show the answer

    Correct answerB. Match successful CodePipeline Pipeline Execution State Change events in EventBridge and target an SNS topic.

    AWhy not this: A stage success event describes one stage, not the overall pipeline execution outcome.

    BWhy this is right: Filtering pipeline execution events by pipeline name and SUCCEEDED matches the required completion outcome.

    CWhy not this: An action success event describes an individual action, not successful completion of the pipeline execution.

    DWhy not this: StartPipelineExecution records an execution request, not its eventual outcome.

    An EventBridge rule filtered by pipeline name and a pipeline execution state of SUCCEEDED identifies successful pipeline completion. Action and stage success events describe narrower units of work, not the outcome of the entire execution.

    Open this question
  31. Question 31

    Troubleshooting and Optimization

    Operators must receive an alert only when latency and error-rate alarms are both ALARM and a deployment-window alarm is OK. Individual alarms must retain their state histories without independently notifying operators; which configuration meets these requirements?

    Show the answer

    Correct answerC. Use a composite alarm requiring both application ALARM states and deployment OK; attach SNS only to the composite.

    AWhy not this: Underlying alarm actions can notify independently, bypassing the composite's conditions.

    BWhy not this: OR permits notification when only one application alarm is ALARM, rather than requiring both.

    CWhy this is right: The composite enforces every required state, while underlying alarms retain histories without sending notifications.

    DWhy not this: Requiring the deployment alarm to be ALARM reverses the required deployment-window condition.

    A composite alarm combines the required states while leaving underlying alarms available for inspection. Only the composite should notify; attaching SNS actions to the underlying alarms would produce alerts that bypass the combined conditions.

    Open this question
  32. Question 32

    Troubleshooting and Optimization

    An application uses a service quota that exposes a CloudWatch usage metric and supports the SERVICE_QUOTA function. How should a developer notify operators when usage exceeds 80% of the current quota?

    Show the answer

    Correct answerD. Alarm on 100 × usage / SERVICE_QUOTA(usage) exceeding 80 and notify an SNS topic.

    AWhy not this: Quota-increase request events report administrative actions, not current quota utilization.

    BWhy not this: A raw usage threshold of 80 is a count or quantity, not 80% of the quota.

    CWhy not this: A dashboard visualizes usage but does not automatically notify operators when a threshold is crossed.

    DWhy this is right: The expression calculates percentage utilization using the quota associated with the usage metric.

    A metric math alarm can compare percentage utilization against 80 and notify through SNS. Alarming on the raw usage value compares usage units with 80, rather than calculating a percentage of the current quota.

    Open this question
  33. Question 33

    Troubleshooting and Optimization

    Which CloudWatch Logs Insights command restricts query results to events whose requestId field matches a specified value?

    Show the answer

    Correct answerC. filter

    AWhy not this: The fields command selects or derives fields rather than restricting events by requestId.

    BWhy not this: The stats command calculates aggregates rather than selecting events by a matching field value.

    CWhy this is right: The filter command retains events that satisfy the specified requestId condition.

    DWhy not this: The sort command orders results without selecting events by a matching field value.

    The filter command selects events that satisfy a condition, such as an exact requestId match. The fields command selects fields to display or creates derived fields; it does not by itself restrict events to a matching request.

    Open this question
  34. Question 34

    Troubleshooting and Optimization

    An AWS CodeDeploy deployment to an EC2 instance fails during AfterInstall. The deployment event identifies a hook script, but its error summary omits the script's standard error output. Where should the developer look next?

    Show the answer

    Correct answerC. The deployment's scripts.log on the instance

    AWhy not this: VPC Flow Logs record network flow metadata rather than hook script output.

    BWhy not this: CloudTrail records API activity rather than the standard error produced by the hook.

    CWhy this is right: The deployment-specific scripts.log contains output from lifecycle event hook scripts.

    DWhy not this: An X-Ray service map describes traced application dependencies, not deployment hook standard error.

    CodeDeploy records lifecycle hook script output in the deployment's scripts.log on the instance. CloudTrail records AWS API activity, not the standard error emitted by a deployment hook script.

    Open this question
  35. Question 35

    Troubleshooting and Optimization

    JSON access logs contain numeric status fields, with one event per request. A developer needs five-minute intervals containing at least 100 requests and more than 5% HTTP 5xx responses. Which CloudWatch Logs Insights query meets these requirements?

    Show the answer

    Correct answerB. stats count(*) as total, sum(status >= 500 and status < 600) as errors by bin(5m) | filter total >= 100 and 100.0 * errors / total > 5

    AWhy not this: Grouping by status splits each interval into separate status groups instead of calculating its overall error percentage.

    BWhy this is right: The aggregation retains all requests, counts 5xx responses separately, and applies both thresholds to each five-minute interval.

    CWhy not this: Filtering first discards successful requests, so the count cannot represent total traffic or support the required error percentage.

    DWhy not this: An error count greater than five is not the same as an error percentage greater than 5%.

    Count all requests and conditionally sum 5xx responses within each time interval before applying the volume and percentage thresholds. Filtering to errors first removes successful requests from the denominator; grouping by status also prevents calculation of the overall interval error rate.

    Open this question
  36. Question 36

    Troubleshooting and Optimization

    An AWS CodeBuild execution reports BUILD as FAILED, followed by UPLOAD_ARTIFACTS as FAILED. The build log shows a compiler error before packaging, and the upload log reports that the expected artifact directory is missing. What should the developer address first?

    Show the answer

    Correct answerB. Correct the source compilation error.

    AWhy not this: A missing artifact directory indicates absent build output rather than an S3 authorization failure.

    BWhy this is right: The compilation failure occurred first and prevented creation of the files expected by the artifact upload phase.

    CWhy not this: Additional upload time cannot create artifacts that the failed build did not produce.

    DWhy not this: The logs identify a missing local artifact directory, not a cross-Region upload problem.

    The compiler error prevented the build from producing the expected artifacts, making the upload failure a downstream symptom. Broadening S3 access does not resolve an artifact directory that was never created.

    Open this question
  37. Question 37

    Troubleshooting and Optimization

    An AWS CloudFormation deployment shows CREATE_FAILED for an IAM role with an explicit denial of iam:CreateRole and for an S3 bucket whose name already exists. Other resources report creation canceled, followed by rollback events. Which actions address the failures identified in these events? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersA. Choose an available name for the S3 bucket being created.B. Resolve the effective denial affecting the CloudFormation execution role.

    AWhy this is right: A new general purpose S3 bucket requires an available name within its AWS partition.

    BWhy this is right: CloudFormation cannot create the IAM role until the effective authorization denial is resolved.

    CWhy not this: Creation was canceled because the deployment failed; these events do not establish a resource timeout.

    DWhy not this: Disabling rollback preserves failed deployment resources but does not resolve either creation failure.

    The authorization denial and unavailable bucket name are independent creation failures that must both be resolved. Creation-canceled and rollback events are consequences of the failed deployment, not evidence that resource timeouts or rollback caused it.

    Open this question
  38. Question 38

    Troubleshooting and Optimization

    An SNS topic publishes events with an eventType message attribute to an SQS subscription. Its consumer discards everything except refund events; how should the developer reduce unnecessary deliveries?

    Show the answer

    Correct answerC. Configure a subscription filter policy for refund events

    AWhy not this: Visibility timeout changes how long received messages remain hidden, not which events SNS delivers.

    BWhy not this: A delivery retry policy controls retries after delivery failures, not event selection.

    CWhy this is right: A filter policy lets SNS deliver only events whose attributes match the subscription's criteria.

    DWhy not this: Receive wait time controls long polling; unwanted events would still enter the queue.

    An SNS subscription filter policy can match the eventType attribute so that only refund events reach the queue. SQS long polling reduces empty receives, not deliveries of unwanted events.

    Open this question
  39. Question 39

    Troubleshooting and Optimization

    Which Amazon SQS feature reduces empty responses by waiting for messages to become available before returning a receive response?

    Show the answer

    Correct answerD. Long polling

    AWhy not this: A visibility timeout temporarily hides received messages from other consumers.

    BWhy not this: Message retention determines how long SQS keeps messages that have not been deleted.

    CWhy not this: Delivery delay postpones when newly sent messages become available to consumers.

    DWhy this is right: Long polling waits for available messages instead of immediately returning an empty response.

    Long polling waits for messages to become available, reducing empty responses and unnecessary requests. A visibility timeout hides messages after receipt; it does not change how an empty queue is polled.

    Open this question
  40. Question 40

    Troubleshooting and Optimization

    An application reads heavily from Amazon DynamoDB tables and needs microsecond response times for repeated reads. The team wants to keep its existing GetItem and Query calls and write no cache-population or invalidation code. Which solution meets these requirements?

    Show the answer

    Correct answerA. A DAX cluster in front of the DynamoDB tables

    AWhy this is right: DAX accepts the same DynamoDB API calls and manages the cache itself, returning cached reads in microseconds.

    BWhy not this: ElastiCache needs application code to load items on misses and to invalidate or update them on writes.

    CWhy not this: API Gateway caching stores HTTP responses of an API, not DynamoDB GetItem and Query results made by the application.

    DWhy not this: CloudFront caches HTTP content at edge locations; it does not serve the application's DynamoDB calls.

    DynamoDB Accelerator (DAX) is a managed in-memory cache that is API-compatible with DynamoDB, so the application keeps its GetItem and Query calls and DAX handles read-through and write-through caching with microsecond reads. ElastiCache is a general-purpose cache that needs application code to load and invalidate entries, and API Gateway or CloudFront cache HTTP responses rather than DynamoDB calls.

    Open this question
  41. Question 41

    Troubleshooting and Optimization

    An application reads product prices from Amazon RDS through an Amazon ElastiCache cache that uses lazy loading. Price updates must appear in cache reads at once, and rarely read items must not stay in the cache indefinitely. Which actions meet these requirements? (Choose two.)

    Choose 2 answers

    Show the answer

    Correct answersB. Update the cached item whenever the application writes a new price to the databaseC. Set a time to live (TTL) on each cached item

    AWhy not this: With lazy loading alone, an updated price stays stale in the cache until the item is missed and reloaded.

    BWhy this is right: Write-through updates the cache at the same time as the database, so reads see the new price immediately.

    CWhy this is right: A TTL removes items after a set time, so rarely read items do not remain in the cache indefinitely.

    DWhy not this: noeviction keeps every item and returns errors on writes once memory is full.

    EWhy not this: More memory holds more items but neither refreshes stale prices nor removes unused items.

    Writing each update to the cache as well as the database (write-through) keeps cached prices current, and a TTL expires items that are no longer read. Lazy loading alone serves stale data until a miss, noeviction keeps every item and rejects writes when memory is full, and a larger node only holds more stale items.

    Open this question
  42. Question 42

    Troubleshooting and Optimization

    An application uses cache-aside with Amazon ElastiCache for product records. After a successful database update, subsequent reads keep returning the old cached record; which action best addresses this?

    Show the answer

    Correct answerB. Invalidate the corresponding cached record

    AWhy not this: A longer time to live permits the stale record to remain cached longer.

    BWhy this is right: Removing the stale entry causes the next read to retrieve and cache the updated database value.

    CWhy not this: Additional memory increases cache capacity but does not refresh existing entries.

    DWhy not this: Database read replicas do not remove an outdated value already stored in the cache.

    Invalidating the updated record forces the next cache-aside read to fetch current data from the database and repopulate the cache. Increasing the time to live would allow the stale value to remain longer.

    Open this question
  43. Question 43

    Troubleshooting and Optimization

    A developer asks Amazon Q Developer why an application fails, but supplies only “requests fail intermittently.” Which additional information would BEST support useful troubleshooting suggestions?

    Show the answer

    Correct answerC. Sanitized error details, affected service, timestamps, and recent changes

    AWhy not this: Planning information and monthly totals lack the error-level detail needed for targeted suggestions.

    BWhy not this: Presentation and naming details do not explain the observed intermittent failures.

    CWhy this is right: These details describe the failure and its context without requiring disclosure of secrets.

    DWhy not this: Secrets and sensitive request contents are unnecessary and should not be disclosed for troubleshooting.

    Relevant, sanitized diagnostic context helps Amazon Q Developer connect symptoms to plausible causes and suggest targeted checks. Aggregate request totals and planning details do not describe the failure, while credentials and unredacted sensitive data should not be supplied.

    Open this question
  44. Question 44

    Troubleshooting and Optimization

    Amazon Q Developer suggests increasing a Lambda timeout after receiving only timeout logs, but correlated traces show downstream throttling and retry delays after a release. Production changes require supporting evidence and a rollback plan. What is the BEST next step?

    Show the answer

    Correct answerA. Provide the correlated evidence and request revised hypotheses with validation steps.

    AWhy this is right: Additional evidence supports revised hypotheses and testable checks before an approved, reversible change.

    BWhy not this: A rollback plan does not compensate for a recommendation based on incomplete diagnostic evidence.

    CWhy not this: Aggregate duration metrics omit the downstream throttling and retry details needed to distinguish causes.

    DWhy not this: Deployment timing supports investigation but does not establish that rollback addresses the cause.

    AI suggestions are hypotheses to validate against relevant evidence. Supplying correlated traces and release context lets Amazon Q revise its analysis and propose checks before a controlled change; increasing the timeout alone may merely conceal downstream retry delays.

    Open this question
  45. Question 45

    Troubleshooting and Optimization

    An AWS Management Console operation displays an unfamiliar service error and a “Troubleshoot with Amazon Q” action. The developer wants an explanation and suggested next steps. What should the developer do?

    Show the answer

    Correct answerC. Select the action to ask Amazon Q Developer about the error.

    AWhy not this: CloudTrail records API activity but its event history does not itself generate an AI remediation plan.

    BWhy not this: Trace maps show request relationships and performance rather than automatically generating remediation suggestions.

    CWhy this is right: The action starts AI-assisted troubleshooting for the displayed console error.

    DWhy not this: Metrics show measurements; opening a dashboard does not itself request an AI error explanation.

    The console's Troubleshoot with Amazon Q action uses Amazon Q Developer to help explain a supported error and suggest troubleshooting steps. CloudTrail event history supplies API activity records, not an AI-generated remediation plan by itself.

    Open this question
  46. Question 46

    Troubleshooting and Optimization

    A CodeBuild log reports “YAML_FILE_ERROR: mapping values are not allowed in this context” before any build commands run. What should the developer inspect first?

    Show the answer

    Correct answerA. The buildspec file's YAML syntax

    AWhy this is right: The parser error identifies malformed YAML in the build instructions.

    BWhy not this: Deployment health checks do not control parsing of build instructions.

    CWhy not this: Compilation has not started because CodeBuild cannot parse the buildspec.

    DWhy not this: Artifact encryption errors occur during artifact operations, not YAML parsing.

    YAML_FILE_ERROR indicates that CodeBuild could not parse the buildspec, so its YAML syntax needs inspection. Compiler settings matter only after CodeBuild can read the build instructions and execute commands.

    Open this question
  47. Question 47

    Troubleshooting and Optimization

    An unfamiliar error is filling an application's CloudWatch log group. The developer does not know the Logs Insights query language and wants AI help to find the failing requests and then a plain-language account of what they have in common. Which approach meets these requirements?

    Show the answer

    Correct answerC. In Logs Insights, choose Generate query, describe the error, then summarize the results.

    AWhy not this: A metric filter and alarm count and notify on matching events; they do not retrieve or explain the failing requests.

    BWhy not this: Anomaly detection flags unusual log patterns but does not build a query for the failing requests or summarize them.

    CWhy this is right: Logs Insights generates the query from a natural-language prompt and then summarizes the query results in plain language.

    DWhy not this: A counting function measures how often the error occurs but gives no AI analysis of the requests.

    CloudWatch Logs Insights can generate a query from a plain-English prompt (Generate query, permission cloudwatch:GenerateQuery) and can summarize query results in natural language, which together find the failing requests and explain them. A metric filter, an alarm or a counting function only measure the error, and anomaly detection flags unusual patterns without retrieving and summarizing the matching requests.

    Open this question
  48. Question 48

    Troubleshooting and Optimization

    An application publishes deployment notifications to one Amazon SNS topic with an environment message attribute. Operators should receive only production notifications through their existing email subscription. What should the developer configure?

    Show the answer

    Correct answerB. A subscription filter policy matching the production environment

    AWhy not this: A published-message count alarm measures topic activity rather than filtering individual deployment notifications.

    BWhy this is right: Subscription filtering can match the environment message attribute and deliver only production notifications.

    CWhy not this: A topic access policy controls permission to publish or subscribe, not message selection for an existing subscription.

    DWhy not this: A delivery policy concerns delivery retries, not selection by environment.

    An SNS subscription filter policy selects messages for an individual subscription using message attributes. A topic access policy controls authorization, not which environments' messages an authorized subscriber receives.

    Open this question
  49. Question 49

    Troubleshooting and Optimization

    Two services export OpenTelemetry spans to AWS X-Ray, but calls between them appear as separate traces. They communicate through a custom HTTP client. What should the developer implement?

    Show the answer

    Correct answerC. Propagate trace context through the HTTP headers

    AWhy not this: Duration metrics describe aggregate performance rather than relationships between spans.

    BWhy not this: Service names identify trace participants; matching names does not connect spans across requests.

    CWhy this is right: Propagated trace context lets the receiving service associate its spans with the caller's trace.

    DWhy not this: Matching sampling rates does not transmit trace identifiers or parent span identifiers.

    The client must inject trace context into HTTP headers, and the receiving service must extract it to create correctly related spans. Matching sampling rates affects trace collection but does not establish parent-child relationships.

    Open this question
  50. Question 50

    Troubleshooting and Optimization

    A service sends traces to AWS X-Ray and records deployment identifiers as metadata. Developers need to find traces for a specific deployment using X-Ray filter expressions. What should they change?

    Show the answer

    Correct answerD. Record the deployment identifier as a string annotation

    AWhy not this: Segment names identify services; custom deployment attributes belong in indexed annotations.

    BWhy not this: Sampling more requests increases trace coverage but does not make metadata searchable.

    CWhy not this: Structured logs support log searches but do not make the identifier searchable in X-Ray filter expressions.

    DWhy this is right: X-Ray indexes string annotations, allowing traces to be selected by deployment identifier.

    X-Ray indexes annotations so filter expressions can select traces by custom attributes. Metadata can hold additional diagnostic data, but its values are not indexed for trace filtering.

    Open this question