All practice questions
1542 questions
An application team wants to minimize unnecessary backend processing by validating client requests directly at the API Gateway layer before invoking a downstream AWS Lambda function. The REST API must verify that client requests contain a valid JSON payload matching a specific schema, and automatically reject invalid requests with an HTTP Bad Request error. Which two configuration steps should the developer perform in Amazon API Gateway to achieve this? (Select TWO.)
Select all that apply
A developer is configuring an application running on an Amazon EC2 instance in Account B () to read objects from an Amazon S3 bucket named `data-bucket` located in Account A (). The EC2 instance uses an IAM instance profile with an IAM role named `ReaderRole`.
The developer has attached the following IAM policy to `ReaderRole` in Account B:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:GetObject"
],
"Resource": "arn:aws:s3:::data-bucket/*"
}
]
}
However, the application receives an AccessDenied error when attempting to download objects from `data-bucket`.
Which action should the developer take to resolve this error?
A developer is designing a fleet management system that tracks delivery drone telemetry. Telemetry data is ingested into an Amazon DynamoDB table with the following schema:
* Base Table: `DroneTelemetry`
* Partition Key: `DroneID` (String)
* Sort Key: `ReadingTimestamp` (Number, Unix epoch time)
* Attributes: `BatteryLevel` (Number), `Latitude` (Number), `Longitude` (Number), `Status` (String)
The developer needs to implement the following requirements:
1. Retrieve all telemetry data for a specific drone within the last hours to plot its flight path.
2. Periodically identify drones that currently have a `Status` of `'Critical'` across the entire fleet.
Which two strategies should the developer implement to meet these requirements with optimal performance and minimum Read Capacity Unit (RCU) consumption? (Choose two.)
Select all that apply
A developer is designing a decoupled backend architecture for a banking application to process real-time transaction events. The application requires that transaction events are processed in the strict order they occur, and duplicate transactions must be prevented. The developer configures an Amazon SNS FIFO topic to receive transaction events. The developer wants to fan out these events to two different backend consumer services: a ledger service and a fraud detection service. To support this, the developer creates an Amazon SQS FIFO queue named LedgerQueue.fifo and an Amazon SQS Standard queue named FraudQueue. When attempting to subscribe both queues to the SNS FIFO topic, the subscription for FraudQueue fails. How can the developer resolve this subscription failure while maintaining the application's strict ordering and duplication requirements?
A developer is configuring an Amazon API Gateway REST API that integrates with an external HTTP backend service. The client sends a GET request containing a query string parameter named `id`. The backend service requires a POST request with a JSON payload in the format `{"customerId": "value"}`. Which configuration should the developer implement in API Gateway to meet these requirements?
A company is deploying a serverless microservice that requires access to an Amazon RDS database. The database credentials must be rotated every 30 days. The design requires that the microservice retrieves these credentials securely, minimizes latency during invocations, and minimizes Secrets Manager API call costs. Which two actions should be taken to meet these requirements? (Select two.)
Select all that apply
A developer is configuring a Lambda function named `DataProcessor` in AWS Account A () to write records to an Amazon DynamoDB table in AWS Account B (). The Lambda function's execution role is named `LambdaExecutionRole`.
To facilitate cross-account access, the developer creates an IAM role named `CrossAccountDynamoDbRole` in Account B with a permission policy that allows writing to the DynamoDB table. The trust policy for `CrossAccountDynamoDbRole` in Account B is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:role/LambdaExecutionRole"
},
"Action": "sts:AssumeRole"
}
]
}
Which TWO additional actions must the developer take to enable the Lambda function to write to the DynamoDB table? (Select TWO.)
Select all that apply
An AWS Lambda function in Account A () uses its execution role, `LambdaExecutionRole`, to retrieve parameters from AWS Systems Manager Parameter Store in Account B (). To perform this task, the function's code executes an AWS STS `AssumeRole` API call targeting an IAM role in Account B named `ParameterReaderRole`. Although `LambdaExecutionRole` is granted permissions to perform `sts:AssumeRole` on the target resource, the invocation fails with an `AccessDenied` error. The trust policy for `ParameterReaderRole` is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
How should the developer modify the trust policy of `ParameterReaderRole` to resolve this issue?
A developer is building a serverless web application using Amazon API Gateway and an AWS Lambda function with a Lambda proxy integration. During testing, client HTTP requests receive an HTTP 502 Bad Gateway error. The CloudWatch logs show that the Lambda function completed its execution successfully and returned the application data as a plain JSON string. How can the developer resolve this issue?
A developer is building a fleet management system that tracks real-time vehicle locations. The telemetry data is stored in an Amazon DynamoDB table with `VehicleID` as the partition key and `Timestamp` as the sort key. The developer needs to retrieve the location data for a specific vehicle over the past hours. Which of the following approaches should the developer use to retrieve this data with the lowest latency and minimal Read Capacity Unit (RCU) consumption?
A developer is configuring a serverless application where an Amazon Simple Queue Service (Amazon SQS) queue triggers an AWS Lambda function to process messages. During integration testing, the developer notices that some messages are being processed multiple times by different Lambda invocations, even though the Lambda function eventually runs successfully. The Lambda function is currently configured with an execution timeout of . Which two actions should the developer take to resolve this issue? (Select two.)
Select all that apply
A developer is building a medical monitoring application that stores periodic heart rate readings from wearable sensors in an Amazon DynamoDB table. The table uses `DeviceID` as the partition key and `Timestamp` as the sort key. The developer needs to retrieve all heart rate readings for a specific device that are greater than within a specific -hour window. Which two actions should the developer take to achieve this requirement?
Select all that apply
A developer is building a high-throughput transaction ledger consumer that runs as a containerized service on Amazon ECS. The service polls messages from an Amazon SQS FIFO queue, processes the transactions, and writes the results to an external database.
The queue is configured with a default visibility timeout of seconds. Under heavy load, the database response times slow down, and processing a batch of messages can take up to seconds. Consequently, transaction records are being duplicated in the database because messages are returning to the queue before processing is complete. Additionally, the ECS task is experiencing performance degradation due to client initialization overhead.
Which of the following actions should the developer take to resolve the duplication issues and optimize client performance? (Select TWO.)
Select all that apply
A developer is building a movie ticket booking platform. The ticket reservation details are stored in an Amazon DynamoDB table with as the partition key. To generate real-time metrics, the application must frequently retrieve all reservations associated with a specific . The query must be highly performant and cost-effective as the database grows.
Which solution meets these requirements with the lowest latency and resource consumption?
A developer is configuring an AWS Lambda function to process messages from an Amazon SQS standard queue. The Lambda function has a timeout of 20 seconds. The SQS queue has a default visibility timeout of 20 seconds. During testing, the developer observes that some messages are processed more than once by different Lambda executions. Which configuration change should the developer make to resolve this issue?
An e-commerce order fulfillment system uses an Amazon SQS standard queue to trigger an AWS Lambda function for invoice generation. The third-party invoicing API can take up to seconds to respond, so the developer configures the Lambda function's timeout to seconds. During high-traffic periods, customers report receiving duplicate invoices for a single order. Additionally, the developer must ensure that the Lambda function can authenticate with SQS securely without storing access keys in the codebase.
Which two actions should the developer take to resolve the duplication issue and ensure secure credentials management? (Select TWO.)
Select all that apply
A developer is implementing a web analytics pipeline where user interaction events are sent to a custom Amazon EventBridge event bus. The developer configures an EventBridge rule to route these events to an Amazon Kinesis Data Stream for real-time analytics. The stream has 10 active shards to handle the expected volume. The developer wants to ensure that all events for any given user session are processed in chronological order by the consumer application, while also distributing the write load evenly across all shards to prevent write throttling.
Which target configuration in EventBridge meets these requirements?
A developer is building a collaborative project management application where team members can assign tasks to each other. The application stores task details in an Amazon DynamoDB table with `` as the partition key and `` as the sort key.
The developer needs to implement two requirements:
1. Retrieve all tasks within a specific project that have a status of 'In Progress'.
2. Retrieve all tasks across all projects assigned to a specific team member using their ``.
Additionally, the developer must initialize the AWS SDK DynamoDB client securely within an AWS Lambda function that executes these queries.
Which two actions should the developer take to meet these requirements efficiently and securely? (Select two.)
Select all that apply
A developer is building a serverless application where an AWS Lambda function writes records to a legacy on-premises database. The database can handle a maximum of 10 concurrent connections. During peak hours, traffic spikes cause the Lambda function to scale, which overloads the database and causes connections to drop. How should the developer configure the Lambda function to prevent overloading the database?
A developer is configuring an AWS Lambda function to process real-time financial transactions from an Amazon Kinesis Data Stream. The function must validate each transaction by invoking a third-party payment gateway's public API endpoint over the internet, and then save the transaction status to an Amazon RDS database located in a private subnet of a VPC.
The developer configures the Lambda function to run inside the same VPC and private subnet as the RDS database. During testing, the developer observes that the Lambda function is successfully triggered by the Kinesis stream but consistently times out after 15 seconds without executing the API call or database write.
What is the root cause of this issue and how should it be resolved?