All practice questions
1542 questions
A developer has configured a CI/CD pipeline using AWS CodePipeline. The pipeline has a deploy stage that uses AWS CloudFormation to update a production stack. During a recent deployment, the stack update failed due to an error in a custom resource, and the subsequent rollback attempt also failed, leaving the stack in the UPDATE_ROLLBACK_FAILED state. The developer has resolved the root cause of the custom resource failure in the CloudFormation template and committed the changes to the source repository. However, the pipeline is now failing at the CloudFormation deploy stage with an error stating that the stack cannot be updated in its current state. Which two actions should the developer take to resolve the deployment failure and successfully apply the changes? (Select TWO.)
Select all that apply
A developer is building a student portal for a Learning Management System (LMS) hosted on an Auto Scaling group of Amazon EC2 instances. The application has two primary requirements:
1. It must cache the course catalog metadata, which is read frequently but updated only once a week.
2. It must store active student quiz session states. These session states are updated frequently with every answered question and must persist even if individual EC2 instances or cache nodes fail.
Which TWO options represent the most suitable AWS services and configurations to meet these requirements?
Select all that apply
A developer is troubleshooting a multi-account deployment pipeline in AWS CodePipeline. During the execution, the AWS CodeBuild stage fails with an AccessDenied error when attempting to assume a deployment role in a target AWS account. Additionally, a separate AWS CloudFormation deploy stage fails with an error indicating that the target stack is in the ROLLBACK_COMPLETE state from a previous failed creation. Which two actions must the developer take to resolve these failures? (Select TWO.)
Select all that apply
A financial technology application uses an Amazon DynamoDB table to retrieve real-time stock price data. During periods of high market activity, the application experiences increased read latency due to a massive spike in repeat query requests for popular stock symbols, leading to Read Capacity Unit (RCU) throttling on the table. A developer decides to deploy an Amazon DynamoDB Accelerator (DAX) cluster to resolve this issue. Which two of the following benefits does deploying a DAX cluster provide to resolve this throughput and latency bottleneck? (Select two.)
Select all that apply
A developer is deploying a Node.js web application to AWS Elastic Beanstalk. The application reads and writes data to an Amazon DynamoDB table using the AWS SDK for JavaScript. The developer wants to use AWS X-Ray to perform distributed tracing of incoming HTTP requests and downstream DynamoDB calls. Currently, the application is running, but no trace data is visible in the AWS X-Ray console.
Which two actions should the developer take to instrument the application and enable distributed tracing? (Select two.)
Select all that apply
A developer is using AWS CodeDeploy to perform an in-place deployment of a new application revision to an Amazon EC2 Auto Scaling group that currently contains running instances. The deployment must satisfy the following constraints:
* A minimum of instances must remain healthy and serve traffic at all times during the deployment process.
* The deployment must complete as quickly as possible while adhering to the healthy host constraint.
Which two CodeDeploy configurations can the developer use to meet these requirements?
Select all that apply
A mobile application sends a `POST` request to an Amazon API Gateway REST API. The API is configured with a Lambda proxy integration to retrieve user profiles. The developer recently migrated the integration from a Lambda custom integration to a Lambda proxy integration. Following the migration, client requests fail with a `502 Bad Gateway` status code and a CORS error in the browser console. The Lambda function execution logs show that the function completes successfully and returns the user profile data. Which two actions should the developer take to resolve this issue?
Select all that apply
A developer is configuring an Amazon CloudWatch Logs metric filter to monitor HTTP 500 status codes for a legacy web application. The application logs events to a CloudWatch log group in space-delimited Common Log Format (CLF). The developer observes the following sample log event:
`192.0.2.10 - - [14/Jul/2026:12:00:00 +0000] "POST /submit HTTP/1.1" 500 324`
The developer sets up the metric filter with the following pattern:
`[ip, client, user, timestamp, request, status_code = 500, size]`
However, the metric does not record any data points even when the log group receives events containing HTTP 500 errors. What is the reason for this behavior?
A developer is configuring AWS CodeDeploy to deploy a Python web application to a fleet of Amazon EC2 instances. The deployment process must retrieve database credentials securely from AWS Systems Manager Parameter Store (stored as a `SecureString` parameter) and execute a database migration script before the application starts and begins accepting traffic.
Which two actions must the developer perform to meet these requirements?
Select all that apply
A developer is setting up an application on an on-premises server that must archive daily transaction logs to a private Amazon S3 bucket. To implement this securely without storing long-term credentials on the server, the developer creates an IAM User named `archive-agent` in the AWS account `111122223333` and an IAM Role named `S3UploaderRole` that has permissions to write to the S3 bucket. The application will authenticate as `archive-agent` using short-term configurations and then assume `S3UploaderRole` to perform the S3 uploads.
Which two configuration policies are required to establish this role-assumption trust relationship and grant the necessary permissions? (Select two.)
Select all that apply
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:user/archive-agent"
},
"Action": "sts:AssumeRole"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::111122223333:role/S3UploaderRole"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"AWS": "arn:aws:iam::111122223333:user/archive-agent"
},
"Action": "s3:PutObject",
"Resource": "arn:aws:s3:::company-logs-bucket/*"
}
]
}
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": "sts:AssumeRole",
"Resource": "arn:aws:iam::111122223333:user/archive-agent"
}
]
}
{
"aws_access_key_id": "AKIAIOSFODNN7EXAMPLE",
"aws_secret_access_key": "wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY"
}
A developer is using AWS Serverless Application Model (SAM) to deploy a serverless API. The application uses a Lambda function triggered by an API Gateway API (defined as an `Api` event source) to retrieve records from a database. During testing, the API Gateway endpoint returns a 502 Bad Gateway error. The Lambda function logs indicate that it executed successfully and returned the database records, but the integration failed. Additionally, the developer needs to store the database credentials securely and ensure they are rotated automatically.
Which of the following actions should the developer take to resolve the integration error and meet the security requirements? (Select TWO.)
Select all that apply
A developer is configuring the deployment settings for a production web application hosted on AWS Elastic Beanstalk. The deployment process must satisfy the following requirements:
1. The new application version must be deployed to a completely separate, temporary Auto Scaling group and pass health checks before serving any production traffic.
2. If health checks fail, the rollback must be automatic, immediate, and leave the existing active instances completely untouched.
3. The deployment must avoid any DNS-level routing changes, such as swapping environment URLs.
Which Elastic Beanstalk deployment policy should the developer select?
A developer is hosting a client-side web application on `https://console.inventoryhub.net`. The application makes an HTTP `DELETE` request to an Amazon API Gateway REST API that uses a Lambda proxy integration to remove items from a database. When a user attempts to delete an item, the browser blocks the request and displays a CORS preflight error in the console. Additionally, when testing the endpoint directly using a custom HTTP client, the API returns a `502 Bad Gateway` error. Which two actions should the developer take to resolve these issues? (Select TWO.)
Select all that apply
A developer is writing an AWS Lambda function in AWS Account A () that needs to retrieve files from an Amazon S3 bucket located in AWS Account B (). The developer has attached an IAM policy to the Lambda function's execution role in Account A that grants `s3:GetObject` permissions on the S3 bucket in Account B. However, when the Lambda function runs, it receives an Access Denied error (HTTP ) from Amazon S3. Which of the following actions will resolve this authorization failure?
A developer is deploying a microservices application to AWS App Runner. The application needs to retrieve two configuration settings:
1. Database credentials for an Amazon Aurora PostgreSQL database that must be rotated automatically every 30 days.
2. A public API endpoint URL for an external service that is non-sensitive and frequently accessed.
Which combination of actions should the developer perform to manage and retrieve these configurations securely and cost-effectively? (Select TWO.)
Select all that apply
A developer has configured an AWS Lambda function in Account A to write data to an Amazon DynamoDB table in Account B. To achieve this, the Lambda function code uses the AWS SDK to call `sts:AssumeRole` on an IAM role in Account B named `DynamoDBWriteRole`. The Lambda function's execution role in Account A has a policy allowing `sts:AssumeRole` on the ARN of `DynamoDBWriteRole`. However, the function execution fails with an `AccessDenied` error during the STS assume role operation. The developer examines the trust policy of `DynamoDBWriteRole` in Account B:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "lambda.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which of the following actions will resolve this authorization failure?
A developer is attempting to deploy an AWS Serverless Application Model (SAM) template using the AWS CLI in an AWS Organizations member account. The developer is assuming an IAM role named `DeploymentRole` which has the `AdministratorAccess` managed policy attached. During the deployment, the CloudFormation stack creation fails with the following error:
`API: lambda:CreateFunction User: arn:aws:iam::123456789012:assumed-role/DeploymentRole/AWSCloudFormation is not authorized to perform: lambda:CreateFunction on resource: arn:aws:lambda:us-east-1:123456789012:function:MySampleFunction`
Which of the following actions should the developer take to resolve this authorization failure? (Select TWO.)
Select all that apply
A developer is building a mobile application that authenticates users through an Amazon Cognito User Pool. The application then exchanges the user's JSON Web Token (JWT) for temporary AWS credentials using an Amazon Cognito Identity Pool. These credentials are used to sign requests to an Amazon API Gateway REST API using AWS Signature Version 4 (SigV4). However, the API Gateway method is configured with a Cognito User Pool Authorizer, and all signed requests are failing with a 401 Unauthorized error. How should the developer resolve this authorization failure?
A client-side web application hosted on `https://portal.member-services.org` makes an HTTP `PUT` request to an Amazon API Gateway REST API. The API is integrated with a backend AWS Lambda function using Lambda Proxy integration. Users report that the updates fail. Inspecting the browser console reveals a CORS error stating that the `Access-Control-Allow-Origin` header is missing, while the API Gateway execution logs show a `502 Bad Gateway` error due to a malformed Lambda response. Which two actions should the developer take to resolve these errors?
Select all that apply
A developer is implementing a backend service integration for automated partner applications. The partner applications must programmatically upload raw telemetry data directly to an Amazon S3 bucket. The partners authenticate using their own enterprise OpenID Connect (OIDC) identity provider. The developer must ensure that these external applications obtain temporary AWS credentials with permission to write only to a specific folder in the S3 bucket without requiring long-lived IAM user credentials. Which TWO configuration steps should the developer perform to meet these requirements?
Select all that apply