All practice questions
1542 questions
A developer is configuring an AppSpec file in YAML format for an AWS CodeDeploy deployment targeting Amazon ECS. The developer needs to run a validation Lambda function immediately after the replacement task set is created, but before any traffic shifts to the new version. Which of the following configurations correctly implements this requirement?
A company runs a critical web application on AWS Elastic Beanstalk. The application must maintain of its capacity to handle peak traffic during updates. Additionally, if the new version fails post-deployment, the developer must be able to roll back to the previous version immediately with minimal service impact and without triggering a new application deployment.
Which two Elastic Beanstalk deployment strategies meet these requirements? (Select TWO).
Select all that apply
A software company operates a multi-tenant SaaS application that stores client organization profiles in an Amazon DynamoDB table. To minimize read latency for authorization checks, the developer deployed an Amazon DynamoDB Accelerator (DAX) cluster. However, an administrative microservice updates these organization profiles by writing directly to the DynamoDB table. Consequently, users report that profile updates take up to five minutes to reflect in the main application. Which of the following developer actions will resolve this cache staleness issue most efficiently?
A developer is configuring an AWS CodeBuild project to deploy an infrastructure stack using AWS CloudFormation. The deployment process requires CloudFormation to assume a specific IAM service role named `CFNDeploymentRole` to create resources. The CodeBuild build container runs under an IAM role named `CodeBuildExecutionRole`.
Which two configuration steps must the developer perform to ensure the deployment succeeds? (Select two.)
Select all that apply
An IoT telemetry collection service named FleetVibe writes real-time status updates from delivery trucks to an Amazon DynamoDB table. The table is configured with provisioned write capacity and uses the FleetDivision attribute (e.g., 'US-East', 'EU-West') as the partition key. During peak hours, the application experiences write throttling and throws ProvisionedThroughputExceededException errors, even though the total consumed write capacity is well below the table's provisioned limit. Application logs reveal that the client application immediately fails and drops data upon receiving the throttling errors. Which TWO actions should the developer take to resolve the write throttling and prevent data loss? (Select TWO.)
Select all that apply
A developer is designing a smart-home mobile application that allows authenticated users to read their device telemetry data directly from an Amazon DynamoDB table. The solution must minimize backend server management and allow the mobile app to make direct, secure SDK calls to DynamoDB using temporary AWS credentials, restricting users to only access their own data. Which architecture should the developer implement to meet these requirements?
A developer is configuring a third-party SaaS monitoring application to collect performance metrics from Amazon EC2 instances in their AWS account. The SaaS vendor's application runs in AWS account 123456789012. The vendor requires a secure delegation mechanism using an external ID value of VendorTokenXYZ.
The developer creates an IAM role named SaaSMonitoringRole with the following trust policy:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::123456789012:root"
},
"Action": "sts:AssumeRole"
}
]
}
And attaches the following permissions policy to the role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "ec2:Describe*",
"Resource": "*",
"Condition": {
"StringEquals": {
"sts:ExternalId": "VendorTokenXYZ"
}
}
}
]
}
However, the third-party application is unable to retrieve the EC2 metrics. Which of the following changes will resolve the authorization issue and follow security best practices?
A sports media website uses Amazon DynamoDB to store and retrieve live match statistics. During high-profile matches, a sudden surge in read requests for a small set of popular matches results in DynamoDB throttling and increased latency. A developer decides to implement an Amazon DynamoDB Accelerator (DAX) cluster to optimize read performance. Which of the following developer actions are required to successfully cache these read operations and resolve the bottleneck? (Select two.)
Select all that apply
A fitness tracking application named FitPulse records real-time workout metrics from users' smartwatches into an Amazon DynamoDB table. The table is configured with provisioned read and write capacity. The partition key is `WorkoutDate` (formatted as YYYY-MM-DD), and the sort key is `UserId`. During peak hours (e.g., weekday evenings), the application experiences a high volume of write failures, and the backend logs display `ProvisionedThroughputExceededException` errors, even though the total consumed write capacity is well below the table's provisioned limit. Which combination of actions will resolve this issue? (Select TWO options.)
Select all that apply
A developer is configuring an Amazon ECS task definition to deploy a containerized application on AWS Fargate. The application running inside the container needs to write records to an Amazon Kinesis data stream. During task startup, the Amazon ECS container agent must pull the private container image from Amazon Elastic Container Registry (Amazon ECR) and retrieve a database password from AWS Secrets Manager.
The developer creates an IAM role named AppTaskRole to grant the application access to the Kinesis data stream. However, when attempting to run the task, the container agent fails to pull the image and cannot retrieve the secret.
Which TWO actions must the developer perform to resolve this issue?
Select all that apply
A developer is building a user management module for a web application. The user data is stored in an Amazon DynamoDB table where the partition key is . The developer needs to support two new query patterns: retrieving all users in a specific city () sorted by their registration date (), and retrieving a user's details by their unique email address (). The solution must optimize read latency and minimize consumed capacity. Which two actions should the developer take to meet these requirements?
Select all that apply
An agricultural IoT application named 'CropSense' collects hourly soil moisture data from thousands of sensors in a region. The sensor data is written to an Amazon DynamoDB table. The table is configured with a partition key of `SensorType` (which has only three distinct values: 'Moisture', 'Temperature', and 'Acidity') and a sort key of `Timestamp`. During peak reporting windows, the application experiences a high volume of `ProvisionedThroughputExceededException` errors, even though the total read/write capacity units consumed are well below the table's allocated capacity. Which of the following actions is the most appropriate way to resolve this throttling issue?
A developer is building a document conversion system that uses an Amazon SQS standard queue to trigger an AWS Lambda function. The Lambda function processes documents in batches of . During testing, the developer observes that if a single document in a batch fails to process due to a timeout, all documents in that batch are retried, causing duplicate processing for the successfully completed documents. Which configuration change should the developer make to ensure only the failed documents are reprocessed?
A developer is creating an AWS Lambda function that must write logs to Amazon CloudWatch Logs and read objects from an Amazon S3 bucket. The developer creates an IAM role with the necessary permissions policy attached. However, when the developer tries to create the Lambda function and associate it with this IAM role, the operation fails with an authorization error. The developer reviews the trust policy currently associated with the IAM role:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "ec2.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which action will resolve this issue and allow the Lambda function to run with the required permissions?
A news publishing platform named 'PressPulse' records real-time article view events in an Amazon DynamoDB table. The table is configured with provisioned write capacity and uses ArticleCategory as the partition key. During breaking news events, views for a single category spike dramatically, resulting in ProvisionedThroughputExceededException errors, even though the total consumed capacity is well below the table's total provisioned threshold. Additionally, the application's SDK client fails immediately without retrying when a write request is throttled. Which TWO actions should the developer take to resolve the throttling and improve application resilience? (Select TWO.)
Select all that apply
A software engineer is building a REST API using Amazon API Gateway. They set up the API to route incoming client requests directly to an AWS Lambda function using the proxy integration type. Which two statements correctly describe how data is exchanged between API Gateway and the backend function in this configuration? (Select TWO.)
Select all that apply
A developer is deploying a new AWS Lambda function that must write log data to an Amazon DynamoDB table. To keep the code reusable across multiple environments (such as staging and production), the developer must avoid hardcoding the DynamoDB table name. Additionally, the Lambda function must be authorized to write data to the DynamoDB table. Which two configurations should the developer use to meet these requirements? (Select two.)
Select all that apply
A developer has an application that consumes messages from an Amazon SQS queue. The consumer application takes approximately 30 seconds to process each message. However, the developer notices that other consumers are picking up the same messages and processing them concurrently, leading to duplicate processing. Which configuration change should the developer make to resolve this duplicate processing issue?
A payment service in a microservices application publishes transaction events to an Amazon SNS topic. An invoice service and a shipping service are subscribed to this topic using Amazon SQS queues. The developer needs to ensure that the shipping service only processes messages where the transaction status is marked as 'Success', without modifying the code of the payment service. Which approach should the developer take to meet this requirement?
An e-commerce application uses a REST API in Amazon API Gateway to retrieve product inventory. The developer decides to transition the integration type of the GET method from a Lambda custom integration to a Lambda proxy integration. Following this change, clients receive an HTTP 502 Bad Gateway error. The Amazon CloudWatch logs for the integrated AWS Lambda function confirm that the function executes successfully and returns the raw inventory data. Which modification should the developer make to resolve this error?