All practice questions
1542 questions
A developer is writing an application that must encrypt a application configuration file client-side before uploading it to an Amazon S3 bucket. The security policy requires using envelope encryption with an AWS KMS Customer Managed Key (CMK).
Which of the following workflows should the developer implement to meet these requirements?
A developer is deploying a microservice to Amazon Elastic Container Service (Amazon ECS) on AWS Fargate. The microservice needs to connect to an Amazon Aurora MySQL database. The database credentials must be rotated automatically every 30 days to comply with organizational security policies. The developer needs to implement a solution that retrieves these credentials securely without hardcoding them or causing application downtime during rotation.
Which two actions should the developer take to meet these requirements? (Select TWO.)
Select all that apply
A developer is troubleshooting an application running on Amazon ECS (using AWS Fargate) in AWS Account A. The application needs to retrieve objects from an Amazon S3 bucket in AWS Account B. The S3 objects are encrypted using a Customer Managed Key (CMK) in AWS Key Management Service (AWS KMS) located in Account B. The ECS Task Role in Account A has been configured with an identity-based policy that allows both s3:GetObject on the bucket and kms:Decrypt on the KMS CMK. However, when the containerized application runs, it receives an Access Denied error. Which two configuration changes must the developer make in Account B to resolve this authorization failure?
Select all that apply
A developer is updating a web application running on an AWS Elastic Beanstalk environment. The application is highly sensitive to customer-facing bugs, so the developer wants to test the new version using a small percentage of real production traffic () for a duration of minutes. If the new version triggers any Amazon CloudWatch alarms during this time, the traffic must immediately route back to the old version. If no alarms are triggered, the remaining of traffic should automatically shift to the new version. Which deployment policy should the developer configure in the Elastic Beanstalk environment?
An order processing system publishes JSON-formatted logs to Amazon CloudWatch Logs. The logs contain a top-level key named `status`. A representative log event is:
{
"orderId": "1001",
"status": "Failed",
"code": 500
}
Which filter pattern should be applied to the log group to capture these specific events?
A developer is deploying a containerized application on Amazon ECS using the AWS Fargate launch type. The application is designed to poll an Amazon SQS queue and process incoming messages. The task definition uses the awslogs log driver to send container logs to Amazon CloudWatch Logs. During deployment, the task fails to launch, and the AWS Management Console displays the following error:
ResourceInitializationError: unable to pull secrets or registry auth: execution role does not have permissions to pull from ECR
The developer verifies that two IAM roles are associated with the task definition: ApplicationTaskExecutionRole and ApplicationTaskRole.
Which action must the developer take to resolve the container startup failure and ensure the application can poll the SQS queue once running?
An e-commerce backend running on AWS Lambda needs to store sensitive customer profile data in an Amazon RDS database. Due to compliance requirements, the application must encrypt the profile data client-side before sending it to the database. The size of each profile is approximately .
Which of the following steps must the developer perform in the application code to implement this client-side encryption? (Select TWO)
Select all that apply
A developer is configuring an Amazon ECS service on AWS Fargate to deploy a containerized application. The Docker image is hosted in a private Amazon Elastic Container Registry (ECR) repository located in a separate, central AWS account. The Fargate tasks will run in a private subnet within the developer's AWS account. Which configuration is required to allow the ECS service to successfully pull the container image and deploy the application?
A developer has deployed a React-based inventory management portal hosted on a static website on AWS Amplify. The portal needs to send `PATCH` requests to an Amazon API Gateway REST API that integrates with a backend AWS Lambda function using a Lambda Proxy integration.
When the portal attempts to invoke the endpoint, the browser console displays a CORS preflight block error. Additionally, when testing the API directly using a CLI tool, the response returns a `502 Bad Gateway` error. The Lambda function execution logs show that the function completes successfully, but it returns a serialized JSON string containing only the inventory data.
Which two actions should the developer take to resolve these issues? (Select two.)
Select all that apply
A developer is troubleshooting a serverless application where an Amazon SQS queue triggers an AWS Lambda function to process batch invoice reports. Under normal load, the invoices are processed successfully. However, during peak hours when processing times increase, the developer notices that some invoices are generated multiple times. CloudWatch logs show that the Lambda function occasionally runs for up to seconds before completion, which is close to its configured timeout. The SQS queue's visibility timeout is currently set to seconds. Which configuration change will resolve this duplicate processing issue?
A developer is designing a data archival application that needs to encrypt database export files that are approximately in size before uploading them to an Amazon S3 bucket. The security policy requires client-side envelope encryption using an AWS KMS customer managed key.
Which of the following application workflows satisfies these requirements with the minimum number of AWS KMS API requests?
An AWS Lambda function written in Node.js queries an Amazon DynamoDB table using the AWS SDK for JavaScript (v3). The function's configuration has active tracing enabled. However, when viewing traces in the AWS X-Ray console, only the Lambda service and function segments are displayed, while the downstream queries to DynamoDB are completely missing. What action must be taken to ensure that these DynamoDB queries are recorded as part of the traces?
A developer has installed and configured the Unified CloudWatch Agent on a fleet of Amazon EC2 instances to stream application logs to Amazon CloudWatch Logs. However, after starting the agent, the developer notices that no log groups or log streams are being created in the CloudWatch console.
Which TWO actions should the developer take to troubleshoot and resolve this issue?
Select all that apply
A developer is writing an AWS CloudFormation template to deploy a web application on an Amazon EC2 instance. The application requires a database password that needs automatic rotation, as well as several software packages. The developer wants to ensure that any updates to the software configuration in the template are automatically applied to the instance without replacing it.
Which two actions should the developer take to meet these requirements?
Select all that apply
An application deployed in an Amazon ECS container on AWS Fargate uses the awslogs log driver to stream stdout logs to an Amazon CloudWatch Logs log group. The application outputs logs in JSON format, but the container's logging framework prepends a plaintext timestamp to each log line, resulting in log events formatted as follows:
`2026-07-14T12:00:00Z {"level": "ERROR", "response": {"status_code": 504, "error": "Gateway Timeout"}}`
The developer created a CloudWatch Metric Filter with the pattern `{ $.response.status_code = 504 }` to monitor these errors, but the metric is not registering any data. Which two actions should the developer take to resolve this issue and ensure the metrics are accurately captured?
Select all that apply
A developer is designing a serverless e-commerce application that must manage highly dynamic user shopping carts and preferences. The session data must be retrieved with low latency (), must scale automatically to handle millions of concurrent users, and must be automatically deleted after of user inactivity.
Which TWO strategies should the developer implement to meet these requirements? (Select TWO.)
Select all that apply
A high-traffic API is hosted on an AWS Elastic Beanstalk environment. The development team is preparing to deploy a major update. The deployment must satisfy the following operational requirements:
* The system must maintain at least its baseline capacity at all times to prevent performance degradation.
* A fast rollback mechanism must be available to restore the previous version within minutes if post-deployment health checks or alarms fail.
* The update must be contained within the existing environment without provisioning a separate, duplicate Elastic Beanstalk environment or performing a CNAME swap.
Which TWO of the following deployment strategies should the developer select to satisfy these requirements? (Select TWO.)
Select all that apply
A developer has a Node.js application deployed in Docker containers on Amazon ECS. The application writes data to an Amazon DynamoDB table using the AWS SDK for JavaScript (v3) and calls an external payment processing API over HTTPS using the Node.js native https module. The developer has deployed the AWS X-Ray daemon container as a sidecar in the ECS task definition and verified that the daemon is running and receiving data. However, the X-Ray console only shows the container node without any downstream nodes for DynamoDB or the payment API.
Which two actions should the developer take to ensure that both the DynamoDB calls and the external HTTPS API calls are instrumented and visible in the X-Ray service map?
Select all that apply
An organization's deployment pipeline fails during a step that executes an AWS CloudFormation stack template. The pipeline is configured to update a stack that has a status of ROLLBACK_COMPLETE following a failed initial creation attempt. Which actions should a developer take to resolve this issue and enable a successful deployment? (Choose two.)
Select all that apply
A developer is deploying a containerized application to Amazon Elastic Kubernetes Service (Amazon EKS). The application requires access to a database password for an Amazon RDS DB instance and an API key for a third-party service. The database password must be rotated every 30 days. The third-party API key changes infrequently, and the developer wants to access it with minimum latency and cost. Which combination of steps should the developer take to retrieve these configurations securely and cost-effectively? (Select TWO.)
Select all that apply