All practice questions
1542 questions
A developer is configuring a REST API using Amazon API Gateway. The backend integrates with an AWS Lambda function using a Lambda custom (non-proxy) integration. The client sends a GET request to the API with a query string parameter named `version`. The developer wants the Lambda function to receive a JSON payload structured exactly as `{"apiVersion": "<version_value>"}` in its input event.
Which configuration must the developer implement in API Gateway to satisfy this requirement?
A developer is designing a logistics application. Real-time location telemetry events from fleet vehicles are published to an Amazon SNS topic. Two separate backend services need to process these events:
1. A routing analysis service that must process events in the exact chronological order they were generated per vehicle to calculate path history, and must prevent duplicate events from being processed.
2. An alerting service that checks for speeding and can process events in any order, but needs to receive all telemetry events.
The developer wants to implement a fanout architecture using Amazon SNS and Amazon SQS. Which two configuration steps should the developer perform to meet these requirements? (Select TWO.)
Select all that apply
A developer is deploying an AWS Lambda function that reads incoming user data from an Amazon Kinesis data stream. The developer creates an IAM role with a permissions policy allowing the necessary Kinesis read actions. However, the Lambda function fails to retrieve data, and the logs indicate that the Lambda service is unauthorized to assume the configured execution role.
The trust policy attached to the IAM role is shown below:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "kinesis.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
How should the developer resolve this issue to allow the Lambda function to execute and read from the stream?
An application uses an Amazon SNS topic to publish customer signup events. These events are fanned out to an Amazon SQS queue, which is processed by a downstream AWS Lambda function. During peak traffic, the developers notice that the Lambda function is frequently invoked with duplicate messages for the same customer signup, although the message was published to the SNS topic only once.
Which of the following configuration changes is the most effective solution to prevent these duplicate invocations?
A developer is implementing a smart lock security system. Commands (such as `LOCK` and `UNLOCK`) sent to individual locks must be processed in the exact order they are received to prevent race conditions. The commands are published to an Amazon SNS FIFO topic, which fans out to Amazon SQS FIFO queues consumed by a fleet of processing workers. During testing, the developer notices that commands for different smart locks are occasionally blocking each other, causing high latency. Furthermore, consecutive identical commands for the same lock (e.g., two `LOCK` commands) are occasionally discarded. How should the developer configure the SNS FIFO topic and SQS FIFO queue parameters to resolve these issues?
A developer is configuring an AWS Lambda function in Account A () to write data to an Amazon DynamoDB table in Account B (). The developer wants to use a cross-account IAM role named `DynamoDBWriterRole` in Account B to perform the DynamoDB operations. The Lambda function runs under an execution role named `LambdaExecutionRole` in Account A. Which two configurations are required to establish this cross-account trust and allow the Lambda function to write to the table? (Select TWO.)
Select all that apply
A developer has implemented an AWS Lambda function in Node.js that processes orders and sends a response back to Amazon API Gateway. Inside the handler, the function sends tracking metrics to a third-party analytics API by initiating an asynchronous HTTP request without using an 'await' statement (a background promise). However, the developer notices that the Lambda function continues running and eventually times out, even though the main order processing logic completes and the callback is invoked. Which configuration change should the developer make to ensure the function returns the response immediately without waiting for the background tracking metrics request to complete?
A developer is configuring a warehouse inventory application that sends real-time stock level updates from multiple warehouses to an Amazon Kinesis Data Stream. To maintain chronological processing order of updates within each warehouse, all records for a specific warehouse must be routed to the same shard. Which approach should the developer use to meet this requirement?
A developer is designing a peer-to-peer mobile payment application. When a user initiates a funds transfer to another user, the application must perform three operations: deduct the transfer amount from the sender's account balance, add the transfer amount to the recipient's account balance, and record the transaction history in a log table. These operations must execute atomically so that either all of them succeed or all of them fail. Under high traffic, the system must maintain strict consistency and prevent throttling issues. Which implementation strategy should the developer use to meet these requirements?
An enterprise applications developer is troubleshooting a batch processing pipeline. An Amazon SQS standard queue receives transaction messages, which trigger an AWS Lambda function. The Lambda function's timeout is set to seconds. Under heavy load, the developer observes that several messages are being processed multiple times by concurrent Lambda executions, resulting in duplicate database entries. Analysis of the logs shows that the Lambda function is executing successfully without timing out or throwing errors.
Which configuration change should the developer implement to resolve the duplicate processing issue?
A developer is writing an AWS Lambda function that processes telemetry data sent from a custom web portal. The function must make an HTTP POST request to an external third-party API and then write the processed telemetry record to an Amazon DynamoDB table. During load testing, the developer observes high latencies due to connection setup overhead on each invocation and database access errors when trying to write to DynamoDB.
Which two changes should the developer make to optimize the performance of the function and ensure secure access to DynamoDB? (Select two.)
Select all that apply
A developer is building a serverless payment processing application. The application uses an Amazon SQS queue to trigger an AWS Lambda function. The Lambda function must connect to an Amazon RDS database residing in a private VPC subnet and also call an external payment gateway API over the internet. The Lambda function has a timeout of seconds. Which two configuration steps must the developer perform to ensure reliable processing and correct connectivity? (Select two.)
Select all that apply
A developer is configuring an AWS CodeBuild project in Account that must retrieve database configuration credentials from AWS Systems Manager Parameter Store in Account . The developer creates an IAM role named CrossAccountParamReaderRole in Account with permission to read the parameters.
The CodeBuild project's service role in Account has permissions to assume CrossAccountParamReaderRole. However, during the build phase, the CodeBuild build fails with an AccessDenied error when executing the assume-role CLI command.
The trust policy for CrossAccountParamReaderRole in Account is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "codebuild.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which modification to the trust policy in Account will resolve this issue?
A compliance scanning service utilizes an AWS Lambda function deployed in private subnets to access a private Amazon DocumentDB cluster. To validate document checksums, the function must also call an external verification service on the public internet. During high-concurrency event bursts, the Lambda function frequently exceeds its configured timeout when establishing connections to both DocumentDB and the external verification service. Which combination of steps should the developer take to resolve the timeouts and optimize connection performance?
A developer is designing a telemetry ingestion pipeline for IoT smart meters. The metrics are published to an Amazon Kinesis Data Stream with 4 shards. The producer application currently uses the MeterID as the partition key. Because a subset of the smart meters generates a significantly higher volume of events, the developer observes frequent ProvisionedThroughputExceededException errors on specific shards during peak hours, while other shards remain underutilized. Additionally, a new requirement specifies that critical maintenance alarms embedded in the telemetry payload must be immediately routed to an Amazon EventBridge custom event bus for downstream processing. Which TWO actions should the developer take to resolve the partition throughput issues and route the critical alarms?
Select all that apply
A developer is designing a retail ordering system. When an order is placed, the payment service must notify both a Fulfillment service and an Inventory service. Both services must receive and process every order message independently. The Inventory service processes messages at a slower rate than the Fulfillment service, so each service must be able to buffer and consume messages at its own pace. Which combination of steps should the developer perform to meet these requirements? (Select TWO.)
Select all that apply
A developer is building a serverless application where an AWS Lambda function processes records from an Amazon Kinesis data stream. During testing, some malformed records cause the Lambda function to return an error, which causes the entire batch of records to be retried repeatedly. This retry behavior blocks the stream partition and causes processing latency to increase. The developer wants to configure the event source mapping to automatically split the failed batch and retry the smaller batches to isolate the malformed records. Which configuration change should the developer implement to achieve this goal?
A developer is designing an integration for an Amazon API Gateway REST API. The API needs to receive incoming JSON payloads from clients and write them directly into an Amazon SQS queue without using an intermediate AWS Lambda function. Which two configurations must the developer perform in API Gateway to implement this integration? (Select TWO.)
Select all that apply
A developer is configuring a local application to access an Amazon DynamoDB table in an AWS account. To comply with security best practices, the application must run locally by assuming an IAM role named DbAccessRole using temporary credentials. The developer has a local AWS CLI profile named dev-user configured with IAM user credentials.
Which two actions must the developer take to configure the application to assume the role?
Select all that apply
A developer is building a serverless photo-sharing application that allows users to upload JPEG images. The application uses an Amazon API Gateway REST API with an AWS Lambda proxy integration to process the uploads. During testing, the developer discovers that the image files processed by the Lambda function are corrupted because the binary payload is being treated as UTF-8 string data instead of binary data. Which configuration steps must the developer take to resolve this issue?