A developer creates an AWS Lambda function that is written in Java. During testing, the Lambda function does not work how the developer expected. The developer wants to use tracing capabilities to troubleshoot the problem.
Which AWS service should the developer use to accomplish this goal?
A. AWS Trusted Advisor
B. Amazon CloudWatch
C. AWS X-Ray
D. AWS CloudTrail
Show Answer
Correct Answer: C
Explanation: AWS X-Ray provides distributed tracing for AWS Lambda applications, including Java runtimes. It helps developers trace requests, visualize service interactions, identify errors, and analyze performance bottlenecks. CloudWatch focuses on logs and metrics, CloudTrail records API activity, and Trusted Advisor provides best practice recommendations.
Question 173
A company runs an ecommerce application on AWS. The application stores data in an Amazon Aurora database.
A developer is adding a caching layer to the application. The caching strategy must ensure that the application always uses the most recent value for each data item.
Which caching strategy will meet these requirements?
A. Implement a TTL strategy for every item that is saved in the cache.
B. Implement a write-through strategy for every item that is created and updated.
C. Implement a lazy loading strategy for every item that is loaded.
D. Implement a read-through strategy for every item that is loaded.
Show Answer
Correct Answer: B
Explanation: Write-through caching updates the cache at the same time as the database on every create and update, keeping cached values current. TTL allows stale data until expiration, lazy loading can serve stale cached entries until invalidated, and read-through only defines how cache misses are handled, not cache freshness.
Question 174
A company hosts its application in the us-west-1 Region. The company wants to add redundancy in the us-east-1 Region.
The application secrets are stored in AWS Secrets Manager in us-west-1. A developer needs to replicate the secrets to us-east-1.
Which solution will meet this requirement?
A. Configure secret replication for each secret. Add us-east-1 as a replication Region. Choose an AWS Key Management Service (AWS KMS) key in us-east-1 to encrypt the replicated secrets.
B. Create a new secret in us-east-1 for each secret. Configure secret replication in us-east-1. Set the source to be the corresponding secret in us-west-1. Choose an AWS Key Management Service (AWS KMS) key in us-west-1 to encrypt the replicated secrets.
C. Create a replication rule for each secret. Set us-east-1 as the destination Region. Configure the rule to run during secret rotation. Choose an AWS Key Management Service (AWS KMS) key in us-east-1 to encrypt the replicated secrets.
D. Create a Secrets Manager lifecycle rule to replicate each secret to a new Amazon S3 bucket in us-west-1. Configure an S3 replication rule to replicate the secrets to us-east-1.
Show Answer
Correct Answer: A
Explanation: AWS Secrets Manager supports native cross-Region replication. Configure replication on each secret in the primary Region (us-west-1), add us-east-1 as the replica Region, and choose a KMS key in the destination Region to encrypt the replicated secret. The other options describe features that do not exist or misuse replication mechanisms.
Question 175
A developer needs to modify an application architecture to meet new functional requirements. Application data is stored in Amazon DynamoDB and processed for analysis in a nightly batch. The system analysts do not want to wait until the next day to view the processed data and have asked to have it available in near-real time.
Which application architecture pattern would enable the data to be processed as it is received?
A. Event driven
B. Client-server driven
C. Fan-out driven
D. Schedule driven
Show Answer
Correct Answer: A
Explanation: An event-driven architecture enables data to be processed as soon as changes occur. With Amazon DynamoDB, DynamoDB Streams can capture item-level changes and trigger downstream processing (for example, via AWS Lambda), providing near-real-time analytics instead of waiting for a nightly batch. Client-server is a communication model, fan-out is a message distribution pattern rather than the primary architectural style for triggering processing, and schedule-driven relies on periodic execution rather than real-time events.
Question 176
A company is working on a new serverless application. A developer needs to find an automated way to deploy AWS Lambda functions and the dependent infrastructure with minimum coding effort. The application also needs to be reliable.
Which method will meet these requirements with the LEAST operational overhead?
A. Build the application by using shell scripts to create .zip files for each Lambda function. Manually upload the .zip files to the AWS Management Console.
B. Build the application by using the AWS Serverless Application Model (AWS SAM). Use a continuous integration and continuous delivery (CI/CD) pipeline and the SAM CLI to deploy the Lambda functions.
C. Build the application by using shell scripts to create .zip files for each Lambda function. Upload the .zip files. Deploy the .zip files as Lambda functions by using the AWS CLI in a continuous integration and continuous delivery (CI/CD) pipeline.
D. Build a container for each Lambda function. Store the container images in AWS CodeArtifact. Deploy the containers as Lambda functions by using the AWS CLI in a continuous integration and continuous delivery (CI/CD) pipeline.
Show Answer
Correct Answer: B
Explanation: AWS SAM is purpose-built for serverless applications. It lets developers define Lambda functions and dependent infrastructure as infrastructure as code with minimal coding effort, and integrates with the SAM CLI and CI/CD pipelines for automated, repeatable, and reliable deployments. The other options rely on manual deployment, custom scripting, or incorrectly use CodeArtifact for container images (Lambda container images are stored in Amazon ECR, not CodeArtifact).
Question 177
A developer has written a distributed application that uses microservices. The microservices are running on Amazon EC2 instances. Because of message volume, the developer is unable to match log output from each microservice to a specific transaction. The developer needs to analyze the message flow to debug the application.
Which combination of steps should the developer take to meet this requirement? (Choose two.)
A. Download the AWS X-Ray daemon. Install the daemon on an EC2 instance. Ensure that the EC2 instance allows UDP traffic on port 2000.
B. Configure an interface VPC endpoint to allow traffic to reach the global AWS X-Ray daemon on TCP port 2000.
C. Enable AWS X-Ray. Configure Amazon CloudWatch to push logs to X-Ray.
D. Add the AWS X-Ray software development kit (SDK) to the microservices. Use X-Ray to trace requests that each microservice makes.
E. Set up Amazon CloudWatch metric streams to collect streaming data from the microservices.
Show Answer
Correct Answer: A, D
Explanation: Use AWS X-Ray for distributed tracing across microservices. Install and run the X-Ray daemon on the EC2 instances (or alongside the application) so it can receive trace segments over UDP port 2000 and forward them to the X-Ray service. Instrument each microservice with the AWS X-Ray SDK so requests are traced across service boundaries, enabling end-to-end transaction analysis. The other options are incorrect because X-Ray does not rely on CloudWatch pushing logs to X-Ray, there is no global X-Ray daemon reached via a VPC endpoint on TCP 2000, and CloudWatch metric streams do not provide distributed request tracing.
Question 178
A developer is creating AWS CloudFormation templates to manage an application's deployment in Amazon Elastic Container Service (Amazon ECS) through AWS CodeDeploy. The developer wants to automatically deploy new versions of the application to a percentage of users before the new version becomes available for all users.
How should the developer manage the deployment of the new version?
A. Modify the CloudFormation template to include a Transform section and the AWS::CodeDeploy::BlueGreen hook.
B. Deploy the new version in a new CloudFormation stack. After testing is complete, update the application's DNS records for the new stack.
C. Run CloudFormation stack updates on the application stack to deploy new application versions when they are available.
D. Create a nested stack for the new version. Include a Transform section and the AWS::CodeDeploy::BlueGreen hook.
Show Answer
Correct Answer: A
Explanation: AWS CloudFormation supports ECS blue/green deployments through AWS CodeDeploy by adding the AWS::CodeDeployBlueGreen transform and an AWS::CodeDeploy::BlueGreen hook to the template. This enables canary or linear traffic shifting so a percentage of users receive the new version before full rollout. The other options do not provide automated CodeDeploy-managed progressive traffic shifting.
Question 179
A developer is designing a fault-tolerant environment where client sessions will be saved.
How can the developer ensure that no sessions are lost if an Amazon EC2 instance fails?
A. Use sticky sessions with an Elastic Load Balancer target group.
B. Use Amazon SQS to save session data.
C. Use Amazon DynamoDB to perform scalable session handling.
D. Use Elastic Load Balancer connection draining to stop sending requests to failing instances.
Show Answer
Correct Answer: C
Explanation: Store session state in a shared, durable data store rather than on individual EC2 instances. Amazon DynamoDB is a highly available, scalable NoSQL database commonly used for external session storage, allowing any healthy instance to retrieve a user's session after an instance failure. Sticky sessions only bind a client to one instance and do not preserve sessions if that instance fails. Amazon SQS is a message queue, not a session store. Connection draining helps in-flight requests during deregistration but does not protect session state.
Question 180
A developer is creating an AWS Lambda function that is invoked by messages to an Amazon Simple Notification Service (Amazon SNS) topic. The messages represent customer data updates from a customer relationship management (CRM) system
The developer wants the Lambda function to process only the messages that pertain to email address changes. Additional subscribers to the SNS topic will process any other messages.
Which solution will meet these requirements in the LEAST development effort?
A. Use Lambda event filtering to allow only messages that are related to email address changes to invoke the Lambda function.
B. Use an SNS filter policy on the Lambda function subscription to allow only messages that are related to email address changes to invoke the Lambda function.
C. Subscribe an Amazon Simple Queue Service (Amazon SQS) queue to the SNS topic. Configure the SQS queue with a filter policy to allow only messages that are related to email address changes. Connect the SQS queue to the Lambda function.
D. Configure the Lambda code to check the received message. If the message is not related to an email address change, configure the Lambda function to publish the message back to the SNS topic for the other subscribers to process.
Show Answer
Correct Answer: B
Explanation: Amazon SNS subscription filter policies are built for routing messages to specific subscribers based on message attributes. By applying a filter policy to the Lambda subscription, only email address change messages invoke the function, while other subscribers continue to receive the messages they are interested in. This requires no additional infrastructure or custom filtering code. Lambda event filtering does not apply to SNS in this context, SQS filter policies do not exist (filtering is done at SNS), and republishing from Lambda is unnecessary and inefficient.
Question 181
A developer is creating a web application for a school that stores data in Amazon DynamoDB. The ExamScores table has the following attributes: student_id, subject_name, and top_score.
Each item in the ExamScores table is identified with student_id as the partition key and subject_name as the sort key. The web application needs to display the student _id for the top scores for each school subject. The developer needs to increase the speed of the queries to retrieve the student_id for the top scorer for each school subject.
Which solution will meet these requirements?
A. Create a local secondary index (LSI) with subject_name as the partition key and top_score as the sort key.
B. Create a local secondary index (LSI) with top_score as the partition key and student_id as the sort key.
C. Create a global secondary index (GSI) with subject_name as the partition key and top_score as the sort key.
D. Create a global secondary index (GSI) with subject_name as the partition key and student_id as the sort key.
Show Answer
Correct Answer: C
Explanation: A global secondary index is required because the query pattern uses a different partition key than the base table. Using subject_name as the GSI partition key groups all students' scores for a subject, and using top_score as the GSI sort key allows querying the subject in descending score order with Limit=1 to retrieve the top scorer's student_id efficiently. An LSI must share the table's partition key (student_id), so it cannot support this access pattern. A GSI with student_id as the sort key would not sort by score.
$19
Get all 553 questions with detailed answers and explanations
Instant download HTML + PDF delivered the moment payment clears.
Secure Stripe checkout we never see or store your card details.
7-day refund if files are defective see our refund policy.