All practice questions
1542 questions
A developer is building a corporate timesheet application where employee hours are stored in an Amazon DynamoDB table. The table uses `EmployeeID` as the partition key and `LogDate` as the sort key. The application needs to retrieve and display a list of all work logs for a specific employee during the month of June 2026. The operation must be optimized to minimize latency and Read Capacity Unit (RCU) consumption.
Which DynamoDB configuration and operation should the developer use to retrieve this data?
A logistics company uses an Amazon DynamoDB table to store tracking updates for shipments. The table uses ShipmentID as the partition key and Timestamp as the sort key. The application needs to retrieve all tracking updates for a specific ShipmentID that occurred within a given 48-hour window. The table contains millions of items representing shipments from the last year. How should the developer implement this retrieval to optimize read throughput and minimize latency?
An organization's monorepo structure places the build configuration for the payment module in a file named buildspec-payment.yml inside the /services/payment/ directory. The module requires a payment gateway API key that is securely stored in AWS Secrets Manager. During the build, CodeBuild fails to locate the build configuration, and the application cannot retrieve the API key. Which two steps must be performed to resolve these failures? (Select TWO.)
Select all that apply
A mobile application client receives a 502 Bad Gateway error when calling a REST API endpoint. The endpoint is configured with Amazon API Gateway using a Lambda Proxy integration. Upon reviewing the Amazon CloudWatch logs, the developer confirms that the backend Lambda function executed successfully and completed without timing out. Which of the following is the most likely cause of this error?
A developer is creating an Amazon ECS task definition to deploy a containerized application on AWS Fargate. The application needs to pull its container image from a private Amazon ECR repository in the same AWS account. Additionally, the application code itself must make calls to the Amazon Translate API to translate user reviews at runtime. Which configuration of IAM roles will allow the task to pull the image and run successfully with the least privilege?
A development team has configured an AWS CodeBuild project to run inside a private subnet of a VPC. During the build execution, the project fails because it cannot download external package dependencies from the internet. Additionally, subsequent runs are taking a long time because the dependencies are fully downloaded from scratch each time. Which two actions should the developer take to resolve the internet connectivity issue and speed up the builds? (Select TWO.)
Select all that apply
An API gateway service writes usage logs for a multi-tenant software application. Each log entry is a JSON object containing `tenant_id`, `request_id`, `timestamp`, and `response_time`. A developer configures Amazon Kinesis Data Streams to ingest these logs for real-time usage billing calculations. During peak hours, the stream encounters `ProvisionedThroughputExceededException` errors on a single shard, even though the total write throughput is well below the overall provisioned capacity of the stream. The developer discovers that the partition key is set to the tenant's geographic region, which has only three possible values. Which partition key strategy should the developer implement to resolve this issue and distribute the workload evenly across all shards?
A developer is building a digital coupon distribution service. The application stores coupon details in an Amazon DynamoDB table. The table uses as the partition key and as the sort key. The application needs to retrieve all coupons that belong to a specific attribute to calculate current redemption metrics. The attribute is not part of the primary key. Which DynamoDB operation or design configuration should the developer implement to retrieve this data with the lowest latency and minimal Read Capacity Unit (RCU) consumption?
A developer is designing a backend service for a ride-sharing application that stores ride details in an Amazon DynamoDB table. The base table uses `RideId` as the partition key. Each item contains attributes such as `RiderId`, `DriverId`, `Fare`, `RideDate`, and `Status` (which can be 'Requested', 'Ongoing', or 'Completed').
The application needs to retrieve the most recent completed rides for a specific driver to display on a dashboard.
Which approach is the most efficient and cost-effective to meet these requirements?
A developer is maintaining a real-time smart home telemetry system. Devices send sensor updates to an Amazon Kinesis Data Stream with 4 shards. A consumer AWS Lambda function, triggered by an event source mapping, processes these records. During peak hours, the developer notices a high rate of ProvisionedThroughputExceededException errors on the stream. CloudWatch metrics indicate that two of the shards are receiving almost all of the traffic, while the other two shards remain idle. The stream partition key is currently set to the device's region_id (representing one of four geographic zones). Which two actions should the developer take to resolve the throttling and ensure data is distributed evenly? (Select TWO.)
Select all that apply
A developer is designing an Amazon DynamoDB table named `UserActivities` to track user actions in a web application. The table's primary key is configured with `UserID` as the partition key and `ActivityTimestamp` as the sort key.
The application needs to support the following operations:
1. Retrieve all activities for a specific `UserID` that occurred within a particular date range, sorted by timestamp.
2. Retrieve all activities of a specific `ActivityType` (such as 'login' or 'purchase') across all users, sorted by the timestamp of the activity.
The developer wants to implement this with optimal performance and minimal read capacity consumption.
Which two actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is building a fleet monitoring application that tracks delivery vehicle telemetry. The application stores telemetry data in an Amazon DynamoDB table with `VehicleID` as the partition key and `Timestamp` as the sort key. The table contains millions of records spanning thousands of unique vehicles. The application needs to retrieve all telemetry logs for a specific vehicle within a given 24-hour window. Which of the following is the most efficient and cost-effective approach to retrieve this data?
A developer is writing an AWS Lambda function that retrieves the most recent orders for a specific customer from an Amazon DynamoDB table named `Orders`. The table has a partition key of `CustomerID` and a sort key of `OrderDate`, and contains millions of records.
Which two options should the developer configure in the DynamoDB API request to retrieve the required data in the most resource-efficient manner? (Choose two.)
Select all that apply
A developer is designing a secure file upload utility for a containerized microservice. The utility must encrypt files up to locally before uploading them to an Amazon S3 bucket named `my-app-data`. To comply with strict security and auditing guidelines, the solution must satisfy the following requirements:
1. Ensure that plaintext data keys are never persisted or stored in any AWS service.
2. Prevent unauthorized decryption if the encrypted files are copied to a different S3 bucket.
3. Minimize AWS KMS API calls to avoid rate-limiting/throttling and control costs.
4. Record all cryptographic key usage in AWS CloudTrail for auditing.
Which KMS API workflow and architecture meets these requirements?
A developer is building a serverless REST API using Amazon API Gateway and AWS Lambda. The API must authenticate users who are managed in an external identity provider that supports OpenID Connect (OIDC). The requirements specify that the solution must minimize custom code, validate the JSON Web Token (JWT) at the API Gateway layer, and securely pass user attributes—such as custom groups—to the backend Lambda function for fine-grained authorization. Additionally, the client application must not need to manage or sign requests with temporary AWS credentials.
Which architecture should the developer implement to meet these requirements with the least administrative effort?
A developer is deploying a containerized application to Amazon ECS on AWS Fargate using the following task definition snippet:
{
"containerDefinitions": [
{
"name": "app-container",
"image": "111122223333.dkr.ecr.us-east-1.amazonaws.com/my-app:latest",
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-group": "/ecs/my-app",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
}
}
}
],
"taskRoleArn": "arn:aws:iam::111122223333:role/MyTaskRole",
"executionRoleArn": "arn:aws:iam::111122223333:role/MyExecutionRole"
}
The application code inside the container must read and delete messages from an Amazon SQS queue. The ECS agent must pull the private container image from Amazon ECR and send container logs to Amazon CloudWatch Logs.
Which of the following configurations must the developer perform to grant the necessary permissions? (Select TWO.)
Select all that apply
A developer is managing a production web application deployed via an AWS CloudFormation stack. The stack consists of an Amazon RDS DB instance, an Amazon EC2 Auto Scaling group, and an IAM role associated with the EC2 instances. To troubleshoot a connection issue, an administrator manually modified the EC2 security group rules and deleted the IAM role directly in the AWS Management Console. During a subsequent stack update to upgrade the database instance class, the update failed and the stack is now in the UPDATE_ROLLBACK_FAILED state. Which two actions should the developer take to resolve the stack status and reconcile the resource configurations? (Select TWO.)
Select all that apply
A software developer is writing a data reconciliation script that runs on AWS Lambda. The script must retrieve credentials from AWS Secrets Manager and query a PostgreSQL database hosted on an Amazon RDS instance that resides in the private subnets of a custom VPC. The Lambda function must run inside the custom VPC to connect to the database. Security policies require that all network traffic between the Lambda function, the database, and AWS Secrets Manager remains entirely within the VPC.
Which of the following actions should the developer take to establish secure and functional network connectivity for the Lambda function? (Select TWO.)
Select all that apply
A development team is building a mobile application for a bicycle-sharing service. The app allows users to log in using their social media accounts. The backend services expose a REST API hosted on Amazon API Gateway, backed by AWS Lambda. Additionally, the mobile app needs to upload user-generated profile photos directly to a private Amazon S3 bucket without routing the files through the application's backend.
Which two architectural steps should the developer take to implement authentication, API authorization, and secure S3 uploads with the least amount of custom code?
Select all that apply
A developer is managing a web application deployed using an AWS CloudFormation stack. The stack includes an Amazon ECS task definition, an IAM execution role, and an Amazon DynamoDB table. During a troubleshooting session, an administrator manually deleted the IAM execution role directly from the IAM Console. Subsequently, the developer attempted to update the CloudFormation stack to adjust the CPU allocation for the ECS tasks. The update failed, and the stack is now stuck in the UPDATE_ROLLBACK_FAILED state. The developer needs to resolve the rollback failure and successfully apply the new CPU allocation. Which two actions should the developer take to achieve this? (Select TWO.)
Select all that apply