All practice questions
1542 questions
A developer needs to update a web application running on an AWS Elastic Beanstalk environment. The update must be performed with zero downtime. Due to strict budget constraints, the environment must not provision any additional Amazon EC2 instances during the deployment process. The development team is willing to accept a temporary reduction in application capacity while the update is in progress. Which deployment strategy should the developer configure?
A developer is designing a collaborative document editing web application. The application authenticates users using an Amazon Cognito User Pool. The backend APIs are hosted on Amazon API Gateway. The developer wants to restrict access to a specific API Gateway resource method (POST /documents) so that only users belonging to the 'Editors' Cognito User Pool group can invoke it.
Which TWO configurations would allow the developer to implement this group-based authorization?
Select all that apply
A web-based partner portal hosted on `https://partner.datasync.io` receives a `502 Bad Gateway` error and a CORS block message in the browser console when sending a `PATCH` request to an Amazon API Gateway REST API. The API is configured with a Lambda Proxy integration. The developer checks the Amazon CloudWatch logs and confirms that the backend Lambda function executed successfully and returned the following JSON structure:
{
"statusCode": 200,
"body": "{\"message\": \"Update successful\"}"
}
Which action should the developer take to resolve this error?
A logistics tracking application named PackTrack records real-time delivery status updates for packages. The underlying Amazon DynamoDB table uses `PackageID` as the partition key and `StatusTimestamp` as the sort key. A fleet monitoring dashboard needs to display all deliveries that are currently delayed. To retrieve this data, the dashboard runs a weekly batch process using a `Scan` operation with a `FilterExpression` on the `DeliveryStatus` attribute where the value equals `DELAYED`. As package volume increases, the scan operation consistently throws `ProvisionedThroughputExceededException` errors, causing the dashboard to load partially or fail entirely, despite the developer scaling up the table's read capacity units (RCUs). Which of the following is the most cost-effective and appropriate solution to resolve this throttling issue?
A developer is designing the backend for a real-time ridesharing application. The application requires two distinct state management components:
1. A temporary queue for passenger-to-driver matching that requires fast, in-memory operations and support for sorted data structures.
2. A persistent data store for user session configurations (such as notification preferences) that must automatically expire after days of user inactivity.
Which combination of actions should the developer take to meet these requirements? (Select TWO)
Select all that apply
A developer is troubleshooting a local C# (.NET) console application that uses the AWS SDK for .NET to read objects from an Amazon S3 bucket. The developer has configured the AWS CLI on their workstation with a named profile called `dev-profile` containing valid AWS credentials. However, when executing the application locally, it throws an `AmazonServiceException` indicating that the credentials cannot be found. No environment variables are set on the workstation, and the SDK is initialized using default client configuration. Which of the following actions is the most secure and appropriate way to resolve this credential error for local development?
A digital library application retrieves book metadata from an Amazon DynamoDB table. During a reading campaign, a few popular books receive a high volume of read requests, causing DynamoDB read throttling. The developer wants to implement a caching solution to reduce read latency to sub-milliseconds for these popular books with minimal changes to the application code.
Which two actions should the developer take to resolve the throttling and meet the performance requirements? (Select two.)
Select all that apply
A developer has configured an AWS Lambda function in Account A (123456789012) to access resources in Account B (987654321098) by assuming an IAM role named CrossAccountAccessRole in Account B. The developer attached an IAM policy to the Lambda execution role in Account A that permits the sts:AssumeRole action. However, when the Lambda function runs and attempts to assume the role, the API call fails with an AccessDenied error.
The trust policy for CrossAccountAccessRole in Account B is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which modification must the developer make to resolve this error?
A developer is deploying updates to an AWS CloudFormation stack. The update fails due to a configuration error, initiating an automatic rollback. However, the rollback fails because a security group managed by the stack was manually attached to an EC2 instance outside of CloudFormation, placing the stack in the UPDATE_ROLLBACK_FAILED state. The developer needs to successfully complete the rollback and return the stack to a stable state. Which action should the developer take to resolve this issue?
A developer is configuring an AWS Lambda function in Account A (111122223333) to send logs and processing data directly to an Amazon SQS queue located in Account B (444455556666). The Lambda function is associated with an IAM execution role named LambdaSQSSenderRole. When the Lambda function attempts to call the SQS SendMessage API, it receives an AccessDeniedException. Which two actions are required to resolve this authorization issue and allow the Lambda function to send messages to the queue? (Select two.)
Select all that apply
An online banking application retrieves user transaction history using an Amazon DynamoDB table. During end-of-month processing, users experience high query latencies, and the application log shows frequent `ProvisionedThroughputExceededException` errors on read operations. The primary key structure uses a partition key of `UserId` and a sort key of `TransactionTimestamp`. The developer plans to implement Amazon DynamoDB Accelerator (DAX) to achieve sub-millisecond read latency and alleviate the read workload on the DynamoDB table. The application code currently initiates reads with the parameter `ConsistentRead` set to `true`.
Which combination of actions must the developer take to resolve the performance issue and successfully utilize caching? (Select two.)
Select all that apply
A developer is configuring an AWS CodeBuild project to build a containerized application. The build process must retrieve a database credential that undergoes automatic rotation every days. In addition, the source code repository holds a custom build specification file at the path `build-configs/custom-buildspec.yml` instead of the root directory.
Which two configurations must the developer perform to ensure the build project executes successfully?
Select all that apply
A developer is using AWS CodeDeploy to perform an in-place deployment of an application to an EC2 Auto Scaling group containing running instances. The application must maintain at least of its traffic-serving capacity during the deployment process to handle regular user traffic. The developer also wants to avoid launching any new EC2 instances to minimize additional costs.
Which of the following CodeDeploy configurations will meet these requirements? (Select TWO.)
Select all that apply
An application deployed on AWS Batch needs to retrieve two types of configuration values: database credentials that must be automatically rotated every 30 days, and non-sensitive application settings (such as logging levels and API endpoints) that do not require rotation. Which combination of actions should the developer take to retrieve these values securely, cost-effectively, and with minimal operational overhead? (Select TWO.)
Select all that apply
An organization is setting up a continuous integration pipeline. The build phase is executed by AWS CodeBuild using a custom IAM service role. However, during the initial run, the build fails immediately before executing any build phases, throwing an error that CodeBuild is not authorized to assume the specified service role. Which of the following actions will resolve this issue?
An application deployed via an AWS CloudFormation stack requires a database password that must be rotated automatically every 30 days. Additionally, operators occasionally make direct manual changes to the security group rules associated with the stack, which causes drift between the physical resources and the template definition. Which two actions should the developer take to manage these requirements?
Select all that apply
A developer is optimizing a reporting service that retrieves product catalog listings from an Amazon DynamoDB table. The service frequently executes the same Query operations to retrieve items by category. To reduce latency, the developer deploys an Amazon DynamoDB Accelerator (DAX) cluster and updates the application code to use the DAX SDK client. While individual GetItem operations now exhibit sub-millisecond latency, the Query operations continue to experience high latency and consume the table's Provisioned Throughput. Which modification should the developer make to ensure the Query operations are successfully cached by DAX?
A developer is using the AWS Serverless Application Model (AWS SAM) CLI to test an AWS Lambda function locally by running the `sam local invoke` command. The Lambda function, written in Node.js, uses the AWS SDK for JavaScript (v3) to read from an Amazon DynamoDB table in the cloud.
When the developer runs the function locally, the SDK operations fail with an `AccessDeniedException`. The developer has already configured a local AWS CLI profile named `developer-local` in the `~/.aws/credentials` file on the host machine. This profile possesses all necessary permissions to access the DynamoDB table. The developer has also set the environment variable `AWS_PROFILE=developer-local` on the host command line.
Which actions should the developer take to ensure the locally running function has access to the credentials? (Select TWO.)
Select all that apply
A developer is implementing an AWS Lambda function in Account A () that needs to assume a specific IAM role named `TargetTaskRole` within the same account to perform administrative tasks. The Lambda function is configured with an execution role named `LambdaExecutionRole`.
The current trust policy of `TargetTaskRole` is configured as follows:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
During execution, the function code calls `sts:AssumeRole` for `TargetTaskRole` and fails with the following error:
`An error occurred (AccessDenied) when calling the AssumeRole operation: User: arn:aws:sts::123456789012:assumed-role/LambdaExecutionRole/my-function is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::123456789012:role/TargetTaskRole`
Which of the following configurations are required to resolve this error? (Select TWO.)
Select all that apply
A developer is building a command-line interface (CLI) tool that internal engineers will use to upload software builds directly to a private Amazon S3 bucket. The engineers authenticate with the company's external OpenID Connect (OIDC) identity provider. The CLI tool needs to obtain temporary AWS credentials to write to the S3 bucket directly.
Which solution meets these requirements with the least operational overhead?