Troubleshooting and Optimization
271 questions
A developer is troubleshooting a serverless application where an Amazon API Gateway stage triggers an AWS Lambda function written in Python. The function processes incoming requests and retrieves secrets from AWS Secrets Manager using the `boto3` library. Active tracing is enabled on both the API Gateway stage and the Lambda function. However, the AWS X-Ray trace map shows the segments for API Gateway and the Lambda function, but does not display any segments for the calls to AWS Secrets Manager. How should the developer resolve this issue to ensure the Secrets Manager calls are visible in the trace map?
VoltMetric is a utility analytics platform that processes electricity usage metrics from millions of smart meters. The application writes high-frequency meter readings to an Amazon DynamoDB table configured with provisioned write throughput. The table uses `ZipCode` as the partition key and `Timestamp` as the sort key. During a heatwave, the application experiences a surge in writes from a highly populated urban zip code, leading to numerous `ProvisionedThroughputExceededException` errors in the ingest client logs. An analysis reveals that the total table write capacity is underutilized, but requests to this specific zip code are being throttled.
Which TWO actions should a developer take to resolve the write throttling and optimize the table's performance? (Select TWO.)
Select all that apply
A gaming company is experiencing high read latency on a metadata table in Amazon DynamoDB, which is causing slow response times in their mobile leaderboard application. The read latency needs to be reduced from single-digit milliseconds to microseconds to support a real-time user experience. Which of the following caching solutions is the most appropriate to resolve this latency bottleneck?
A developer is troubleshooting a local Node.js application running inside a Docker container. The application uses the AWS SDK for JavaScript (v3) to read data from an Amazon DynamoDB table. The application is configured to run under a non-root user named `node` with a home directory at `/home/node`. The developer wants the containerized application to use the AWS credentials defined in the `dev-profile` profile from the host machine's `~/.aws/credentials` file. Which combination of actions will allow the application in the container to successfully authenticate using the `dev-profile` credentials? (Select TWO.)
Select all that apply
A client-side Next.js web portal hosted on https://portal.ecocharge.net sends a POST request to an Amazon API Gateway REST API configured with a Lambda Proxy integration to register new users. The API Gateway has CORS enabled on the resource. The web portal console shows a CORS error stating that the 'Access-Control-Allow-Origin' header is missing on the requested resource after the browser successfully completes the OPTIONS preflight request. Which of the following is the correct action to resolve this issue?
A developer is containerizing a Go application that retrieves messages from an Amazon SQS queue. For local testing, the application runs inside a Docker container on a local workstation. The developer has configured the AWS CLI on the host workstation with a default profile, and the CLI successfully connects to SQS. However, when the containerized application runs, it fails with a credentials provider error indicating that no credentials could be found. Which of the following is the most secure and appropriate way to resolve this credential error in the local development environment?
A developer is building a weather forecasting web application that retrieves current weather conditions from an Amazon DynamoDB table based on a postal code. The application experiences a large number of duplicate read requests for the same popular postal codes, resulting in high latency and read throttling. The developer wants to optimize the application's read performance with minimal changes to the application code. Which action should the developer take to resolve this issue?
A web-based partner portal hosted on `https://partner.datasync.io` receives a `502 Bad Gateway` error and a CORS block message in the browser console when sending a `PATCH` request to an Amazon API Gateway REST API. The API is configured with a Lambda Proxy integration. The developer checks the Amazon CloudWatch logs and confirms that the backend Lambda function executed successfully and returned the following JSON structure:
{
"statusCode": 200,
"body": "{\"message\": \"Update successful\"}"
}
Which action should the developer take to resolve this error?
A logistics tracking application named PackTrack records real-time delivery status updates for packages. The underlying Amazon DynamoDB table uses `PackageID` as the partition key and `StatusTimestamp` as the sort key. A fleet monitoring dashboard needs to display all deliveries that are currently delayed. To retrieve this data, the dashboard runs a weekly batch process using a `Scan` operation with a `FilterExpression` on the `DeliveryStatus` attribute where the value equals `DELAYED`. As package volume increases, the scan operation consistently throws `ProvisionedThroughputExceededException` errors, causing the dashboard to load partially or fail entirely, despite the developer scaling up the table's read capacity units (RCUs). Which of the following is the most cost-effective and appropriate solution to resolve this throttling issue?
A developer is troubleshooting a local C# (.NET) console application that uses the AWS SDK for .NET to read objects from an Amazon S3 bucket. The developer has configured the AWS CLI on their workstation with a named profile called `dev-profile` containing valid AWS credentials. However, when executing the application locally, it throws an `AmazonServiceException` indicating that the credentials cannot be found. No environment variables are set on the workstation, and the SDK is initialized using default client configuration. Which of the following actions is the most secure and appropriate way to resolve this credential error for local development?
A digital library application retrieves book metadata from an Amazon DynamoDB table. During a reading campaign, a few popular books receive a high volume of read requests, causing DynamoDB read throttling. The developer wants to implement a caching solution to reduce read latency to sub-milliseconds for these popular books with minimal changes to the application code.
Which two actions should the developer take to resolve the throttling and meet the performance requirements? (Select two.)
Select all that apply
An online banking application retrieves user transaction history using an Amazon DynamoDB table. During end-of-month processing, users experience high query latencies, and the application log shows frequent `ProvisionedThroughputExceededException` errors on read operations. The primary key structure uses a partition key of `UserId` and a sort key of `TransactionTimestamp`. The developer plans to implement Amazon DynamoDB Accelerator (DAX) to achieve sub-millisecond read latency and alleviate the read workload on the DynamoDB table. The application code currently initiates reads with the parameter `ConsistentRead` set to `true`.
Which combination of actions must the developer take to resolve the performance issue and successfully utilize caching? (Select two.)
Select all that apply
A developer is optimizing a reporting service that retrieves product catalog listings from an Amazon DynamoDB table. The service frequently executes the same Query operations to retrieve items by category. To reduce latency, the developer deploys an Amazon DynamoDB Accelerator (DAX) cluster and updates the application code to use the DAX SDK client. While individual GetItem operations now exhibit sub-millisecond latency, the Query operations continue to experience high latency and consume the table's Provisioned Throughput. Which modification should the developer make to ensure the Query operations are successfully cached by DAX?
A developer is using the AWS Serverless Application Model (AWS SAM) CLI to test an AWS Lambda function locally by running the `sam local invoke` command. The Lambda function, written in Node.js, uses the AWS SDK for JavaScript (v3) to read from an Amazon DynamoDB table in the cloud.
When the developer runs the function locally, the SDK operations fail with an `AccessDeniedException`. The developer has already configured a local AWS CLI profile named `developer-local` in the `~/.aws/credentials` file on the host machine. This profile possesses all necessary permissions to access the DynamoDB table. The developer has also set the environment variable `AWS_PROFILE=developer-local` on the host command line.
Which actions should the developer take to ensure the locally running function has access to the credentials? (Select TWO.)
Select all that apply
A developer is troubleshooting a serverless application where an AWS Lambda function written in C# (.NET) processes order events. The Lambda function is invoked by an Amazon API Gateway REST API. The function makes downstream HTTP calls to a third-party payment gateway and performs read/write operations on an Amazon DynamoDB table. Active tracing is enabled on both the API Gateway stage and the Lambda function. However, when inspecting the AWS X-Ray console, the developer observes that while the API Gateway and Lambda function segments appear, the HTTP calls to the payment gateway and the DynamoDB operations are missing from the trace.
Which of the following actions should the developer take to record the downstream calls in the X-Ray traces?
A developer is troubleshooting a Python application on a local development workstation. The application uses the AWS SDK for Python (Boto3) to interact with AWS resources.
The developer has configured two profiles in the local `~/.aws/credentials` file: a `default` profile and a `custom-dev` profile.
To test the application locally, the developer runs the following commands in the terminal:
bash
export AWS_PROFILE=custom-dev
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
When the developer runs the application, they notice that the SDK uses the IAM credentials from the environment variables rather than the configuration defined for `custom-dev` in the credentials file.
Why does the AWS SDK execute the requests using the environment variable credentials instead of the `custom-dev` profile?
A ticket booking application named TicketSwift records concert reservations in an Amazon DynamoDB table. The table uses ConcertID as the partition key and BookingTimestamp as the sort key. During major ticket releases, the application experiences a surge in ProvisionedThroughputExceededException errors, even though the total read and write capacity units (RCUs and WCUs) are auto-scaled and remain well below the table-level limits. An analysis shows that millions of requests are targeting a single popular concert within a few minutes. Which combination of actions will resolve this throttling issue and optimize key distribution? (Select TWO.)
Select all that apply
A developer is troubleshooting a serverless application deployed on AWS Lambda. The application logs events in a structured JSON format to Amazon CloudWatch Logs. The developer needs to configure CloudWatch metric filters to monitor two separate issues:
1. Lambda function execution timeouts, which generate service-level log lines containing the string: `Task timed out after`
2. Application API failures, where the log events are JSON objects containing a key `statusCode` with a value of 500 or greater.
Which two configurations should the developer implement to achieve this? (Select TWO.)
Select all that apply
RideFlow is a ride-sharing platform that logs completed trips to an Amazon DynamoDB table. The table is configured with provisioned write capacity. The table's partition key is CityID and the sort key is TripTimestamp. During peak commute times, the platform experiences a high volume of writes for the city code NYC. As a result, the application logs ProvisionedThroughputExceededException errors, even though the total consumed write capacity units (WCUs) for the entire table are significantly below the provisioned threshold. Which strategy should a developer implement to resolve this throttling issue?
An application deployed on Amazon ECS writes JSON-formatted logs to Amazon CloudWatch Logs. A sample log event is shown below:
{
"statusCode": 500,
"errorType": "DatabaseTimeoutException",
"message": "Connection to database timed out."
}
The developer needs to create a CloudWatch Metric Filter to count the occurrences of this specific database timeout error. Which filter pattern should the developer use to match logs where the statusCode is 500 and the errorType is exactly DatabaseTimeoutException?