Troubleshooting and Optimization
271 questions
A developer is troubleshooting an AWS Lambda function that processes transaction files stored in an Amazon S3 bucket and updates a database running on an Amazon RDS MySQL DB instance. The RDS instance is deployed in private subnets of a custom VPC.
To enable the Lambda function to access both Amazon S3 and the RDS instance, the developer configured the function to run within the VPC and associated it with the public subnets of the VPC. The Lambda function's security group is correctly allowed in the RDS security group's inbound rules.
During execution, the function fails with a timeout error. The logs show that the connection to the RDS DB instance is successful, but the function times out after seconds while attempting to connect to the Amazon S3 service endpoint.
Which two actions should the developer take to resolve this issue and follow AWS security best practices? (Select TWO.)
Select all that apply
A developer has a Python-based worker application running on Amazon EC2 instances. The application manually polls an Amazon SQS queue for incoming messages, processes them, and writes the results to an Amazon DynamoDB table. The AWS X-Ray daemon is running on the EC2 instances, and the AWS SDK for Python (boto3) is instrumented. However, in the AWS X-Ray console, the developer observes that the traces for the SQS queue and the DynamoDB operations appear as separate, disconnected traces rather than a single end-to-end trace.
Which action should the developer take to correlate these traces?
A developer is running a local Node.js application that uses the AWS SDK to read from an Amazon S3 bucket. During local testing, the application fails to connect to AWS and throws a credential loading error. Which two actions should the developer take to resolve this issue securely? (Select TWO.)
Select all that apply
A developer is troubleshooting a local Python application that uses the Boto3 SDK to retrieve configuration parameters from AWS Systems Manager Parameter Store. The developer previously configured the local machine using the AWS CLI and confirmed that the shared credentials file (~/.aws/credentials) contains valid credentials under the default profile. However, when executing the script in a terminal session, the application returns a signature mismatch error (SignatureDoesNotMatch).
Which of the following is the most likely cause of this error?
A developer is troubleshooting a local Java application that is failing to authenticate with Amazon DynamoDB. The developer has configured a profile in the shared credentials file (~/.aws/credentials) and also set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables in the terminal session.
In which of the following locations will the default credential provider chain look to resolve credentials, and which has higher precedence? (Select TWO.)
Select all that apply
A developer is running a local Node.js application that uses the AWS SDK for JavaScript (v3) to read data from an Amazon DynamoDB table. The local machine has multiple AWS profiles defined in the `~/.aws/credentials` file. When executing the application, it fails with an `AccessDeniedException` because it attempts to use the default profile instead of a specific profile named `development-admin`. Which of the following actions can the developer take to resolve this issue? (Select TWO.)
Select all that apply
A developer is testing a Go application locally that reads messages from an Amazon SQS queue. The developer intends to run the application using a specific AWS CLI profile named `dev-profile` defined in the `~/.aws/credentials` file. However, when executing the application in the terminal, the application connects using credentials from a different AWS account. The developer notices that the environment variables `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` are currently set in the active terminal session. Which of the following actions will resolve this issue and force the Go SDK to use the configuration from `dev-profile`?
An AWS Lambda function is configured to upload generated reports to an Amazon S3 bucket. During execution, the Lambda function fails to write to the bucket and returns an 'Access Denied' error. How should the developer resolve this authorization failure?
An application container deployed on Amazon ECS tasks is designed to read encrypted objects from an Amazon S3 bucket. The objects are encrypted using an AWS KMS customer managed key. During execution, the application receives an 'Access Denied' error when trying to retrieve and decrypt the files. Which two configurations should the developer verify or modify to resolve this authorization failure? (Select TWO.)
Select all that apply
A developer is troubleshooting an AWS Lambda function that processes batch files. The function fails during execution, and the Amazon CloudWatch logs show the message: "Task timed out after seconds". The developer realizes the function requires at least minutes to process the files. Which configuration change will resolve this issue?
A developer is troubleshooting an AWS Lambda function that processes customer orders and writes them to an Amazon RDS PostgreSQL database located in a private subnet. The Lambda function is configured to run inside the same VPC and private subnets. Additionally, the Lambda function must call a third-party payment gateway endpoint on the public internet. During execution, the Lambda function successfully connects to the database but fails with a timeout error when attempting to reach the payment gateway. Which configuration change is required to resolve this execution issue?
A developer has configured a microservice to perform actions in a different AWS account by assuming an IAM role. The microservice's execution role has an IAM policy that allows the sts:AssumeRole action on the target role's ARN. During execution, the microservice fails to assume the target role and receives an AccessDenied error. Which of the following is the most likely cause of this authorization failure?
An AWS Lambda function is configured to run inside private subnets of a custom VPC. The function needs to call a public external payment gateway API and also write results to an Amazon DynamoDB table. During testing, the function successfully connects to DynamoDB via a VPC gateway endpoint, but the connection attempts to the external payment gateway API consistently fail with connection timeout errors. The Lambda function's execution role has the AWSLambdaVPCAccessExecutionRole policy attached, and its security group allows all outbound traffic. Which two actions must the developer take to resolve the external API connectivity issue?
Select all that apply
A serverless order processing application utilizes an AWS Lambda function to send confirmation emails via a third-party API. The function is also configured to access an Amazon Aurora PostgreSQL database in a private subnet. The developer has configured the Lambda function to run inside the private subnets of the VPC to enable database access.
During testing, the developer observes two issues:
1. The Lambda function fails to connect to the third-party email API.
2. The database connection pool is frequently exhausted, and Lambda execution logs show connection timeouts during concurrent invocations.
Which two actions should the developer take to resolve these issues?
Select all that apply
A backend service uses an AWS Lambda function to process data files uploaded to Amazon S3. During execution, the function stops processing before completing, and the Amazon CloudWatch logs report that the function reached its configured execution limit of . Which action should the developer take to resolve this issue?
A developer has configured an AWS Lambda function in AWS Account A to send messages to an Amazon Simple Queue Service (Amazon SQS) queue located in AWS Account B. During execution, the Lambda function fails with an AccessDenied error when attempting to write to the queue. Which two actions are required to resolve this authorization failure? (Select TWO.)
Select all that apply
An application uses an AWS Lambda function associated with private subnets of a VPC to perform write operations on an Amazon RDS PostgreSQL database. The function also needs to write tracking data to an Amazon DynamoDB table, but the write operations to DynamoDB are failing with connection timeout errors. Which two actions should a developer take to resolve this connectivity issue? (Select TWO.)
Select all that apply
A developer is containerizing a Python microservice that uses the AWS SDK (Boto3) to retrieve objects from an Amazon S3 bucket. During local development on a macOS host, the developer runs the application in a Docker container using Docker Desktop. The container fails to authenticate with AWS and throws a `NoCredentialsError`. The host machine's AWS CLI is configured with a default profile and a named profile `local-dev` that contains active credentials.
Which TWO actions should the developer perform to resolve this authentication failure and allow the containerized application to use the `local-dev` credentials? (Choose two.)
Select all that apply
A telemetry ingestion system uses an AWS Lambda function to write incoming data to an Amazon RDS PostgreSQL database instance. To optimize performance and reduce database connection overhead, the developer initializes a single database connection pool outside the Lambda handler function (in the global scope). During testing, the function runs successfully under continuous load. However, during periods of low traffic, subsequent invocations of the Lambda function fail, resulting in a `Task timed out after 15.02 seconds` error. CloudWatch logs indicate that the function hangs at the database query execution line. Which of the following is the most likely cause of this issue, and how should it be resolved?
A developer is troubleshooting an AWS Lambda function that processes incoming sensor telemetry. The function is configured to run inside a custom VPC and must write data to an Amazon Aurora PostgreSQL database located in a private VPC subnet. Additionally, the Lambda function must call a public HTTPS endpoint of an external device registry for validation on each invocation.
The function configuration is associated with two subnets: `subnet-0a` (a private subnet with a route to a NAT Gateway) and `subnet-0b` (a public subnet with a route to an Internet Gateway). During execution, the developer observes that connection attempts to the Aurora database succeed of the time. However, approximately of the Lambda invocations fail due to connection timeouts when the function attempts to call the external validation API.
Which of the following actions will resolve the execution timeouts while maintaining access to both the database and the external API?