All practice questions
1542 questions
An application team is deploying a containerized API to Amazon ECS using the AWS Fargate launch type. The application code needs to retrieve operational parameters from Amazon DynamoDB during runtime. Additionally, the ECS agent must retrieve database credentials from AWS Secrets Manager to configure the application's environment variables before the container starts. Which configuration will allow the application to start and run successfully with the least privilege?
A developer is refactoring a web application that runs on an Auto Scaling group of Amazon EC2 instances. The application currently stores user session state in the memory of individual instances, which causes users to lose their sessions when the Auto Scaling group scales in. The session data contains nested JSON objects representing user preferences and search history. The developer wants to store these sessions in a shared, highly available cache that supports automatic expiration of idle sessions after 30 minutes. Which solution meets these requirements with the best performance and lowest operational overhead?
A mobile gaming application writes daily player high scores to an Amazon DynamoDB table. Although the table's total provisioned write capacity is significantly higher than the aggregate write rate, the application frequently experiences ProvisionedThroughputExceededException errors because all writes use the current date (e.g., YYYY-MM-DD) as the partition key. Which action should the developer take to resolve this throttling issue?
A developer is troubleshooting an AWS Lambda function written in Python that processes transaction records. The function intermittently fails with a memory limit exceeded error after running successfully for several hours under continuous traffic. The developer reviews the code and notes that a helper class initializes an in-memory cache list in the global scope, outside the handler function, to store transaction IDs. Which of the following is the most likely cause of this issue and the correct resolution?
A developer is troubleshooting a CloudWatch Logs subscription filter that streams log events from a Lambda function's log group to an Amazon Kinesis Data Firehose delivery stream. The delivery stream successfully writes data to an Amazon S3 bucket, but the developer notices that no logs from the subscription filter are arriving in S3. The CloudWatch metric DeliveryErrors for the subscription filter shows a consistently high count. The developer verifies that the Firehose delivery stream is active and that the IAM role specified in the subscription filter has a permissions policy allowing firehose:PutRecord and firehose:PutRecordBatch on the delivery stream. Which of the following is the most likely cause of this issue?
A developer is troubleshooting a Java application running on Amazon ECS Fargate that receives HTTP requests and uses the AWS SDK for Java to write metadata to an Amazon DynamoDB table. The developer runs the AWS X-Ray daemon as a sidecar container in the ECS task. The X-Ray daemon logs confirm that it is successfully receiving trace segments and uploading them to AWS X-Ray. However, in the X-Ray trace map, the downstream calls to DynamoDB do not appear. Which action should the developer take to ensure DynamoDB calls are included in the trace?
A developer needs to monitor an AWS Lambda function that occasionally times out during execution. The developer wants to count the occurrences of these timeouts and receive an alert when they happen. Which of the following steps should the developer perform to meet these requirements? (Select TWO.)
Select all that apply
A developer attempts to deploy a new stack named `prod-app-backend` using AWS CloudFormation. The initial stack creation fails due to a syntax error in the resource properties, and the stack status transitions to `ROLLBACK_COMPLETE`. After correcting the syntax error in the template, the developer tries to perform a stack update using the corrected template and the same stack name, but the update fails. Which action must the developer take to deploy the stack successfully?
A developer is implementing a serverless payment microservice using AWS Lambda. The microservice needs to securely access a third-party API key that must be rotated every 90 days. Which solution should the developer implement to manage and rotate this API key with the lowest operational overhead?
A developer is configuring a custom Amazon CloudWatch metric filter to monitor performance metrics from an API gateway service. The service writes structured JSON logs to a CloudWatch log group. A representative log event has the following structure:
{
"service": "payment-api",
"transaction": {
"success": true,
"amount": 250.00
},
"latency": 150
}
The developer needs to create a metric filter that publishes to a custom metric named `HighValueLatency` in the `PaymentMetrics` namespace. The metric must record the `latency` value, but only for events where the transaction `success` is `true` and the transaction `amount` is strictly greater than .
Which TWO configurations or values must the developer specify in the metric filter settings to achieve this?
Select all that apply
A developer is configuring a multi-account CI/CD pipeline using AWS CodePipeline. The pipeline executes an AWS CodeBuild project in Account A. As part of the build spec, the project runs a deployment script that is designed to deploy an AWS CloudFormation stack in Account B. During execution, the build fails at the deployment step with the error: `An error occurred (AccessDenied) when calling the AssumeRole operation`. Which two actions should the developer take to resolve this failure? (Select TWO.)
Select all that apply
A client-side Angular application hosted on `https://claims.healthportal.com` sends a `PUT` request to an Amazon API Gateway REST API secured by a custom Lambda Authorizer. The API is integrated with a backend Lambda function using Lambda Proxy Integration. When users attempt to perform actions with expired session tokens, the application's browser console displays a CORS preflight blocked error, and the request fails without displaying the expected session expiration message to the user. Which actions should the developer take to resolve the CORS preflight blocked error and allow the frontend to receive the correct status codes? (Select TWO.)
Select all that apply
An engineer is setting up a build process in AWS CodeBuild for a repository where the build specification file is named buildspec.yml and is located inside a directory named config/ instead of the root directory. The build fails during the initial phase because the buildspec file cannot be found. How can the engineer configure CodeBuild to successfully locate and use this buildspec file?
A logistics tracking application uses Amazon DynamoDB to store delivery status updates. During peak hours, the application frequently experiences read throttling ("ProvisionedThroughputExceededException") when querying the status of specific high-priority shipments, which are read repeatedly by multiple warehouse terminals using eventually consistent reads. The development team needs to implement a caching solution to reduce the load on the DynamoDB table and minimize tail latency while requiring minimal modifications to the existing application code. Which solution should the development team implement to meet these requirements?
A developer is testing a local Java application that uses the AWS SDK for Java v2 to retrieve messages from an Amazon SQS queue. The application is configured to use a profile named dev-profile. When running the application locally, it fails with the following error:
software.amazon.awssdk.core.exception.SdkClientException: Unable to load credentials from any of the providers in the chain
The developer verifies that the local AWS credentials and configuration files exist. Which TWO conditions could explain this credential loading failure? (Select TWO).
Select all that apply
An e-commerce application named "FlashRetail" writes customer transaction records to an Amazon DynamoDB table. The table partition key is configured as the transaction date (format: ). During a high-volume flash sale event, the application experiences write throttling and encounters errors, even though the total consumed capacity is well below the table's overall provisioned write limit.
Which of the following actions should the developer take to resolve this throttling issue?
A developer is deploying a three-tier web application using an AWS CloudFormation template. The template defines an Amazon RDS DB instance that requires database credentials. The company's security policy requires that database passwords must be stored securely, rotated every 30 days, and retrieved dynamically during stack operations. Additionally, the developer must ensure that any failed stack updates automatically revert to the last stable state without leaving orphaned resources or requiring manual intervention. Which two actions should the developer take to meet these security and deployment requirements? (Select TWO.)
Select all that apply
A developer is implementing a smart home mobile application. The mobile client needs to authenticate users and obtain temporary, limited-privilege AWS credentials to publish telemetry data directly to Amazon IoT Core MQTT topics.
Which solution meets these requirements with the least operational overhead?
A developer has deployed a Python Flask web application on Amazon EC2 instances. The application receives user requests, sends notifications to Amazon SNS, and queries an Amazon RDS PostgreSQL database. The AWS X-Ray daemon is running on the instances and has the necessary permissions. However, the X-Ray service map only shows the EC2 instances as nodes and does not display downstream nodes for Amazon SNS or the RDS database. Which two actions should the developer take to instrument the application and trace these downstream components? (Select TWO.)
Select all that apply
A developer is troubleshooting a cross-account deployment failure. A CI/CD pipeline using AWS CodePipeline in Account A () needs to deploy resources into Account B () by assuming a role named `CrossAccountDeployRole` in Account B.
The pipeline fails at the deploy stage with the error:
`CodePipeline is not authorized to perform: sts:AssumeRole on resource: arn:aws:iam::222222222222:role/CrossAccountDeployRole`
In Account B, the developer has configured the following trust policy for `CrossAccountDeployRole`:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Principal": {
"Service": "codepipeline.amazonaws.com"
},
"Action": "sts:AssumeRole"
}
]
}
Which two actions should the developer take to resolve this authorization failure?
Select all that apply