Courseiva

CCNA Continuous Improvement for Existing Solutions Questions

75 of 228 questions · Page 3/4 · Continuous Improvement for Existing Solutions · Answers revealed

151
MCQmedium

A company runs a stateful web application on EC2 instances behind an Application Load Balancer. The application stores session data locally on the instances. The company wants to improve availability and scalability. What should a solutions architect recommend?

A.Move session state to Amazon ElastiCache and make the application stateless.
B.Use Auto Scaling to add more EC2 instances.
C.Enable sticky sessions on the ALB.
D.Use larger EC2 instances to handle more sessions.
AnswerA

ElastiCache (Redis or Memcached) externalises session state so any instance behind the ALB can serve any user request. This removes instance affinity, letting the architect scale horizontally and survive instance loss without dropping sessions, satisfying the availability and scalability goals.

Why this answer

Moving session state to Amazon ElastiCache makes the application stateless, allowing EC2 instances to be added or removed without session loss, which improves both availability and scalability. Option B (Auto Scaling alone) is wrong because without external session storage, scaling out will cause new instances to lack existing session data, and terminating instances will lose sessions. Option C (sticky sessions) is wrong because it only routes a user to the same instance, but if that instance fails, the session is lost.

Option D (larger instances) is wrong because it does not address scalability; it only increases capacity of individual instances, but does not allow for horizontal scaling or improve availability beyond a single instance.

152
MCQhard

A company operates a multi-account AWS Organization with AWS Control Tower. A new compliance rule requires that all Amazon S3 buckets in every account block public access and that any noncompliant bucket be remediated automatically within minutes. The security team wants a central view of compliance and minimal per-account configuration. Which solution BEST meets these requirements?

A.Enable S3 Block Public Access at the organization level using AWS Organizations, and deploy an AWS Config conformance pack with automatic remediation in each account.
B.Create an IAM policy in the management account that denies s3:PutBucketPublicAccessBlock and attach it to every account's administrator role.
C.Use AWS Control Tower guardrails to detect public buckets and send findings to AWS Security Hub for manual review by the security team.
D.Deploy an AWS Lambda function in each account that runs on a schedule to call PutBucketPublicAccessBlock for every bucket.
AnswerA

Organization-level S3 Block Public Access applies the setting to every current and future account in the organization, so new accounts inherit it automatically. An AWS Config conformance pack with automatic remediation detects and fixes any bucket that is later made public. This combination gives central enforcement plus automatic remediation with minimal per-account setup.

Why this answer

Organization-level S3 Block Public Access enforces the setting across all accounts and future accounts from a single place, satisfying the central control requirement. AWS Config conformance packs with automatic remediation detect noncompliant buckets and fix them quickly. Together they provide both preventive enforcement and automatic corrective action with little per-account effort.

Exam trap

The trap here is choosing a detection-only mechanism such as Control Tower guardrails or Security Hub, and overlooking that automatic remediation within minutes requires AWS Config remediation actions.

153
Multi-Selecteasy

A company uses AWS CloudFormation to manage infrastructure. The operations team wants to ensure that all future stack updates follow best practices for change management. Which THREE actions should the team implement?

Select 3 answers
A.Enable drift detection to identify resources that have changed outside of CloudFormation.
B.Use IAM policies to restrict who can update stacks and require approval.
C.Use nested stacks to reuse templates across multiple environments.
D.Apply a stack policy to protect critical resources from accidental updates.
E.Require change sets to be created and reviewed before executing stack updates.
AnswersB, D, E

Restricting stack-update permissions through IAM policies enforces least privilege and separation of duties, ensuring only authorised personnel can initiate changes. Requiring approval before updates satisfies the change-management control the stem demands, preventing unvetted modifications from reaching production infrastructure.

Why this answer

Option B is correct because IAM policies are the mechanism to enforce least privilege and change control on CloudFormation operations: you can deny cloudformation:UpdateStack/ExecuteChangeSet to most principals and allow it only to an approved role, and combine that with manual approval gates so no unauthorized or unreviewed update can run. Option D is correct because a CloudFormation stack policy is a JSON document that explicitly denies Update:Modify/Update:Replace/Update:Delete actions on specified logical resources, protecting critical resources such as databases from accidental replacement or deletion during a stack update. Option E is correct because change sets let you preview exactly which resources will be added, modified, or deleted (and whether replacement occurs) before committing, so creating and reviewing a change set prior to ExecuteChangeSet is the standard best practice for controlled stack updates.

Option A is not part of the answer because drift detection only reports resources whose actual configuration diverges from the template; it detects and informs but does not enforce change management on future updates. Option C is not part of the answer because nested stacks address template reuse, modularity, and per-environment composition, not approval or protection of update operations.

154
MCQeasy

A company is using AWS CloudFormation to manage infrastructure. The operations team wants to be notified when a stack operation fails. Which approach is the MOST efficient?

A.Create a scheduled CloudWatch Events rule that calls the DescribeStacks API and sends an alert if status is FAILED
B.Configure an SNS topic as a notification option in the CloudFormation stack
C.Use a Lambda function that is invoked by CloudFormation via custom resource
D.Use Amazon EventBridge to monitor CloudFormation API calls and trigger a Lambda function
AnswerB

CloudFormation natively publishes stack event notifications to an SNS topic specified in the stack's notification configuration, covering failure events without custom polling or Lambda. This satisfies the requirement for efficient, event-driven alerting on stack operation failure.

Why this answer

CloudFormation natively supports SNS notifications via the NotificationARNs property on a stack, which emits events for stack operations such as CREATE_FAILED, UPDATE_FAILED, ROLLBACK_IN_PROGRESS, and DELETE_FAILED. Configuring an SNS topic directly on the stack is the least-effort, lowest-latency, and most operationally simple way to be alerted on failures because it requires no polling, no Lambda, and no custom code.

Exam trap

The trap here is that candidates over-engineer the solution by reaching for EventBridge or Lambda, when the exam expects recognition that CloudFormation has a built-in SNS notification feature that is the most efficient answer.

How to eliminate wrong answers

Option A is wrong because a scheduled CloudWatch Events rule that polls DescribeStacks introduces latency, consumes API rate limits, and requires custom logic to detect state transitions — it is neither efficient nor event-driven. Option C is wrong because Lambda-backed custom resources are invoked by CloudFormation during stack lifecycle events to create/update/delete resources; they are not a notification mechanism and cannot reliably report on the stack's own failure state. Option D is wrong because although EventBridge can capture CloudFormation API calls via CloudTrail, wiring it to a Lambda just to send an alert adds unnecessary moving parts when SNS notification is a first-class stack feature.

155
MCQeasy

A development team deploys a web application on Amazon EC2 instances behind an Application Load Balancer. The application experiences intermittent 503 errors. A Solutions Architect notices that the errors coincide with high CPU utilization on the EC2 instances. What is the MOST effective way to improve the application's availability?

A.Increase the idle timeout setting on the Application Load Balancer.
B.Decrease the health check interval on the Application Load Balancer.
C.Configure an Auto Scaling group for the EC2 instances with a scaling policy based on average CPU utilization.
D.Use larger EC2 instance types to handle the load.
AnswerC

An Auto Scaling group with a target-tracking or step policy on average CPU utilisation adds EC2 capacity before sustained high CPU causes 503s, then removes it afterwards. This directly addresses the CPU-driven availability constraint with less operational effort than manual intervention.

Why this answer

The 503 errors correlate with high CPU on the EC2 instances, meaning the instances are overwhelmed and the ALB is returning 503s when targets fail health checks or cannot respond. An Auto Scaling group with a CPU-based target tracking policy automatically adds instances when average CPU rises, distributing load and restoring healthy responses. This directly addresses the root cause rather than masking symptoms.

Exam trap

SAP-C02 often tests whether candidates choose reactive fixes (bigger instances, faster health checks) instead of the elastic, root-cause solution — auto scaling based on the actual bottleneck metric.

How to eliminate wrong answers

Option A is wrong because increasing the ALB idle timeout only affects how long idle connections are held; it does nothing for CPU saturation and can actually worsen resource consumption by holding connections longer. Option B is wrong because a shorter health check interval only detects failures faster — it does not prevent them and may even mark healthy-but-busy instances as unhealthy, causing more 503s. Option D is wrong because larger instance types provide a static capacity bump but do not adapt to variable load, and they are less cost-effective than horizontal scaling for availability.

156
Multi-Selecteasy

A company is using AWS CloudFormation to deploy infrastructure. They want to ensure that updates to a stack do not cause downtime for a critical web application. Which THREE strategies should they consider? (Choose THREE.)

Select 3 answers
A.Use the DeletionPolicy attribute to retain resources.
B.Apply a stack policy to protect critical resources.
C.Use a rolling update strategy with an appropriate batch size.
D.Use Change Sets to preview stack updates.
E.Use nested stacks to isolate components.
AnswersB, C, D

Stack policies prevent accidental updates to protected resources.

Why this answer

Option B is correct because a CloudFormation stack policy lets you explicitly deny Update:Replace or Update:Delete actions on critical resources (for example, the production load balancer or database), preventing an update from accidentally replacing or removing them and thereby avoiding downtime. Option C is correct because rolling updates with an appropriate batch size (such as MaxBatchSize/MinInstancesInService settings in an UpdatePolicy for Auto Scaling groups or ECS services) replace instances or tasks incrementally while keeping a minimum number in service, so the web application stays available throughout the deployment. Option D is correct because Change Sets let you preview exactly which resources will be added, modified, or replaced before executing the update, allowing you to detect disruptive replacements (for example, a resource that would be recreated) and adjust the template before any downtime-causing change is applied.

Option A is not appropriate here because DeletionPolicy only controls what happens to a resource when it is removed from the stack or the stack is deleted; it does not prevent or mitigate downtime during an update. Option E is not appropriate because nested stacks are a code-organization and reuse mechanism, not a strategy that by itself prevents update-related downtime.

Exam trap

The trap here is confusing DeletionPolicy with update protection — candidates see 'retain resources' and assume it prevents downtime, when it only affects deletion behavior, not in-place replacement during an update.

157
MCQmedium

A company uses AWS CloudFormation to deploy infrastructure. A stack update fails with a resource update failure. The team wants to investigate the specific error without rolling back the stack. What is the BEST approach?

A.Rerun the stack update with the --disable-rollback flag and then describe the stack events.
B.Delete the stack and review the CloudFormation logs.
C.Create a change set to preview the updates.
D.Use the AWS CLI describe-stack-resources command to see the status of each resource.
AnswerA

The --disable-rollback flag preserves the failed stack state so the team can inspect the exact resource error via describe-stack-events, rather than losing it to an automatic rollback. This satisfies the requirement to investigate the specific failure without reverting the stack.

Why this answer

Using the --disable-rollback flag on the update-stack command prevents CloudFormation from rolling back when a resource update fails, leaving the stack in UPDATE_FAILED state so you can inspect the exact error via describe-stack-events. This is the standard way to debug a failed update without losing the partially applied changes.

Exam trap

SAP-C02 often tests the difference between change sets (preview only) and disable-rollback (execute and preserve failure state) — candidates pick change sets thinking they show errors, but they do not execute the update.

How to eliminate wrong answers

Option B is wrong because deleting the stack destroys all resources and does not preserve the failed state for investigation — it is destructive and counterproductive. Option C is wrong because a change set only previews what will change; it does not execute the update or surface runtime resource errors. Option D is wrong because describe-stack-resources shows resource status (e.g., UPDATE_FAILED) but not the underlying error message, which is in the stack events.

158
MCQmedium

A company runs a containerized application on Amazon ECS with the Fargate launch type. The application writes logs to stdout, which are captured by the awslogs driver and sent to Amazon CloudWatch Logs. The operations team notices that during peak hours, log ingestion costs have increased significantly, and they want to reduce costs without losing critical error logs. Which solution should a solutions architect recommend?

A.Configure the awslogs driver to use a different log group with a shorter retention period.
B.Reduce the ECS task count during peak hours to lower the volume of logs generated.
C.Enable CloudWatch Logs subscription filters to export logs to Amazon S3 and delete them from CloudWatch Logs.
D.Use the FireLens log router to filter and route only error-level logs to CloudWatch Logs.
AnswerD

FireLens is a log router for ECS that uses Fluent Bit or Fluentd to process and route logs. By configuring filters, you can drop non-error logs before they reach CloudWatch Logs, reducing ingestion volume and cost. Critical error logs are still captured, meeting the requirement. This approach is native to ECS and requires only task definition changes.

Why this answer

The awslogs driver sends all logs to CloudWatch Logs, incurring ingestion costs. FireLens allows you to filter logs at the source, so only error-level logs are forwarded to CloudWatch Logs. This reduces ingestion volume and cost while preserving critical error logs.

It is a native ECS feature that requires only task definition changes, making it the most efficient solution.

Exam trap

The trap here is thinking that changing retention or exporting logs will reduce ingestion costs, when the real cost driver is the volume of logs ingested into CloudWatch Logs.

159
MCQmedium

A solutions architect deployed an AWS Lambda function using a deployment package. The function logs the error shown in the exhibit. What is the most likely cause?

A.The deployment package does not include the 'express' npm dependency.
B.The Lambda function has exceeded the maximum memory limit.
C.The Lambda function handler is incorrectly configured.
D.The Lambda execution role does not have permissions to access the module.
AnswerA

The error 'Cannot find module' means the module is missing from the package.

Why this answer

The error indicates that the 'express' module is not found, which means it was not included in the deployment package. Option B is wrong because the function ran, so the handler is correct. Option C is wrong because the Lambda execution role does not affect module availability.

Option D is wrong because the error is a missing module, not a memory issue.

160
MCQhard

A company runs a stateless web application on an Auto Scaling group of Amazon EC2 instances behind an Application Load Balancer. The instances use a launch template with a base Amazon Machine Image and run a user data script that installs the application, which takes about 8 minutes. During a scale-out event, new instances fail the load balancer health checks for several minutes, causing 5xx errors. The company wants to reduce the time from instance launch to serving traffic without changing the application. Which solution will meet these requirements MOST cost-effectively?

A.Create a golden Amazon Machine Image with the application pre-installed and update the launch template to use it.
B.Increase the instance size in the launch template to a larger instance type.
C.Configure the Auto Scaling group to use a warm pool with a large number of pre-initialized instances.
D.Enable Elastic Load Balancing cross-zone load balancing and increase the health check interval.
AnswerA

A golden AMI eliminates the 8-minute installation during boot, so new instances pass health checks quickly. This is the most cost-effective fix because it requires no additional running services and directly addresses the slow bootstrap. Updating the launch template ensures all new instances use the pre-baked image, reducing scale-out latency.

Why this answer

Baking the application into a golden AMI removes the lengthy user data installation step, so new instances can pass health checks almost immediately after launch. This directly reduces scale-out latency and is the most cost-effective because it avoids ongoing costs of warm pools or larger instances. Other options either add cost or do not address the slow bootstrap.

Exam trap

The trap here is assuming that a warm pool is always the most cost-effective way to reduce launch time, when a golden AMI eliminates the bootstrap delay entirely without ongoing costs.

161
MCQmedium

A company runs a web application on Amazon EC2 instances in an Auto Scaling group. The application stores user session data in a local MySQL database on each instance, which has caused issues when instances are replaced. The company wants to make the application stateless and improve scalability. Which solution should a solutions architect recommend?

A.Store session data in an Amazon RDS for MySQL database with Multi-AZ.
B.Use Amazon S3 to store session data and have the application read/write to it.
C.Enable sticky sessions on the Application Load Balancer.
D.Move the session data to an Amazon ElastiCache for Redis cluster and configure the application to use it.
AnswerD

Storing session data in ElastiCache for Redis decouples session state from individual instances, making the application stateless. Redis provides high performance and scalability, and it is a managed service, reducing operational overhead. This allows the Auto Scaling group to scale in and out without losing session data, and it improves the application's ability to handle load.

Why this answer

To make the application stateless, session data must be externalized to a shared, scalable store. Amazon ElastiCache for Redis is an in-memory data store that provides low-latency access and high throughput, ideal for session management. It is a managed service, so it reduces operational overhead.

This allows instances to be added or removed without affecting user sessions, improving scalability and resilience.

Exam trap

The trap here is thinking that sticky sessions or storing session data in a database solves the statelessness problem, when in fact they either don't remove state from instances or introduce performance and scalability limitations.

162
MCQmedium

A company has a serverless application using AWS Lambda and Amazon API Gateway. The application experiences cold starts that cause latency spikes. Which solution would reduce the impact of cold starts?

A.Configure Provisioned Concurrency for the Lambda function.
B.Increase the Lambda function memory allocation.
C.Decrease the Lambda function timeout.
D.Use a VPC and enable Lambda to access resources in the VPC.
AnswerA

Provisioned Concurrency pre-initialises a specified number of Lambda execution environments, so invocations skip the init phase that causes cold-start latency. It directly satisfies the stem's requirement to reduce cold-start impact for the API Gateway-fronted function, unlike memory tuning or reserved concurrency, which do not pre-warm environments.

Why this answer

Provisioned Concurrency pre-initializes a specified number of Lambda execution environments so they are ready to respond immediately, eliminating cold starts for that concurrency level. This directly addresses latency spikes caused by cold starts. It is the purpose-built feature for latency-sensitive serverless workloads.

Exam trap

SAP-C02 often tests cold start mitigation — candidates pick 'increase memory' because it speeds execution, but memory tuning does not eliminate cold starts; only Provisioned Concurrency (or SnapStart for Java) directly addresses initialization latency.

How to eliminate wrong answers

Option B is wrong because increasing memory allocation speeds up execution and can slightly reduce init time, but it does not eliminate cold starts — new environments are still created on demand. Option C is wrong because decreasing the timeout makes the function fail faster, not start faster, and can cause more errors. Option D is wrong because placing Lambda in a VPC historically increased cold start duration due to ENI creation (now improved with Hyperplane ENIs), and it does not reduce cold starts — it can worsen them.

163
MCQmedium

A company uses AWS CodePipeline to deploy a serverless application built with AWS SAM. The pipeline has a source stage from CodeCommit, a build stage using CodeBuild, and a deploy stage using CloudFormation. The team wants to ensure that the application is automatically tested in a staging environment before being deployed to production. The testing should include integration tests that simulate user interactions. Which solution should a solutions architect recommend to meet these requirements with minimal changes?

A.Add a manual approval action before the deploy stage and require testers to run integration tests locally before approving.
B.Use AWS CodeDeploy to manage the deployment and configure a pre-traffic hook that runs integration tests on the staging environment before shifting traffic to production.
C.Configure the existing deploy stage to deploy to a staging environment first, run tests using a Lambda function triggered by CloudFormation events, and then manually approve production deployment.
D.Add a new stage to the pipeline after the build stage that uses CodeBuild to run integration tests against a staging environment created by a separate CloudFormation stack.
AnswerD

Adding a test stage after build allows integration tests to run against a staging environment before production deployment. CodeBuild can execute test scripts, and a separate CloudFormation stack can provision the staging environment. This approach integrates seamlessly with CodePipeline and requires minimal changes to the existing pipeline structure, ensuring tests pass before production.

Why this answer

Adding a dedicated test stage after the build stage allows integration tests to run automatically against a staging environment before production deployment. CodeBuild can execute test scripts, and a separate CloudFormation stack can create the staging environment. This integrates cleanly with CodePipeline and requires minimal changes, ensuring tests are run automatically and consistently.

Exam trap

The trap here is assuming that CodeDeploy hooks or manual approvals can provide automatic integration testing, but they either require significant pipeline changes or do not automate the testing process.

164
Multi-Selecthard

A company runs a critical application on EC2 instances in an Auto Scaling group. They want to ensure that during a patching cycle, the application remains available and no requests are dropped. Which TWO strategies should they implement? (Choose TWO.)

Select 2 answers
A.Increase the desired capacity of the Auto Scaling group before patching.
B.Stop all instances at the same time to apply patches consistently.
C.Perform a rolling update using a batch size of 50% with a pause time.
D.Use an Auto Scaling lifecycle hook to wait for a custom action before terminating instances.
E.Use Amazon Inspector to automatically patch instances.
AnswersC, D

A rolling update replaces instances in batches, so the remaining 50% of the Auto Scaling group continues serving traffic while each batch is patched. The pause time lets new instances pass health checks before the next batch begins, preventing dropped requests.

Why this answer

Option C is correct because a rolling update with a batch size of 50% and a pause time replaces instances in controlled waves, so the remaining healthy instances continue serving traffic and capacity never drops to zero, keeping the application available during patching. Option D is correct because an Auto Scaling lifecycle hook puts instances into a wait state (Terminating:Wait or Launching:Wait) so a custom action—such as draining connections, deregistering from the load balancer, or finishing in-flight requests—can complete before the instance is terminated, preventing dropped requests. Option A is not correct because simply raising desired capacity adds instances but does not orchestrate safe patching or connection draining, so requests can still be dropped when instances are replaced.

Option B is not correct because stopping all instances simultaneously causes an outage and drops all requests, directly violating the availability requirement. Option E is not correct because Amazon Inspector is a vulnerability assessment service that detects issues; it does not automatically patch EC2 instances.

Exam trap

SAP-C02 often tests whether candidates conflate vulnerability detection (Inspector) with automated remediation, or assume that scaling out alone guarantees availability during patching.

165
Multi-Selecthard

A company is using AWS CloudTrail to log API activity. The security team wants to ensure that log files are tamper-proof and can be used for forensic analysis. Which TWO actions should the company take?

Select 2 answers
A.Enable S3 Object Lock on the CloudTrail S3 bucket.
B.Enable CloudTrail log file validation.
C.Use server-side encryption with AWS KMS managed keys (SSE-KMS).
D.Enable S3 Transfer Acceleration on the CloudTrail S3 bucket.
E.Set an S3 Lifecycle policy to transition logs to Amazon S3 Glacier.
AnswersA, B

S3 Object Lock enforces WORM protection at the object level, preventing deletion or modification of CloudTrail log files for a defined retention period. This directly satisfies the tamper-proof requirement, preserving log integrity so the files remain admissible for forensic analysis even if credentials are compromised.

Why this answer

Option A is correct because enabling S3 Object Lock on the CloudTrail S3 bucket (in compliance or governance mode with a retention period) uses WORM (write-once-read-many) semantics to prevent log files from being deleted or overwritten, which is essential for tamper-proof forensic evidence. Option B is correct because CloudTrail log file validation generates a digitally signed digest file for each log, allowing you to verify via the AWS CLI (aws cloudtrail validate-logs) that logs have not been altered or deleted after delivery. Option C is not correct here because SSE-KMS provides encryption at rest and access control but does not by itself prevent tampering or deletion of log files.

Option D is not correct because S3 Transfer Acceleration only speeds up uploads over long distances and has no bearing on log integrity. Option E is not correct because a Lifecycle policy transitioning logs to S3 Glacier changes storage class and could affect availability, but it does not make logs tamper-proof.

Exam trap

SAP-C02 often tests the misconception that encryption (SSE-KMS) equals tamper-proofing — candidates pick encryption when the question actually demands integrity and immutability controls like Object Lock and log file validation.

166
MCQhard

A company runs a critical application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application experiences intermittent latency spikes. The operations team has enabled detailed CloudWatch metrics and logs, but cannot identify the root cause. What is the MOST effective way to troubleshoot the latency issue?

A.Enable detailed ALB metrics and create a CloudWatch dashboard.
B.Migrate the application to AWS Lambda to eliminate EC2 overhead.
C.Replace the ALB with a Network Load Balancer (NLB) for lower latency.
D.Use AWS X-Ray to trace requests from the ALB to the application and downstream services.
E.Add more EC2 instances behind the ALB to distribute the load.
AnswerD

AWS X-Ray traces individual requests end-to-end, capturing segment timing from the ALB through the application to downstream calls. This pinpoints which component introduces the intermittent latency, satisfying the need to isolate a root cause that aggregate CloudWatch metrics and logs cannot attribute to a specific request path.

Why this answer

AWS X-Ray is the purpose-built distributed tracing service that follows a request as it flows from the ALB through the EC2 application and into any downstream services or AWS resources. It captures segment and subsegment timing data, so it can pinpoint exactly which hop (e.g., a slow database call, an external API, or application code) is introducing the latency spikes. Since the team already has detailed CloudWatch metrics and logs without identifying the cause, only request-level tracing can correlate the latency to a specific component.

Exam trap

SAP-C02 often tests the distinction between monitoring (CloudWatch metrics/logs) and distributed tracing (X-Ray) — candidates pick CloudWatch dashboards because they sound comprehensive, missing that only X-Ray can trace a single request across service boundaries.

How to eliminate wrong answers

Option A is wrong because detailed ALB metrics and dashboards only show aggregate load-balancer-level data (request counts, target response times, HTTP codes) and cannot isolate which internal call or downstream dependency is slow. Option B is wrong because migrating to Lambda is a re-architecture decision, not a troubleshooting step, and Lambda introduces its own cold-start and concurrency latency characteristics. Option C is wrong because NLB operates at Layer 4 and offers lower per-connection latency but provides no application-layer visibility, so it would not diagnose an application-level latency spike.

Option E is wrong because adding EC2 instances addresses capacity-driven latency but does nothing to identify the root cause, and the problem may not be load-related at all.

167
MCQmedium

A solutions architect runs the above commands for an EC2 instance. The instance state is 'running' but the system status is 'impaired'. What should the solutions architect do to restore the instance?

A.Start the instance.
B.Stop and start the instance.
C.Modify the instance type.
D.Reboot the instance.
AnswerB

A system status check failure indicates the underlying host or hypervisor is impaired, not the guest OS. Stopping and starting migrates the instance to new hardware, clearing the fault; a reboot alone stays on the same impaired host.

Why this answer

When the system status check fails, it indicates a hardware issue. AWS recommends stopping and starting the instance to move it to new underlying hardware. Option A is incorrect because the instance is already running, so starting it does nothing.

Option C is incorrect because modifying the instance type does not resolve underlying hardware issues. Option D is incorrect because rebooting the instance does not change the underlying hardware and may not resolve the impairment.

168
MCQmedium

A solutions architect is reviewing an application that writes millions of small records per hour to an Amazon DynamoDB table. The table uses a partition key of customer ID, and a few very large customers generate most of the traffic. During peak periods, the application receives ProvisionedThroughputExceededException errors even though total consumed capacity is below the provisioned amount. Which action will resolve the throttling MOST effectively?

A.Switch the table from provisioned capacity to on-demand capacity mode so DynamoDB automatically handles all traffic spikes.
B.Redesign the table to use a composite partition key that appends a random or calculated suffix to the customer ID, distributing writes across more partitions.
C.Create a global secondary index on the customer ID attribute and direct all reads and writes to the index instead of the base table.
D.Enable DynamoDB auto scaling to increase the provisioned read and write capacity units when consumed capacity approaches the limit.
AnswerB

Hot partitions occur when a single partition key value concentrates traffic. Adding a high-cardinality suffix spreads each large customer's writes across many partitions, each with its own throughput ceiling. This directly addresses the imbalance causing ProvisionedThroughputExceededException while keeping total capacity adequate. It is the standard DynamoDB remedy for skewed access patterns.

Why this answer

The throttling is caused by hot partitions, where a few high-traffic customer IDs exceed the per-partition throughput ceiling despite ample table-level capacity. Appending a random or calculated suffix to the partition key spreads each large customer's writes across many partitions, eliminating the bottleneck. Simply adding capacity, switching to on-demand, or moving to an index with the same skewed key does not redistribute the load.

Exam trap

The trap here is assuming ProvisionedThroughputExceededException always means total capacity is too low, when it frequently signals a hot partition caused by a low-cardinality or skewed partition key.

169
Matchingmedium

Match each AWS database service to its characteristic.

Drag a concept onto its matching description — or click a concept then click the description.

Concepts
Matches

MySQL/PostgreSQL-compatible with high availability

Fully managed NoSQL key-value and document database

Petabyte-scale data warehouse for analytics

In-memory caching with Redis or Memcached

Managed relational database for multiple engines

Why these pairings

Each AWS database service targets specific use cases: RDS for relational workloads, DynamoDB for NoSQL, Redshift for analytics, and ElastiCache for caching. Common confusions include mixing up NoSQL with relational and caching with warehousing.

170
Drag & Dropmedium

Drag and drop the steps to troubleshoot an EC2 instance that is unreachable via SSH in the correct order.

Drag or tap steps into the slots.

Steps
Order
1Step 1
2Step 2
3Step 3
4Step 4

Why this order

Start with security groups, then network ACLs, then public IP, then system status, and finally console output.

171
MCQmedium

A Lambda function logs are being retained for 30 days. The company wants to reduce costs by deleting logs older than 7 days. What should they do?

A.Export the logs to S3 and delete the log group.
B.Use the put-retention-policy command to set retentionInDays to 7.
C.Configure an S3 Lifecycle policy on the log group's underlying storage.
D.Create a CloudTrail trail to capture log events and expire them after 7 days.
AnswerB

Setting a CloudWatch Logs retention policy of 7 days via `put-retention-policy` directly satisfies the stem's cost constraint, since CloudWatch automatically deletes log events once they exceed the configured `retentionInDays` value. This is the native, serverless mechanism for lifecycle management, requiring no custom deletion code or scheduled Lambda invocations.

Why this answer

CloudWatch Logs retention is controlled per log group via the PutRetentionPolicy API (aws logs put-retention-policy), which sets retentionInDays to a value such as 7. This automatically deletes log events older than the specified period, directly reducing storage costs without changing the logging pipeline. It is the native, lowest-effort solution.

Exam trap

SAP-C02 often tests whether candidates know that CloudWatch Logs retention is set per log group via put-retention-policy, and distracts with S3 lifecycle policies — candidates who assume CloudWatch logs live in S3 pick the wrong option.

How to eliminate wrong answers

Option A is wrong because exporting logs to S3 and deleting the log group removes the ability to query logs in CloudWatch and does not set a retention policy — it is a migration, not a retention change. Option C is wrong because CloudWatch Logs does not expose an underlying S3 bucket to attach a lifecycle policy to; log groups are managed by CloudWatch, not S3. Option D is wrong because CloudTrail captures API activity, not Lambda function logs, and CloudTrail does not manage CloudWatch log retention.

172
MCQhard

A company runs a microservices application on Amazon ECS with the EC2 launch type. The application consists of multiple services that communicate over HTTP. The operations team wants to improve observability and reduce the time to diagnose performance issues between services. They have already enabled CloudWatch Logs and metrics. They want to trace requests as they flow through the services and identify latency bottlenecks. What should a solutions architect recommend?

A.Configure CloudWatch ServiceLens to automatically trace requests without code changes.
B.Enable AWS X-Ray tracing by instrumenting the application code and running the X-Ray daemon as a sidecar container in each ECS task.
C.Use AWS CloudTrail to log all API calls between services and analyze the logs in Amazon Athena.
D.Enable VPC Flow Logs on the ECS cluster's VPC and analyze the logs with Amazon QuickSight.
AnswerB

AWS X-Ray provides end-to-end tracing of requests as they travel through microservices. By instrumenting the application with the X-Ray SDK and running the X-Ray daemon as a sidecar in each ECS task, the daemon can collect trace data and send it to X-Ray. This allows visualization of service maps, latency analysis, and identification of bottlenecks. It integrates natively with ECS and is the recommended approach for distributed tracing in microservices.

Why this answer

AWS X-Ray is designed for distributed tracing of microservices. Instrumenting the application with the X-Ray SDK and running the X-Ray daemon as a sidecar in each ECS task enables the collection of trace data. This provides a service map, latency analysis, and error identification.

Other options do not capture application-level request flows or require code instrumentation.

Exam trap

The trap here is thinking that CloudWatch ServiceLens or VPC Flow Logs can provide tracing without code changes, but X-Ray requires instrumentation to generate the trace data that ServiceLens then visualizes.

173
MCQmedium

A company is migrating an on-premises application to AWS. The application requires persistent shared storage that can be accessed by multiple EC2 instances simultaneously with strong consistency. Which AWS storage solution should the company use?

A.Amazon S3 with S3 File Gateway.
B.Amazon S3 Glacier Deep Archive.
C.Amazon EBS with Multi-Attach enabled.
D.Amazon EFS
AnswerD

Amazon EFS provides a shared, POSIX-compliant NFS file system mountable concurrently by many EC2 instances across Availability Zones, with strong read-after-write consistency. This satisfies the simultaneous multi-instance access and strong consistency constraints that single-attach EBS volumes cannot meet.

Why this answer

Amazon EFS is a fully managed, scalable, shared file storage service for EC2 instances. It provides strong consistency and supports simultaneous access from multiple EC2 instances across multiple Availability Zones. It is designed for applications that require shared storage, making it the correct choice.

The other options do not provide persistent shared storage with strong consistency for multiple instances.

Exam trap

The trap is confusing EBS Multi-Attach with a shared file system. EBS Multi-Attach allows multiple instances to attach the same volume, but it does not provide a clustered file system, so concurrent writes can lead to data corruption.

How to eliminate wrong answers

Option A is wrong because S3 File Gateway provides a file interface to S3, but it does not offer strong consistency for shared access from multiple EC2 instances; it is primarily for backup and archival. Option B is wrong because S3 Glacier Deep Archive is an archival storage service with retrieval times of hours, not suitable for persistent shared storage. Option C is wrong because EBS with Multi-Attach allows a volume to be attached to multiple instances in the same Availability Zone, but it does not provide strong consistency for concurrent writes and is not a shared file system.

174
Multi-Selecthard

A company runs a microservices architecture on Amazon ECS with Fargate. The operations team observes that some services are experiencing high latency during peak hours. The team wants to identify the root cause. Which THREE approaches should the team use? (Choose THREE.)

Select 3 answers
A.Use AWS X-Ray to trace requests through the microservices
B.Enable AWS CloudTrail to log API calls
C.Enable VPC Flow Logs to analyze network traffic
D.Use Amazon CloudWatch ServiceLens to correlate metrics, logs, and traces
E.Enable Container Insights for Amazon ECS
AnswersA, D, E

X-Ray traces individual requests as they traverse microservices, revealing which downstream call adds latency during peak hours. This satisfies the stem's requirement to identify the root cause by exposing per-segment timing across the distributed request path.

Why this answer

Option A is correct because AWS X-Ray traces requests as they travel through the microservices, revealing which service or downstream call is introducing latency during peak hours. Option D is correct because CloudWatch ServiceLens combines traces from X-Ray with CloudWatch metrics and logs in a single view, making it possible to correlate latency spikes with specific services and resources. Option E is correct because Container Insights for Amazon ECS collects CPU, memory, network, and task-level metrics for Fargate tasks, helping pinpoint resource saturation that causes high latency.

Option B is not appropriate because CloudTrail records control-plane API activity, not application request latency. Option C is not appropriate because VPC Flow Logs capture IP-level traffic metadata and cannot trace application requests or identify which microservice is slow.

Exam trap

SAP-C02 often tests whether candidates pick auditing tools (CloudTrail) or network-layer tools (VPC Flow Logs) for application performance troubleshooting, confusing observability layers.

175
MCQmedium

A solutions architect is reviewing an existing three-tier application running on Amazon EC2 instances in an Auto Scaling group. The database tier uses Amazon RDS for MySQL with a single Availability Zone deployment. The business requires improved resilience and wants to minimize changes to the application. The RPO is 5 minutes and the RTO is 2 minutes. Which change should the architect recommend?

A.Convert the RDS instance to a Multi-AZ deployment with a standby replica in another Availability Zone.
B.Migrate the database to Amazon DynamoDB with global tables and modify the application to use the DynamoDB API.
C.Create a read replica in another Availability Zone and update the application to send writes to the read replica during a failure.
D.Enable automated backups with a 5-minute backup window and restore the database to a new instance if a failure occurs.
AnswerA

Multi-AZ creates a synchronous standby in a second Availability Zone and automatically fails over the DNS endpoint, typically within one to two minutes. It requires no application changes because the endpoint remains the same. This meets the 2-minute RTO and near-zero RPO for Availability Zone failure, making it the most appropriate resilience improvement for the existing database tier.

Why this answer

A Multi-AZ deployment provides synchronous standby replication and automatic failover to a second Availability Zone, meeting the 2-minute RTO without application changes. Read replicas, backup restores, and NoSQL migration either require manual steps, longer recovery, or significant code changes, so they do not satisfy the constraints.

Exam trap

The trap here is confusing read replicas with Multi-AZ standby replicas, assuming that a read replica can provide automatic failover for writes.

176
MCQhard

A company has a legacy monolithic application running on a single EC2 instance. The application stores customer data in an attached EBS volume. The company wants to modernize the application to improve scalability and availability. Which approach should a solutions architect recommend?

A.Use a larger EC2 instance with enhanced networking.
B.Configure multiple EC2 instances to share the same EBS volume using Multi-Attach.
C.Replace the EBS volume with an Aurora RDS database.
D.Refactor the application into microservices running on Amazon ECS with data stored in Amazon S3.
AnswerD

Refactoring into microservices on Amazon ECS removes the single-instance bottleneck, enabling horizontal scaling and multi-AZ availability. Moving data to Amazon S3 decouples storage from compute, satisfying the scalability and availability constraints that the monolithic EBS-attached design cannot meet.

Why this answer

Migrating to a containerized, stateless application decouples storage and allows scaling. Option A is wrong because a larger instance still has a single point of failure. Option B is wrong because Multi-Attach EBS volumes have limited support and multiple instances writing to the same volume can cause data corruption.

Option C is wrong because RDS is for databases, not for application data stored in files.

177
Multi-Selecthard

A company is deploying a new application on AWS and wants to implement a least-privilege IAM policy for an EC2 instance that needs to read from an S3 bucket (my-bucket) and write logs to CloudWatch Logs. Which TWO statements should be included in the IAM policy? (Choose two.)

Select 2 answers
A.{"Effect": "Allow", "Action": ["s3:GetObject"], "Resource": "arn:aws:s3:::my-bucket/*"}
B.{"Effect": "Allow", "Action": ["s3:*"], "Resource": "arn:aws:s3:::my-bucket/*"}
C.{"Effect": "Allow", "Action": ["logs:CreateLogStream", "logs:PutLogEvents"], "Resource": "arn:aws:logs:us-east-1:123456789012:log-group:my-log-group:*"}
D.{"Effect": "Allow", "Action": ["logs:PutLogEvents"], "Resource": "*"}
E.{"Effect": "Allow", "Action": ["s3:PutObject"], "Resource": "arn:aws:s3:::my-bucket/*"}
AnswersA, C

Granting s3:GetObject on arn:aws:s3:::my-bucket/* authorises reads of objects within the bucket, matching the least-privilege read requirement. The wildcard covers every object key while excluding bucket-level actions such as s3:ListBucket, so only the access the EC2 instance genuinely needs is permitted.

Why this answer

Option A is correct because it grants only the s3:GetObject action needed to read objects from my-bucket, scoped to the bucket's object ARN arn:aws:s3:::my-bucket/*, which satisfies least privilege for read access. Option C is correct because it grants exactly the CloudWatch Logs actions required to write logs (logs:CreateLogStream and logs:PutLogEvents) and scopes them to the specific log group ARN, avoiding broader permissions. Option B is incorrect because s3:* grants all S3 actions on the bucket, violating least privilege.

Option D is incorrect because logs:PutLogEvents on Resource "*" is overly broad and also omits logs:CreateLogStream needed to create the stream. Option E is incorrect because s3:PutObject grants write access to S3, which the instance does not need since it only reads from the bucket.

Exam trap

The trap is that candidates often include unnecessary permissions (like s3:PutObject) beyond what the stem explicitly requires, failing the least-privilege requirement. Always scope permissions to only the actions and resources stated.

178
MCQhard

A company is using t3.large instances in an Auto Scaling group. They want to launch instances that support both x86_64 and arm64 architectures. Based on the exhibit, can they meet this requirement with t3.large?

A.No, because t3.large instances only support x86_64 architecture.
B.Yes, because t3.large supports both architectures.
C.No, because t3.large is not a current generation instance type.
D.Yes, but only if they use a custom AMI that supports both architectures.
AnswerA

T3 instances are exclusively x86_64; arm64 requires Graviton-based families such as t4g, m6g or c7g. Since the stem demands a single instance type supporting both architectures, t3.large cannot satisfy it — no x86 instance does. The requirement is therefore unmet with t3.large.

Why this answer

T3.large instances only support the x86_64 architecture. They do not support arm64. Therefore, the company cannot meet the requirement of supporting both x86_64 and arm64 architectures with t3.large instances.

Options B and D are incorrect because t3.large does not support arm64, and a custom AMI cannot add architecture support beyond what the instance type offers. Option C is incorrect because t3.large is a current generation instance type, but that is not relevant to the architecture support limitation.

179
MCQhard

A financial services company runs a critical application on Amazon EC2 instances in an Auto Scaling group across multiple Availability Zones. The application uses an Amazon RDS for MySQL database with Multi-AZ deployment. The company has a recovery time objective (RTO) of 15 minutes and a recovery point objective (RPO) of 1 hour for the database. During a recent disaster recovery drill, the solutions architect simulated an Availability Zone failure by terminating all EC2 instances and the primary RDS instance in one AZ. The Auto Scaling group launched new instances in the other AZ, and the RDS Multi-AZ failover completed in about 2 minutes. However, the application remained unavailable for 30 minutes because the new EC2 instances could not connect to the RDS secondary instance. The security groups are configured correctly. The RDS instance is not publicly accessible. What is the MOST likely cause of the connectivity issue?

A.The security group for the EC2 instances does not allow outbound traffic to the RDS instance.
B.The RDS Multi-AZ failover took longer than expected, exceeding the RTO.
C.The RDS endpoint DNS record did not update to point to the new primary.
D.The application is using a hardcoded IP address or an endpoint that points to the old primary RDS instance instead of the RDS DNS name.
AnswerD

The application is likely using a hardcoded IP address or an endpoint pointing to the old primary RDS instance instead of the RDS DNS name, which fails after failover. This is the most likely cause. Option D is correct.

Why this answer

The RDS Multi-AZ failover promotes the standby to primary, changing the underlying IP address. If the application uses a hardcoded IP address or an endpoint that points to the old primary, it will fail to connect after failover. The correct approach is to use the RDS DNS name (CNAME) which automatically resolves to the current primary.

Option A is incorrect because the stem states the security groups are correctly configured. Option B is incorrect because the failover completed in about 2 minutes, which is within normal Multi-AZ failover time (1-2 minutes). Option C is incorrect because the RDS endpoint DNS record updates quickly (within seconds) after a failover.

180
MCQmedium

A company runs a web application on Amazon EC2 instances in an Auto Scaling group. The application uses an Amazon RDS for MySQL database. The company wants to improve the performance of read-heavy workloads and reduce the load on the primary database instance. The application currently connects to the primary instance for all read and write operations. The solutions architect needs to implement a solution that requires minimal changes to the application code. Which approach should the solutions architect recommend?

A.Migrate the database to Amazon Aurora MySQL and enable Aurora Auto Scaling for read replicas.
B.Create an RDS read replica and configure the application to direct read queries to the read replica endpoint.
C.Enable Multi-AZ deployment for the RDS instance to automatically offload read traffic to the standby instance.
D.Use Amazon ElastiCache for Redis to cache the results of frequent read queries.
AnswerB

RDS read replicas are designed to offload read traffic from the primary instance. By creating a read replica and updating the application to send read queries to the replica's endpoint, you can distribute the read load and improve performance. This requires minimal code changes, typically just changing the connection string for read operations. It is a standard and effective solution for read-heavy workloads.

Why this answer

Creating an RDS read replica and directing read queries to it is the most straightforward way to offload read traffic from the primary database. It requires only a change to the application's connection configuration for read operations, with no schema changes or major code modifications. This improves read performance and reduces load on the primary instance, addressing the company's needs effectively.

Exam trap

The trap here is assuming that Multi-AZ deployments can be used for read scaling, when in fact the standby instance is not accessible for read operations.

181
MCQmedium

A company runs a web application on a single EC2 instance. They want to improve availability and fault tolerance with minimal architectural changes. What should they do?

A.Attach multiple EBS volumes to the instance.
B.Use an Auto Scaling group with a minimum of two instances across two Availability Zones.
C.Create multiple subnets in the same Availability Zone.
D.Upgrade to a larger instance type.
AnswerB

An Auto Scaling group spanning two Availability Zones replaces the single instance with redundant capacity, so an AZ failure no longer takes the application down. This satisfies the fault-tolerance requirement while keeping the same instance-based architecture, avoiding a redesign.

Why this answer

The correct answer is B because using an Auto Scaling group with a minimum of two instances across two Availability Zones provides high availability and fault tolerance by distributing the application across multiple physically separate data centers. If one Availability Zone fails, the other instance continues to serve traffic, and the Auto Scaling group can automatically replace failed instances. This approach requires minimal architectural changes—just moving from a single instance to an Auto Scaling group—and directly addresses the requirements.

Exam trap

SAP-C02 often tests the misconception that adding more resources to a single instance (like multiple EBS volumes or a larger instance type) improves availability, when in fact true fault tolerance requires distributing the workload across multiple Availability Zones.

How to eliminate wrong answers

Option A is wrong because attaching multiple EBS volumes to a single instance does not improve availability; EBS volumes are tied to a single Availability Zone and if the instance fails, the volumes become inaccessible, and the instance remains a single point of failure. Option C is wrong because creating multiple subnets in the same Availability Zone does not provide fault tolerance; all subnets in the same AZ share the same physical infrastructure, so an AZ failure would still take down the application. Option D is wrong because upgrading to a larger instance type only increases capacity, not availability; it still runs on a single instance in a single AZ, so any failure of that instance or AZ results in downtime.

182
MCQhard

A company has a monolithic application running on a single Amazon RDS for MySQL DB instance. The application is experiencing performance issues due to heavy read traffic. The company wants to implement a solution that offloads read traffic with minimal application changes. What should a solutions architect do?

A.Create a read replica of the RDS instance and modify the application connection string to use the reader endpoint.
B.Migrate the application to use Amazon DynamoDB with global tables.
C.Use Amazon RDS Multi-AZ with a standby instance for read traffic.
D.Implement Amazon ElastiCache in front of the database to cache read queries.
AnswerA

RDS read replicas replicate asynchronously from the primary, and the reader endpoint load-balances connections across all replicas. Pointing the connection string at this endpoint diverts SELECT queries without schema or code rewrites, satisfying the minimal-change constraint while relieving the primary's read pressure.

Why this answer

Creating a read replica of the RDS for MySQL DB instance and modifying the application connection string to use the reader endpoint offloads read traffic from the primary instance with minimal application changes. The reader endpoint automatically distributes connections across all read replicas, reducing the load on the primary instance without requiring code changes beyond updating the connection string.

Exam trap

The trap here is that candidates often confuse Multi-AZ standby instances with read replicas, not realizing that Multi-AZ standby instances are strictly for high availability and cannot serve read traffic, while read replicas are specifically designed to offload read workloads.

How to eliminate wrong answers

Option B is wrong because migrating to Amazon DynamoDB with global tables would require significant application changes to adapt from a relational to a NoSQL data model, which contradicts the requirement for minimal application changes. Option C is wrong because Amazon RDS Multi-AZ with a standby instance does not support read traffic; the standby instance is only for failover and cannot serve read requests. Option D is wrong because implementing Amazon ElastiCache would require application code changes to implement caching logic, which does not meet the minimal application changes requirement.

183
MCQmedium

A company runs a containerized application on Amazon ECS with Fargate. The application uses an Application Load Balancer (ALB) to distribute traffic. The company has configured a target tracking scaling policy based on average memory utilization. During a traffic spike, the ECS service scales out, but the new tasks are immediately deregistered and replaced. The CloudWatch logs show that the new tasks are failing the ALB health check. The health check is configured to ping the '/health' endpoint on the container. The solutions architect verifies that the application container correctly responds to the '/health' endpoint with a 200 status code. What is the MOST likely cause of the health check failures?

A.The ALB is not configured with a proper listener rule to forward traffic to the target group.
B.The security group attached to the ECS tasks does not allow inbound traffic from the ALB on the health check port.
C.The deregistration delay (connection draining) is set too high, causing the ALB to think the tasks are unhealthy.
D.The health check path is incorrect; it should be '/index.html' instead of '/health'.
AnswerB

Fargate tasks receive a security group separate from the ALB's. If that group lacks an inbound rule permitting the ALB's health check traffic on the container port, the ALB probes time out and mark tasks unhealthy, triggering deregistration and replacement despite the application returning 200 locally.

Why this answer

Since the application container correctly responds to the '/health' endpoint with a 200 status code, the health check failures are likely due to network connectivity. For Fargate tasks, each task gets an ENI, and the security group attached to the tasks must allow inbound traffic from the ALB on the health check port. If this rule is missing, the ALB cannot reach the health check endpoint, causing tasks to be deregistered.

Option A is incorrect because the ALB listener rule is for routing traffic, not health checks. Option C is incorrect because a high deregistration delay would cause slow draining, not immediate health check failures. Option D is incorrect because the health check path is confirmed correct by the architect.

184
MCQmedium

An IAM policy condition allows launching EC2 instances only if the instance type is t2.micro or t2.small. A developer tries to launch a t2.medium instance. What happens?

A.The launch is denied only if the user does not have a separate policy allowing t2.medium.
B.The launch succeeds because the condition only allows, not denies.
C.The launch succeeds if the user has an additional Allow for t2.medium.
D.The launch is denied because t2.medium is not in the allowed list.
AnswerD

The condition key `ec2:InstanceType` evaluates the requested type against the allowed values, and t2.medium matches neither t2.micro nor t2.small. Because IAM denies any request failing a condition in an Allow statement, the RunInstances call is rejected outright. The developer receives an unauthorised operation error, satisfying the stem's allow-list constraint.

Why this answer

IAM policies are evaluated with an implicit deny by default; an Allow statement with a condition only grants permissions when the condition is satisfied. Since the condition restricts instance types to t2.micro or t2.small, launching a t2.medium does not match the condition, so the Allow does not apply and the request is denied. No separate Deny statement is needed—the absence of a matching Allow results in denial.

Exam trap

SAP-C02 often tests the misconception that a condition in an Allow statement acts as a deny; candidates must remember that a failed condition simply means the Allow does not apply, resulting in an implicit deny.

How to eliminate wrong answers

Option A is wrong because IAM does not require an explicit deny; the condition simply fails to match, so the Allow is not granted, and the request is denied regardless of other policies unless another policy explicitly allows t2.medium. Option B is wrong because conditions in Allow statements do restrict permissions; they are not merely permissive hints. Option C is wrong because while an additional Allow for t2.medium could grant access, the question states the policy only allows t2.micro/t2.small, and the developer has no such additional policy; the launch is denied.

185
MCQmedium

A company runs a web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application stores session state locally on each instance. The company wants to improve the availability and scalability of the application by making the session state external and allowing any instance to handle any request. The solution must minimize latency for session access and require minimal changes to the application code. Which approach should a solutions architect recommend?

A.Store session state in an Amazon RDS for MySQL database and modify the application to use the database for session storage.
B.Enable sticky sessions (session affinity) on the ALB and keep session state local on each instance.
C.Store session state in an Amazon ElastiCache for Redis cluster and modify the application to use the ElastiCache endpoint for session storage.
D.Use Amazon S3 to store session state and have the application read and write session data to S3 on each request.
AnswerC

ElastiCache for Redis provides a low-latency, in-memory data store that is ideal for session state. By externalizing sessions to Redis, any instance can handle any request, improving availability and scalability. The application code needs to be modified to read and write sessions to Redis, but this is a common and minimal change. Redis also supports high availability with automatic failover when using a multi-AZ replication group.

Why this answer

Externalizing session state to ElastiCache for Redis provides low-latency, high-performance session storage that allows any EC2 instance to handle any request. This improves availability and scalability. Modifying the application to use Redis is a standard pattern and requires minimal code changes compared to other options.

Sticky sessions do not solve the underlying issue, and RDS or S3 introduce higher latency.

Exam trap

The trap here is choosing sticky sessions as a quick fix, which does not externalize session state or improve availability.

186
MCQeasy

A company is migrating a monolithic application to microservices on AWS. They want to implement a continuous improvement process for existing services. Which AWS service should they use to collect and analyze operational metrics and logs from all microservices in a centralized location?

A.AWS Config
B.Amazon Inspector
C.Amazon CloudWatch
D.AWS X-Ray
AnswerC

Amazon CloudWatch aggregates metrics, logs and traces from every microservice into one place, with Logs Insights and dashboards for analysis. This centralised visibility underpins the continuous improvement process the stem requires, unlike per-service tooling that would fragment operational data.

Why this answer

Amazon CloudWatch is the AWS service designed to collect and analyze operational metrics and logs from all microservices in a centralized location. It provides monitoring, dashboards, alarms, and log aggregation, enabling continuous improvement through insights into performance and operational health.

Exam trap

The trap is confusing CloudWatch with X-Ray or Config, as all are monitoring-related, but only CloudWatch is the centralized service for metrics and logs collection and analysis.

How to eliminate wrong answers

Option A is wrong because AWS Config is used for assessing, auditing, and evaluating the configurations of AWS resources, not for collecting operational metrics and logs. Option B is wrong because Amazon Inspector is a vulnerability management service that scans workloads for security exposures, not for operational monitoring. Option D is wrong because AWS X-Ray is used for tracing and analyzing requests in distributed applications, which is more about debugging and performance analysis of individual requests, not centralized metrics and logs collection.

187
MCQeasy

Refer to the exhibit. A company has an Amazon ECS task definition with two containers. The 'web' container is essential, and the 'sidecar' container is not. The 'sidecar' container exits unexpectedly. What will happen to the task?

A.The sidecar container will be marked as essential.
B.ECS will automatically restart the sidecar container.
C.The task continues running as normal.
D.The ECS task will be stopped.
AnswerC

Only essential containers determine task fate; a non-essential container exiting does not stop the task. Since the sidecar is marked non-essential, ECS leaves the web container and the task running, satisfying the stem's scenario where the sidecar exits unexpectedly.

Why this answer

In an ECS task definition, only containers marked as essential cause the entire task to stop if they exit. Since the 'web' container is essential and the 'sidecar' container is not, the sidecar exiting does not stop the task; the task continues running with the web container unaffected.

Exam trap

The trap is that candidates assume any container failure stops the task, or that ECS restarts individual containers — the essential flag is the deciding factor and non-essential containers simply exit without task termination.

How to eliminate wrong answers

Option A is wrong because essential status is a static property defined in the task definition, not something ECS dynamically assigns when a container exits. Option B is wrong because ECS does not automatically restart individual non-essential containers within a running task; restart behavior is governed by the task's restart policy or the service scheduler, not by the container's exit alone. Option D is wrong because the task only stops if an essential container exits — the sidecar is explicitly non-essential, so its failure does not trigger task termination.

188
MCQmedium

A company has a production Amazon ECS service running on Fargate. The service needs to be updated to use a new task definition with different environment variables. The company wants to perform a rolling update with minimal impact. What is the correct way to update the service?

A.Delete the existing service and recreate it with the new task definition.
B.Modify the task definition and then restart the service.
C.Update the service with the new task definition and use a rolling update deployment controller.
D.Create a new service with the new task definition and delete the old one.
AnswerC

Updating the service with the new task definition and the rolling deployment controller replaces tasks incrementally, honouring the minimum healthy percent and maximum percent settings. This satisfies the minimal-impact constraint, since capacity remains available throughout, unlike recreate, which stops all tasks before starting replacements.

Why this answer

Updating an ECS service with a new task definition while using the rolling update deployment controller (ECS) performs a controlled replacement of tasks, maintaining the desired count and minimizing downtime. This is the standard, supported way to deploy a new task definition to an existing service.

Exam trap

SAP-C02 often tests the difference between ForceNewDeployment (same task definition, just restart) and UpdateService with a new revision (actual rolling update) — candidates who pick 'restart the service' miss that restart does not change the task definition.

How to eliminate wrong answers

Option A is wrong because deleting and recreating the service causes downtime and loses service configuration, load balancer associations, and service discovery registrations. Option B is wrong because 'restarting the service' via ForceNewDeployment reuses the same task definition — it does not apply a new one. Option D is wrong because creating a new service and deleting the old one is a blue/green-style manual approach that requires duplicating load balancer and networking configuration and is not the minimal-impact rolling update the question asks for.

189
MCQeasy

A company uses AWS CloudFormation to deploy infrastructure. The operations team wants to automatically roll back a stack update if it fails, and receive a notification. What should be configured to meet these requirements?

A.Use AWS CloudTrail to monitor the UpdateStack API call and trigger a rollback via a Lambda function.
B.Use AWS Config rules to detect stack failure and revert changes.
C.Enable rollback on failure in the CloudFormation stack and configure an SNS notification topic.
D.Create a custom resource in the CloudFormation template that performs rollback.
AnswerC

CloudFormation's rollback-on-failure setting automatically reverts the stack to its last known stable state when an update fails, satisfying the automatic rollback requirement. Pairing it with an Amazon SNS topic delivers the failure notification. Both constraints in the stem are met natively, without custom scripting or external orchestration.

Why this answer

CloudFormation natively supports automatic rollback on stack update failure via the 'Rollback on failure' setting. By configuring an SNS notification topic on the stack, the operations team receives alerts when a rollback occurs, meeting both requirements without additional custom logic.

Exam trap

The trap here is that candidates may overcomplicate the solution by adding unnecessary services like Lambda or Config, overlooking CloudFormation's native rollback and notification capabilities that directly satisfy the requirements.

How to eliminate wrong answers

Option A is wrong because AWS CloudTrail logs API calls but does not trigger actions directly; invoking a Lambda function from CloudTrail would require additional Amazon EventBridge rules and custom rollback logic, which is unnecessary when CloudFormation provides built-in rollback. Option B is wrong because AWS Config rules evaluate resource compliance against desired configurations and cannot detect stack update failures or revert changes; they are designed for continuous compliance, not stack lifecycle management. Option D is wrong because a custom resource in a CloudFormation template runs during stack operations but cannot perform a rollback of the entire stack; rollback is a stack-level operation controlled by CloudFormation, not by individual resources.

190
Multi-Selectmedium

A company uses AWS CodeBuild to compile and test code. The build process takes a long time because dependencies are downloaded from the internet each time. The company wants to speed up the build process. Which TWO actions should the company take? (Choose TWO.)

Select 2 answers
A.Use AWS CodeArtifact to store and retrieve dependencies
B.Use a custom Docker image in CodeBuild that includes the dependencies
C.Use local build agents to run builds in parallel
D.Increase the compute type of the build environment
E.Enable the cache feature in CodeBuild to store dependencies in Amazon S3
AnswersB, E

A custom Docker image bakes dependencies into the image layers, so CodeBuild pulls them once from Amazon ECR rather than fetching from the internet on every run. This eliminates the repeated download constraint in the stem and shortens each build.

Why this answer

Option B is correct because using a custom Docker image in CodeBuild that already includes the dependencies eliminates the need to download them from the internet on every build, directly reducing build time. Option E is correct because enabling the CodeBuild cache feature (for example, S3 caching) stores dependencies between builds so they can be reused instead of re-downloaded each time, which speeds up subsequent builds. Option A is not correct because CodeArtifact is a repository for storing and retrieving packages, but it still requires downloading dependencies during each build rather than avoiding the download entirely.

Option C is not correct because local build agents running builds in parallel address throughput, not the per-build dependency download time described. Option D is not correct because increasing the compute type provides more CPU/memory but does not eliminate the repeated dependency downloads that cause the slowdown.

Exam trap

SAP-C02 often tests the misconception that CodeArtifact or larger compute types speed up builds, when the actual bottleneck is repeated internet downloads that only pre-baked images or caching eliminate.

191
MCQeasy

A company runs a batch processing job on a schedule using AWS Lambda. The job processes files from an S3 bucket and writes results to another S3 bucket. Recently, the job has been failing with the error 'Access Denied' when trying to write to the destination bucket. The Lambda function's execution role has the following IAM policy attached: { "Version": "2012-10-17", "Statement": [ { "Effect": "Allow", "Action": [ "s3:GetObject", "s3:ListBucket" ], "Resource": [ "arn:aws:s3:::source-bucket/*", "arn:aws:s3:::source-bucket" ] }, { "Effect": "Allow", "Action": [ "s3:PutObject" ], "Resource": "arn:aws:s3:::destination-bucket/*" } ] } The Lambda function also has a VPC configuration to access an RDS instance. The S3 buckets are in the same region. The Solutions Architect verified that the destination bucket policy does not deny access. What is the MOST likely cause of the 'Access Denied' error?

A.The Lambda function is in a VPC without an S3 VPC endpoint, so it cannot reach S3.
B.The Lambda function does not have permissions to read from the source bucket.
C.The IAM policy does not allow s3:PutObject on the destination bucket.
D.The destination bucket policy denies the Lambda function's access.
AnswerA

Lambda functions attached to a VPC lose default internet access, so without an S3 gateway endpoint, traffic to S3 cannot route. The IAM policy already grants s3:PutObject on the destination bucket, making VPC connectivity the actual constraint causing the Access Denied error.

Why this answer

When a Lambda function is configured with a VPC, it loses default internet access and cannot reach AWS public services like S3 unless a VPC endpoint (gateway endpoint for S3) or NAT gateway is configured. The IAM policy already grants s3:PutObject on the destination bucket, and the bucket policy does not deny access, so the most likely cause is the lack of a network path to S3. This is a classic VPC networking issue in Lambda.

Exam trap

SAP-C02 often tests the interaction between VPC configuration and IAM permissions, and a common mistake is to focus solely on IAM policy syntax while ignoring that a Lambda function in a VPC without an S3 endpoint cannot reach S3 at all, regardless of permissions.

How to eliminate wrong answers

Option B is wrong because the IAM policy explicitly allows s3:GetObject and s3:ListBucket on the source bucket, so read permissions are not the issue. Option C is wrong because the policy includes an Allow statement for s3:PutObject on arn:aws:s3:::destination-bucket/*, which is the correct resource ARN for objects in the destination bucket. Option D is wrong because the scenario states the destination bucket policy does not deny access, so a bucket policy denial is not the cause.

192
MCQmedium

A company runs a serverless image-processing pipeline. When an image is uploaded to an S3 bucket, an AWS Lambda function is invoked to resize it and write the output to another S3 bucket. The company wants to reduce the cost of Lambda invocations and improve performance for a new workload that processes large batches of images at scheduled intervals. The images are already stored in S3 and do not require immediate processing. What is the MOST cost-effective solution?

A.Use AWS Lambda with a larger memory allocation and increase the timeout to 15 minutes.
B.Use an AWS Step Functions state machine with parallel branches to orchestrate Lambda functions for each image.
C.Use Amazon ECS with Fargate tasks triggered by an Amazon EventBridge scheduled rule to process the images.
D.Use AWS Batch with a managed compute environment that uses Spot Instances to process the images in parallel.
AnswerD

AWS Batch is designed for batch computing workloads and can automatically provision optimal quantities of compute resources, including Spot Instances, which can significantly reduce cost. It supports parallel processing of large numbers of images and can be scheduled to run at intervals. This aligns with the requirement for cost-effective, scheduled batch processing without immediate processing needs, and avoids Lambda's per-invocation pricing model.

Why this answer

AWS Batch is purpose-built for batch computing, allowing the use of Spot Instances to reduce costs significantly. It can process large volumes of images in parallel and be scheduled to run at intervals, matching the requirement for non-urgent, cost-effective batch processing. Lambda and Fargate are more expensive for long-running, high-volume tasks, and Step Functions adds orchestration overhead without addressing the core compute cost.

Exam trap

The trap here is assuming that serverless options like Lambda or Fargate are always the most cost-effective for any workload, overlooking that batch processing with Spot Instances can be far cheaper for large, delay-tolerant jobs.

193
MCQmedium

A company runs a critical application on Amazon RDS for PostgreSQL. The database experiences high read traffic. The application is read-heavy and can tolerate eventual consistency for some queries. What is the MOST effective way to improve read performance without significant architectural changes?

A.Enable Multi-AZ deployment for failover.
B.Create one or more Read Replicas in the same region.
C.Use Amazon ElastiCache to cache frequent queries.
D.Upgrade to a larger instance type.
AnswerB

Read Replicas use PostgreSQL's asynchronous streaming replication, offloading read queries to separate instances while the primary handles writes. This scales read capacity horizontally with minimal application change, and eventual consistency suits the queries that tolerate it.

Why this answer

Read Replicas offload read traffic from the primary RDS instance by serving read-only queries, and they can be created in the same region with minimal architectural change. Since the application is read-heavy and can tolerate eventual consistency for some queries, routing those queries to replicas is the most effective and least disruptive improvement. This scales read capacity horizontally without modifying the application's write path.

Exam trap

SAP-C02 often tests the distinction between high availability (Multi-AZ) and read scaling (Read Replicas) — candidates may pick Multi-AZ thinking it improves performance, but the standby does not serve reads.

How to eliminate wrong answers

Option A is wrong because Multi-AZ is for high availability and failover, not read scaling; the standby instance does not serve read traffic. Option C is wrong because ElastiCache requires application code changes to implement caching logic and does not address all read queries, only cached ones; it is also a larger architectural change. Option D is wrong because upgrading to a larger instance type is a vertical scaling approach that has limits and does not scale as effectively as adding read replicas for read-heavy workloads.

194
MCQmedium

A company runs a three-tier web application on AWS. The database tier uses Amazon RDS for PostgreSQL with a single primary instance and no read replicas. The application experiences heavy read traffic during business hours, causing CPU utilization on the primary to exceed 90%. The team wants to offload read traffic without changing the application's write path. Which solution should a solutions architect recommend?

A.Increase the size of the RDS instance to a larger instance class with more vCPUs and memory.
B.Migrate the database to Amazon DynamoDB with on-demand capacity and update the application to use the DynamoDB SDK.
C.Enable Multi-AZ on the RDS instance and direct read queries to the standby instance.
D.Create an RDS read replica and configure the application to send read queries to the replica endpoint.
AnswerD

RDS read replicas use asynchronous replication from the primary and serve read-only traffic, which directly offloads read queries and reduces CPU on the primary. The application's write path remains pointed at the primary endpoint, so no write logic changes. This is the standard, lowest-effort way to scale read-heavy PostgreSQL workloads on RDS without altering the write tier.

Why this answer

Adding an RDS read replica offloads read-only queries to a separate instance, reducing CPU pressure on the primary while leaving the write path unchanged. The application can be configured to use the replica endpoint for reads and the primary endpoint for writes. This is a minimal-change, cost-effective solution that directly addresses the read-heavy bottleneck.

Exam trap

The trap here is believing that a Multi-AZ standby instance can serve read traffic, when it is a passive failover target that is inaccessible for queries.

195
MCQhard

A company is running a stateful web application on EC2 instances in an Auto Scaling group behind an ALB. The application stores session data locally on the instance. The company notices that users are frequently logged out and lose session data during scaling events. What is the MOST operationally efficient way to preserve session state?

A.Migrate session data to ElastiCache for Redis and modify the application to use it.
B.Create a custom AMI that pre-populates session data from Amazon S3.
C.Increase the Auto Scaling group's cooldown period to 600 seconds.
D.Enable sticky sessions (session affinity) on the ALB.
AnswerA

ElastiCache for Redis externalises session state into a shared, highly available store, so any instance in the Auto Scaling group can serve any user after scaling events. This removes instance-local dependency without custom replication logic, making it the most operationally efficient fix.

Why this answer

Migrating session state to ElastiCache for Redis provides a centralized, external, and highly available session store that persists independently of EC2 instance lifecycles. This ensures that when instances are terminated or added during Auto Scaling events, session data remains intact and accessible from any instance, eliminating user logouts and data loss. It is operationally efficient as it requires minimal application code changes and leverages a fully managed, in-memory data store optimized for low-latency access.

Exam trap

The trap here is that candidates often choose sticky sessions (Option D) thinking it solves session persistence, but they overlook that sticky sessions only route traffic to the same instance and do not protect against data loss when that instance is terminated during scaling events.

How to eliminate wrong answers

Option B is wrong because pre-populating a custom AMI with session data from S3 is impractical and inefficient: session data is dynamic and changes constantly, so a static AMI cannot reflect real-time session states, and this approach would require frequent AMI rebuilds and complex synchronization. Option C is wrong because increasing the cooldown period to 600 seconds only delays scaling events but does not prevent session loss when instances are eventually terminated; it also reduces the Auto Scaling group's ability to respond to load changes, potentially impacting availability. Option D is wrong because enabling sticky sessions (session affinity) on the ALB only binds a user's session to a specific instance, but if that instance is terminated during a scale-in event, the session data is still lost; it does not provide a durable, shared session store.

196
MCQmedium

A company is using an Application Load Balancer (ALB) in front of an Auto Scaling group of EC2 instances. The application has a health check endpoint at /health. Recently, the ALB is marking instances as unhealthy even though the application is running. The health check settings are: interval 30 seconds, timeout 5 seconds, unhealthy threshold 2. What is the most likely cause?

A.The health check interval of 30 seconds is too long.
B.The unhealthy threshold of 2 is too high.
C.The health check timeout of 5 seconds is too short for the application to respond.
D.The health check path /health is not accessible from the ALB.
AnswerC

When the application's response exceeds five seconds, the ALB health check times out and counts a failure; two consecutive failures within the 30-second interval mark the instance unhealthy. Lengthening the timeout above the application's response time resolves the false unhealthy status.

Why this answer

The most likely cause is that the health check timeout of 5 seconds is too short for the application to respond to /health within the allotted time (C). If the application takes longer than 5 seconds to respond — due to slow database calls, cold starts, or heavy load — the ALB marks the check as failed. After two consecutive failures (unhealthy threshold 2), the instance is marked unhealthy even though the process is running.

Exam trap

SAP-C02 often tests whether candidates blame the interval or threshold settings when the real culprit is a timeout that is shorter than the application's response time — a classic false-unhealthy scenario.

How to eliminate wrong answers

Option A is wrong because a 30-second interval is a reasonable default; a longer interval would actually delay detection, not cause false unhealthy markings. Option B is wrong because a higher unhealthy threshold would make the ALB more tolerant, not less — the current threshold of 2 is standard and not the cause. Option D is wrong because if /health were inaccessible, the application would fail all checks consistently; the question states the application is running, and the most likely cause is a timeout rather than a routing/path issue (though path misconfiguration is a possible secondary cause, the timeout is the specific setting called out).

197
MCQeasy

A company has a web application running on Amazon EC2 instances in an Auto Scaling group. The application experiences variable traffic patterns, and the operations team wants to optimize costs by using a mix of On-Demand and Spot Instances. The team also wants to ensure that the application remains available even if some instances are terminated. Which solution should a solutions architect recommend?

A.Configure the Auto Scaling group to use a launch template with a mixed instances policy that includes On-Demand and Spot Instances, and enable capacity rebalancing.
B.Create two separate Auto Scaling groups, one for On-Demand and one for Spot, and use an Application Load Balancer to distribute traffic between them.
C.Use a launch template with only On-Demand Instances and enable detailed monitoring to manually replace instances when Spot prices are low.
D.Use a single launch configuration with only Spot Instances and set the Auto Scaling group to use a low desired capacity.
AnswerA

A mixed instances policy allows the Auto Scaling group to launch a combination of On-Demand and Spot Instances, which can reduce costs while maintaining availability. Enabling capacity rebalancing proactively replaces Spot Instances that are at risk of termination, helping to maintain the desired capacity and improve resilience.

Why this answer

The correct solution is to use a mixed instances policy with On-Demand and Spot Instances and enable capacity rebalancing. This allows the Auto Scaling group to automatically manage a mix of instance purchasing options, reducing costs while maintaining availability. Capacity rebalancing helps proactively replace Spot Instances that are at risk of interruption, ensuring the group maintains its desired capacity.

Exam trap

The trap here is assuming that using only Spot Instances with a low desired capacity will be sufficient for availability, when Spot interruptions can cause capacity shortfalls.

198
MCQmedium

A company runs a stateful web application on EC2 instances in an Auto Scaling group. The application uses a shared EFS file system for persistent data. The operations team notices that during scale-in events, some requests fail because the instance is terminated while still processing. What is the BEST way to prevent request failures during scale-in?

A.Use a Network Load Balancer with connection draining enabled
B.Increase the cooldown period for the Auto Scaling group
C.Decrease the scale-in threshold to reduce the frequency of termination
D.Use lifecycle hooks to put the instance in a 'terminating:wait' state and complete request processing
AnswerD

Lifecycle hooks hold the instance in a terminating:wait state before Auto Scaling proceeds, letting in-flight requests finish and the EFS mount unmount cleanly. This directly satisfies the stem's constraint: preventing request failures when scale-in terminates an instance mid-processing. Complete the lifecycle action to release the instance.

Why this answer

Lifecycle hooks allow the Auto Scaling group to put the instance in a 'terminating:wait' state, giving it time to complete processing existing requests before termination. Option A (Network Load Balancer with connection draining) can help drain new connections but does not ensure that in-flight requests are completed, especially for a stateful application using EFS. Option B (increase cooldown) only delays scaling decisions and does not prevent termination of an instance that is already processing.

Option C (decrease scale-in threshold) reduces the frequency of scale-in events but does not prevent request failures when termination occurs.

199
MCQmedium

A company uses AWS CloudFormation to deploy infrastructure. They have a stack that creates an Amazon RDS for MySQL database. The stack creation fails with the error 'The following resource(s) failed to create: [DBInstance]'. The solutions architect needs to troubleshoot the issue. Which approach should be taken first?

A.Review the CloudFormation stack events in the AWS Management Console.
B.Check the RDS console for any database events.
C.Delete the stack and deploy again with the same parameters.
D.Use AWS CloudTrail to view the CreateStack API call.
AnswerA

CloudFormation records each resource's status and failure reason in stack events; the DBInstance event carries the underlying RDS error message. Reviewing these events first reveals the root cause before deeper investigation, satisfying the troubleshoot-first requirement.

Why this answer

CloudFormation stack events provide the most direct and detailed troubleshooting information for a failed resource creation. When a stack operation fails, the events tab shows a chronological log of each resource's status, including the specific error message returned by the underlying service (e.g., RDS). For a DBInstance failure, the stack event will contain the exact reason, such as an invalid parameter, insufficient permissions, or a subnet issue.

This is the first place to look because it aggregates service-specific errors in the context of the stack operation.

Exam trap

SAP-C02 often tests the misconception that CloudTrail or service-specific consoles provide the fastest troubleshooting path, but CloudFormation stack events are the primary source for resource creation failures.

How to eliminate wrong answers

Option B is wrong because while RDS console events may show database-level activities, they often do not capture the precise CloudFormation provisioning error and lack the stack context; they are secondary. Option C is wrong because deleting and redeploying without diagnosing the root cause will likely reproduce the same failure, wasting time and potentially causing further issues. Option D is wrong because AWS CloudTrail records API calls for auditing, but the CreateStack API call only shows that the request was made; it does not provide the detailed resource-level failure reason that stack events do.

200
MCQmedium

A company is running a web application on AWS using an Application Load Balancer (ALB) in front of an Auto Scaling group of EC2 instances. The application experiences periodic traffic spikes that cause increased latency. The company wants to implement a solution to automatically adjust capacity in anticipation of traffic changes. What should a solutions architect do?

A.Configure a simple scaling policy based on CPU utilization.
B.Configure a scheduled scaling policy to add instances during known peak hours.
C.Configure a target tracking scaling policy based on average CPU utilization.
D.Configure a predictive scaling policy using historical traffic patterns.
AnswerD

Predictive scaling analyses historical CloudWatch traffic patterns and provisions capacity ahead of forecast demand, satisfying the anticipation requirement that reactive target tracking cannot meet. It scales out before the spike arrives, preventing the latency increase.

Why this answer

Predictive scaling uses historical traffic patterns to forecast future demand and proactively adjust capacity before traffic spikes occur, which directly addresses the requirement to anticipate changes. This approach reduces latency by ensuring sufficient resources are available ahead of time, unlike reactive policies that only respond after utilization increases.

Exam trap

The trap here is that candidates often confuse reactive scaling policies (simple, step, or target tracking) with proactive predictive scaling, assuming that maintaining a target metric like CPU utilization is sufficient to handle anticipated spikes, but only predictive scaling uses historical patterns to act before the load increases.

How to eliminate wrong answers

Option A is wrong because a simple scaling policy based on CPU utilization is reactive, only adjusting capacity after a threshold is breached, which cannot anticipate traffic spikes and may still cause latency during the scaling cooldown period. Option B is wrong because scheduled scaling assumes fixed peak hours, but the scenario describes periodic spikes that may not follow a strict schedule, making it inflexible and potentially wasteful or insufficient. Option C is wrong because target tracking scaling, while more sophisticated than simple scaling, is still reactive—it maintains a target metric (e.g., average CPU) but does not proactively forecast demand, so it cannot eliminate latency during sudden spikes.

201
MCQeasy

A company is using AWS Config to evaluate resource compliance. They want to receive notifications when a noncompliant resource is detected. Which AWS service should be used to send these notifications to an email endpoint?

A.Amazon Simple Queue Service (SQS)
B.Amazon Simple Notification Service (SNS)
C.Amazon CloudWatch Events
D.AWS Lambda
AnswerB

AWS Config rules publish compliance-change events to an Amazon SNS topic, which then delivers them to email, SMS or HTTP endpoints. SNS provides the pub/sub fan-out the stem's email notification requirement demands, unlike CloudWatch Events alone or direct Lambda invocation.

Why this answer

(Amazon SNS) is correct because Amazon SNS can send email notifications when triggered by AWS Config rules to notify about noncompliant resources. Option A (SQS) is incorrect because SQS is a message queue service that does not directly send email. Option C (CloudWatch Events) can trigger other actions but cannot directly send email to endpoints.

Option D (AWS Lambda) can process notifications but requires additional services like SNS to send email.

202
Multi-Selectmedium

A company is deploying a web application on EC2 instances behind an Application Load Balancer. The application experiences high traffic during business hours and low traffic at night. The company wants to automatically scale the instances based on CPU utilization. Which TWO steps are required to achieve this?

Select 2 answers
A.Configure a scheduled scaling policy to add instances during business hours.
B.Replace the ALB with a Network Load Balancer for better performance.
C.Create a dynamic scaling policy based on the average CPU utilization metric.
D.Create an Auto Scaling group and associate it with the ALB.
E.Create a CloudWatch alarm that sends an email when CPU exceeds 80%.
AnswersC, D

A target-tracking dynamic scaling policy adjusts capacity automatically to hold average CPU utilisation at a chosen value, directly satisfying the requirement to scale on CPU utilisation. CloudWatch aggregates the EC2 metric across the Auto Scaling group, so the policy responds to business-hours peaks and nightly troughs without manual intervention.

Why this answer

Option C is correct because target tracking or step scaling dynamic policies use the CloudWatch Average CPUUtilization metric of the Auto Scaling group to automatically add or remove instances as load changes, which is exactly the CPU-based automatic scaling the company requires. Option D is correct because an Auto Scaling group is the foundational resource that manages the EC2 fleet's desired/min/max capacity and health checks, and associating it with the ALB target group lets the load balancer register and route traffic to the instances it launches. Option A is not required because scheduled scaling is time-based rather than CPU-utilization-based, so it does not satisfy the stated requirement.

Option B is wrong because an NLB operates at Layer 4 and is not needed here; the ALB already handles HTTP/HTTPS traffic appropriately. Option E is wrong because a CloudWatch alarm that only sends an email notification does not perform any scaling action.

Exam trap

SAP-C02 often tests the misconception that a CloudWatch alarm alone performs scaling — candidates must remember that the alarm must be tied to a scaling policy, and that the ASG must be attached to the load balancer target group.

203
MCQmedium

A company runs a web application on EC2 instances behind an Application Load Balancer. Users report intermittent slowdowns. CloudWatch metrics show high CPU utilization on the instances. The company wants to improve performance with minimal architectural changes. What should a solutions architect do?

A.Use Amazon ElastiCache to offload database queries.
B.Configure an Auto Scaling group with a dynamic scaling policy based on CPU utilization.
C.Replace the EC2 instances with a larger instance type.
D.Enable Amazon CloudFront in front of the ALB to cache content.
AnswerB

A dynamic scaling policy targeting CPU utilisation adds or removes instances automatically as load rises, distributing demand across more capacity. This addresses the high CPU constraint with minimal architectural change, since the existing load balancer already spreads traffic across the group.

Why this answer

An Auto Scaling group with a dynamic CPU-based scaling policy directly addresses the root cause (high CPU utilization) by adding more instances when demand rises, distributing load and improving performance. This is a minimal architectural change because the ALB already exists and simply registers new instances automatically. It preserves the existing application design while providing elasticity to handle intermittent spikes.

Exam trap

SAP-C02 often tests whether candidates confuse symptom with cause — high CPU is solved by horizontal scaling, not by caching layers or vertical resizing that don't address elasticity.

How to eliminate wrong answers

Option A is wrong because ElastiCache offloads database reads, but the symptom is high CPU on the EC2 instances themselves, not database latency — caching would not reduce application-tier CPU. Option C is wrong because vertically scaling to a larger instance type is a manual, static change that does not respond to intermittent load and may not resolve the underlying scaling issue. Option D is wrong because CloudFront caches static content at edge locations; it does not reduce CPU load from dynamic application processing and requires DNS/architectural changes.

204
MCQmedium

A company's AWS CloudTrail logs are stored in an S3 bucket. A Solutions Architect needs to analyze the logs to identify API calls that created or modified IAM roles in the last 30 days. What is the MOST efficient way to perform this analysis?

A.Use Amazon CloudWatch Logs Insights to query the logs.
B.Use Amazon Athena to run SQL queries on the logs.
C.Use an AWS Lambda function to process the logs and export to Amazon Redshift.
D.Use S3 Select to filter the records.
AnswerB

Athena queries CloudTrail logs in S3 in place using standard SQL, letting the architect filter IAM role creation and modification events over the last 30 days without loading or transforming data first, which is the most efficient approach.

Why this answer

Amazon Athena enables running SQL queries directly on CloudTrail logs stored in S3 without the need to move or transform data. This is the most efficient method for analyzing historical CloudTrail data. Option A is incorrect because CloudWatch Logs Insights is designed for logs stored in CloudWatch Logs, not for S3-stored CloudTrail logs.

Option C is incorrect because using Lambda to export to Redshift adds unnecessary complexity and cost compared to querying in place with Athena. Option D is incorrect because S3 Select is limited to filtering data within a single object and does not support complex SQL queries across multiple log files.

205
MCQmedium

A company runs a stateful application on EC2 instances in an Auto Scaling group behind a Network Load Balancer (NLB). The application requires that client sessions are maintained to the same instance. The operations team notices that after scaling events, some clients lose their sessions. Which configuration change should the team implement to ensure session persistence?

A.Disable cross-zone load balancing on the NLB.
B.Enable cookie-based stickiness on the NLB listener.
C.Switch to an Application Load Balancer and enable cookie-based stickiness.
D.Enable source IP stickiness on the NLB target group.
AnswerD

Source IP stickiness on the NLB target group binds each client IP to one target for the flow's duration, so sessions survive scaling events. This satisfies the stem's requirement that clients remain on the same instance behind the Network Load Balancer.

Why this answer

Network Load Balancers operate at Layer 4 and support only source IP-based stickiness, configured on the target group via the 'stickiness.enabled' and 'stickiness.type=source_ip' attributes. Enabling source IP stickiness ensures that a given client IP is consistently routed to the same backend instance, preserving sessions across scaling events.

Exam trap

SAP-C02 often tests the misconception that NLBs support cookie-based stickiness like ALBs — candidates must remember NLB is Layer 4 and only supports source IP stickiness.

How to eliminate wrong answers

Option A is wrong because disabling cross-zone load balancing affects traffic distribution across AZs, not session affinity, and would not fix session loss. Option B is wrong because NLB listeners do not support cookie-based stickiness — that is an ALB (Layer 7) feature. Option C is wrong because switching to an ALB changes the architecture and may not be feasible for the stateful application; while ALB supports cookie stickiness, the question asks for a configuration change to the existing NLB setup.

206
Multi-Selecthard

A company is migrating a monolithic application to microservices on Amazon ECS. They want to implement a service mesh for observability and traffic management. Which THREE AWS services should they consider?

Select 3 answers
A.Amazon Route 53
B.AWS X-Ray
C.Amazon CloudWatch
D.AWS App Mesh
E.AWS Step Functions
AnswersB, C, D

AWS X-Ray provides distributed tracing across ECS microservices, capturing request paths and latency between services to satisfy the observability requirement. It integrates natively with ECS tasks and the X-Ray daemon, giving end-to-end visibility that a service mesh alone would not deliver for troubleshooting inter-service calls.

Why this answer

Options B, C, and D are correct. AWS App Mesh is a service mesh that provides observability and traffic management. AWS X-Ray provides tracing for microservices.

Amazon CloudWatch provides monitoring and logs. Option A is wrong because Amazon Route 53 is DNS, not a service mesh. Option E is wrong because AWS Step Functions is for orchestrating workflows, not service mesh.

207
MCQhard

A company runs a latency-sensitive trading application on Amazon EC2 instances behind a Network Load Balancer. The application must maintain persistent TCP connections and uses a custom health check on port 8080. During a recent incident, the operations team observed that when an instance became unhealthy, existing connections continued to be routed to it for several minutes, causing failed trades. The team needs to ensure that unhealthy targets are removed from the load balancer rotation as quickly as possible while preserving connection draining for graceful shutdown. Which combination of actions should a solutions architect take to meet these requirements with the LEAST operational overhead?

A.Replace the Network Load Balancer with an Application Load Balancer and use HTTP health checks on port 8080.
B.Configure the NLB health check with a shorter interval and lower unhealthy threshold, and enable connection draining with an appropriate deregistration delay.
C.Enable TCP keepalive on the targets and set the deregistration delay to 0 seconds.
D.Configure the NLB health check with a shorter interval and higher unhealthy threshold, and enable connection draining with a 300-second deregistration delay.
AnswerB

Shortening the health check interval and reducing the unhealthy threshold makes the NLB detect failures faster and remove targets from rotation sooner. Enabling connection draining with a suitable deregistration delay allows existing connections to complete gracefully. This directly addresses the requirement for rapid removal while preserving graceful shutdown, with minimal operational changes.

Why this answer

The NLB health check interval and unhealthy threshold determine how quickly a target is marked unhealthy and removed from rotation. A shorter interval combined with a lower threshold accelerates detection. Enabling connection draining with a deregistration delay ensures that in-flight connections are allowed to complete, satisfying the graceful shutdown requirement.

This approach requires only configuration changes on the existing NLB.

Exam trap

The trap here is assuming that TCP keepalive settings on targets control how quickly the load balancer removes unhealthy targets, when in fact the health check configuration governs that behavior.

208
Multi-Selectmedium

A company runs a web application on EC2 instances in an Auto Scaling group. The application stores session data locally on the EC2 instances. The operations team reports that after scaling events, users lose their sessions. Which TWO actions should the Solutions Architect take to resolve this issue?

Select 2 answers
A.Use a Network Load Balancer instead of an Application Load Balancer.
B.Enable sticky sessions (session affinity) on the Application Load Balancer.
C.Move session data storage from the EC2 instances to Amazon ElastiCache for Redis.
D.Store session data in Amazon DynamoDB.
E.Enable replication in the ElastiCache cluster to handle failover.
AnswersB, C

Sticky sessions route user to same instance.

Why this answer

Options B and C are correct. Enabling sticky sessions (session affinity) on the Application Load Balancer ensures that requests from the same user are sent to the same EC2 instance while it is healthy, preventing session loss during scale-in events. However, sticky sessions do not protect against instance termination.

Moving session data storage from the EC2 instances to Amazon ElastiCache for Redis externalizes the session store so it persists independently of any individual instance. Option A is incorrect because a Network Load Balancer does not support application-layer sticky sessions. Option D is incorrect because DynamoDB is not required when ElastiCache for Redis is used.

Option E is incorrect because replication in ElastiCache provides high availability, not protection against session loss from Auto Scaling instance replacement.

209
MCQhard

A company is migrating a legacy application to AWS. The application requires a fixed IP address for whitelisting by a third-party service. The application will run on EC2 instances behind an Application Load Balancer. The company needs a solution that provides a static IP address for outbound traffic. What should a solutions architect do?

A.Replace the ALB with a Network Load Balancer and assign Elastic IPs.
B.Assign an Elastic IP address to the Application Load Balancer.
C.Place the EC2 instances in a private subnet and route outbound traffic through a NAT Gateway with an Elastic IP.
D.Attach an Internet Gateway to the VPC and assign an Elastic IP to it.
AnswerC

A NAT Gateway performs source NAT, so all outbound traffic from the private subnet egresses via its attached Elastic IP. This satisfies the third-party whitelisting constraint, which requires a single, fixed public address rather than the dynamic addresses of instances or an internet gateway.

Why this answer

Placing the EC2 instances in a private subnet and routing outbound traffic through a NAT Gateway with an Elastic IP provides a static IP address for outbound traffic. The third-party service whitelists this Elastic IP, and all outbound traffic from the instances will appear to originate from that IP. This is the standard AWS solution for providing static outbound IPs for instances behind an ALB, as ALBs do not support Elastic IPs and cannot provide a static IP for outbound traffic.

Exam trap

The trap is confusing inbound and outbound static IP requirements; candidates may think an ALB can have an Elastic IP or that an NLB provides outbound static IPs, but only a NAT Gateway with an Elastic IP solves the outbound static IP need.

How to eliminate wrong answers

Option A is wrong because replacing the ALB with a Network Load Balancer and assigning Elastic IPs provides static IPs for inbound traffic, not outbound; the question specifically requires a static IP for outbound traffic. Option B is wrong because Application Load Balancers do not support assigning Elastic IP addresses; they use dynamic IP addresses that can change. Option D is wrong because attaching an Internet Gateway to the VPC and assigning an Elastic IP to it is not possible; Internet Gateways do not support Elastic IPs, and this would not provide a static outbound IP for the instances.

210
MCQhard

A company runs a microservices application on Amazon ECS with the Fargate launch type. The services communicate over a service mesh. The operations team wants to improve observability and reduce troubleshooting time for inter-service communication issues. They need to capture detailed request traces and metrics without modifying application code. Which solution should a solutions architect recommend?

A.Use Amazon CloudWatch Container Insights with enhanced observability for ECS, and enable VPC Flow Logs for the service subnets.
B.Configure the application to use the AWS X-Ray SDK for instrumenting all service calls, and deploy the X-Ray daemon as a sidecar.
C.Enable ECS Exec on all tasks and use AWS Systems Manager Session Manager to run tcpdump on each container.
D.Deploy AWS App Mesh with Envoy sidecar proxies and configure it to emit traces to AWS X-Ray and metrics to Amazon CloudWatch.
AnswerD

AWS App Mesh uses Envoy sidecar proxies to intercept traffic between services, enabling detailed tracing and metrics without code changes. It integrates with X-Ray for distributed tracing and CloudWatch for metrics, providing the required observability for inter-service communication.

Why this answer

AWS App Mesh with Envoy sidecars provides layer 7 observability, including distributed tracing and metrics, without requiring application code changes. It integrates with X-Ray and CloudWatch, giving the operations team detailed visibility into inter-service communication. The other options either require code changes, lack granularity, or are not scalable.

Exam trap

The trap here is assuming that container-level monitoring or manual debugging tools provide the same depth as a service mesh for inter-service tracing.

211
MCQhard

A company uses AWS CodeBuild to run unit tests. The build process is taking longer than expected. The buildspec.yml file includes a pre-build phase that downloads dependencies from a public repository. What is the most effective way to reduce build time?

A.Configure the build project to use an S3 cache for dependencies.
B.Run the build in parallel across multiple build projects.
C.Increase the compute type of the build environment to use more vCPUs.
D.Reduce the build timeout setting to force faster execution.
AnswerA

An S3 cache bucket stores the downloaded dependencies between runs, so the pre-build phase retrieves them from S3 rather than re-downloading from the public repository. This directly addresses the stem's constraint: repeated dependency downloads inflating build duration. CodeBuild restores the cache before the pre-build phase, cutting that wait.

Why this answer

The pre-build phase downloads dependencies from a public repository, which is the slowest part of the build. Configuring an S3 cache in CodeBuild lets the project persist and reuse files (like downloaded dependencies) between builds, so subsequent builds skip the network download entirely. This directly targets the identified bottleneck and is the most effective, cost-efficient optimization for repeated dependency fetching.

Exam trap

SAP-C02 often tests the misconception that scaling compute (more vCPUs) or parallelism always reduces build time, when the actual bottleneck is often network-bound dependency retrieval that caching solves.

How to eliminate wrong answers

Option B is wrong because running the build in parallel across multiple build projects does not speed up a single build's dependency download; it just runs separate builds concurrently and adds coordination overhead. Option C is wrong because increasing the compute type adds more vCPUs, but the bottleneck is network I/O waiting on a public repository, not CPU-bound work, so more CPU won't help. Option D is wrong because reducing the build timeout does not make execution faster — it only causes the build to fail sooner if it exceeds the limit, which is the opposite of the goal.

212
MCQhard

A company uses AWS CloudFormation to deploy infrastructure. The team wants to ensure that all resources are tagged with a CostCenter tag. They want to automatically remediate any stack that creates resources without the required tag. Which approach is MOST effective?

A.Create a Lambda function that tags resources after creation.
B.Use IAM policies to require tagging on all resource creation.
C.Use a CloudFormation stack policy with a deny effect for resource creation without tags.
D.Use an AWS Config rule with auto-remediation via SSM Automation.
AnswerD

An AWS Config rule evaluates resource configuration continuously, detecting any resource missing the CostCenter tag regardless of which stack created it. Auto-remediation through SSM Automation then applies the tag automatically, satisfying the requirement for automatic remediation across all CloudFormation deployments rather than only at stack creation time.

Why this answer

AWS Config rules can evaluate whether resources have the required CostCenter tag, and auto-remediation via SSM Automation can automatically apply the tag or stop/delete non-compliant resources. This provides continuous compliance and automatic remediation, which is the most effective approach. Other options either do not enforce tagging or are not automatic.

Exam trap

SAP-C02 often tests the difference between preventive and detective controls; candidates may choose IAM policies (preventive) but the question asks for automatic remediation, which requires a detective control like AWS Config with SSM Automation.

How to eliminate wrong answers

Option A is wrong because a Lambda function that tags resources after creation is reactive and may not catch all resources or may fail if the function errors; it also requires custom code and maintenance. Option B is wrong because IAM policies can enforce tagging on some resource creation actions via condition keys, but they do not automatically remediate existing untagged resources and are not comprehensive across all services. Option C is wrong because CloudFormation stack policies are used to protect resources from updates, not to enforce tagging; they cannot deny resource creation based on tags.

213
Multi-Selectmedium

A company uses an Amazon RDS for MySQL DB instance. The database is experiencing high read latency. The team wants to improve read performance with minimal application changes. Which TWO actions should the team take? (Choose two.)

Select 2 answers
A.Create one or more read replicas and direct read queries to them.
B.Enable Multi-AZ deployment for failover support.
C.Migrate the database to Amazon Aurora.
D.Increase the max_connections parameter.
E.Increase the DB instance size (e.g., from db.r5.large to db.r5.xlarge).
AnswersA, E

Read replicas offload read traffic to separate MySQL instances via asynchronous replication, directly relieving the primary's read latency. This satisfies the minimal-application-change constraint because only the read connection endpoint changes, requiring no schema or query rewrite.

Why this answer

Option A is correct because RDS for MySQL read replicas offload read traffic from the primary instance via asynchronous replication, and applications can point read queries at the replica endpoint with minimal changes, directly reducing read latency on the primary. Option E is correct because scaling up the DB instance class (e.g., db.r5.large to db.r5.xlarge) adds more vCPU and memory, which increases the instance's capacity to process read queries and can lower read latency without application changes. Option B is incorrect because Multi-AZ provides synchronous standby failover for high availability, not read scaling, and the standby does not serve read traffic.

Option C is incorrect because migrating to Aurora is a significant architectural change, not a minimal-change action. Option D is incorrect because max_connections controls the number of concurrent connections, not read performance, and raising it can even increase contention.

Exam trap

The trap is confusing high availability (Multi-AZ) with read scaling — candidates often pick Multi-AZ thinking it improves performance, but the standby is not accessible for reads; only read replicas offload read traffic. Similarly, increasing max_connections is a common distractor that does not address latency.

214
MCQeasy

A company is using Amazon S3 to store critical data. The security team requires that all data at rest be encrypted using AWS KMS with automatic rotation of the customer master key (CMK) every year. What should a solutions architect do to meet this requirement?

A.Use SSE-S3 (Amazon S3-managed keys) and rely on S3's automatic key rotation.
B.Enable S3 default encryption with AWS KMS and enable automatic rotation of the KMS key.
C.Use SSE-C (customer-provided keys) and manage key rotation manually.
D.Use client-side encryption with a KMS CMK and upload the encrypted data.
AnswerB

S3 default encryption with SSE-KMS encrypts every new object at rest under a KMS key, and enabling annual automatic rotation on that customer managed key satisfies both the encryption and rotation requirements without per-object headers.

Why this answer

The requirement is encryption at rest using AWS KMS with automatic annual rotation of the CMK. Enabling S3 default encryption with SSE-KMS satisfies the KMS encryption requirement, and KMS supports automatic key rotation (configurable for customer-managed keys, with a default and minimum of 90 days, commonly set to 365 days). This is the only option that combines KMS-based encryption with managed rotation.

Exam trap

SAP-C02 often tests the distinction between SSE-S3 (AWS-managed, no customer rotation control), SSE-KMS (customer-managed CMK with automatic rotation), and SSE-C (customer-provided keys, no AWS rotation) — candidates confuse 'automatic rotation' across these models.

How to eliminate wrong answers

Option A is wrong because SSE-S3 uses S3-managed keys (AES-256) that the customer cannot control or rotate on a schedule — S3 handles rotation transparently but it is not a KMS CMK, so it fails the 'AWS KMS with annual CMK rotation' requirement. Option C is wrong because SSE-C requires the customer to supply and manage their own encryption keys on every request; AWS does not store or rotate these keys, so automatic rotation is impossible. Option D is wrong because client-side encryption with a KMS CMK encrypts data before upload, but KMS automatic rotation only rotates the CMK's backing key material — it does not re-encrypt existing data, and this approach adds complexity without meeting the 'S3 encryption at rest via KMS' framing as cleanly as SSE-KMS.

215
MCQhard

A company uses an AWS CodePipeline to deploy a serverless application. The pipeline includes a build stage that runs on AWS CodeBuild and a deploy stage that updates an AWS Lambda function. The company wants to add a manual approval step before the deploy stage. What is the most efficient way to implement this?

A.Add an AWS Lambda function that sends an email for approval.
B.Use an AWS CloudFormation stack with a wait condition.
C.Configure an Amazon SNS topic to notify approvers.
D.Add a manual approval action in the CodePipeline stage before deploy.
AnswerD

CodePipeline natively supports a manual approval action, which pauses the pipeline and notifies approvers before the deploy stage runs. Inserting it directly into the existing stage avoids custom Lambda polling or external tooling, meeting the requirement for the most efficient implementation.

Why this answer

AWS CodePipeline has a built-in manual approval action that can be added as a stage before the deploy stage, providing the most efficient way to add manual approval. Option A is incorrect because using a Lambda function for approval is unnecessarily complex compared to the built-in action. Option B is incorrect because a CloudFormation wait condition is not designed for approval workflows in CodePipeline.

Option C is incorrect because an SNS topic can notify approvers but does not integrate directly as an approval action in CodePipeline; the manual approval action is the native solution.

216
MCQhard

A company runs a containerized application on Amazon ECS with Fargate. The application needs to securely access an Amazon S3 bucket. The company wants to follow the principle of least privilege. What should a solutions architect recommend?

A.Define an IAM task role with S3 access policies and reference it in the ECS task definition.
B.Attach an IAM role to the underlying EC2 instance.
C.Assign an IAM role to the ECS service using the ECS service-linked role.
D.Store AWS credentials in the container environment variables.
AnswerA

An IAM task role is assumed by the Fargate task itself, so containers receive temporary credentials scoped to the attached S3 policy. This avoids embedding long-lived keys and satisfies least privilege, since permissions are limited to the specific task rather than the host.

Why this answer

An IAM task role is the recommended mechanism for granting least-privilege permissions to ECS tasks using the Fargate launch type. The task role is defined in the ECS task definition and assumed by the container runtime, allowing the application to securely access the S3 bucket without embedding credentials. This approach follows AWS best practices by scoping permissions to the specific task rather than the underlying infrastructure.

Exam trap

The trap here is that candidates may confuse the ECS service-linked role (used for ECS service management) with the IAM task role (used for granting permissions to the containerized application), or incorrectly assume that Fargate tasks require an underlying EC2 instance role.

How to eliminate wrong answers

Option B is wrong because Fargate does not use underlying EC2 instances; the infrastructure is fully managed by AWS, so attaching an IAM role to an EC2 instance is irrelevant and violates the principle of least privilege by granting permissions to all tasks on that instance. Option C is wrong because the ECS service-linked role (AWSServiceRoleForECS) is used by the ECS service itself to manage resources, not by the containers to access S3; assigning it to the service does not grant permissions to the application code. Option D is wrong because storing AWS credentials in container environment variables is insecure, violates the principle of least privilege, and is unnecessary when IAM task roles provide automatic credential rotation via the AWS STS endpoint.

217
MCQmedium

A company is running a stateful web application on Amazon EC2 instances in an Auto Scaling group. The instances store session data in an Amazon ElastiCache for Redis cluster. The company wants to improve the application's fault tolerance and ensure that session data is not lost if an Availability Zone fails. What should the solutions architect do?

A.Enable Cluster Mode on the ElastiCache for Redis cluster and configure Multi-AZ.
B.Configure the ElastiCache for Redis cluster to have multiple read replicas in the same region.
C.Increase the instance size of the EC2 instances to handle more load.
D.Migrate from ElastiCache for Redis to ElastiCache for Memcached.
AnswerA

Cluster Mode with Multi-AZ provides replication and automatic failover across AZs, protecting against AZ failure.

Why this answer

Enabling Cluster Mode on the ElastiCache for Redis cluster and configuring Multi-AZ provides automatic sharding and replication across Availability Zones. This ensures that session data is not lost if an AZ fails, as replicas in other AZs can take over. Option B is incorrect because read replicas alone do not provide automatic failover or data durability across AZ failures unless Multi-AZ is enabled.

Option C is incorrect because increasing instance size does not protect against AZ failure. Option D is incorrect because ElastiCache for Memcached does not support persistence or replication, so data would be lost on node failure.

218
MCQeasy

A company runs a batch processing job on Amazon EC2 instances that are part of an Auto Scaling group. The job runs every night and takes approximately 2 hours. The instances are launched using a launch template with a Spot Instance request. Recently, the job has been failing because Spot Instances are being reclaimed before the job completes. The company wants a cost-effective solution that ensures the job completes reliably. The job can handle interruptions by checkpointing. Which solution should the company implement?

A.Increase the instance size to complete the job faster.
B.Use a mixed instances policy with a percentage of On-Demand Instances as a fallback.
C.Switch to On-Demand Instances only.
D.Use Reserved Instances for the batch job.
AnswerB

A mixed instances policy blends Spot with a percentage of On-Demand capacity, so when Spot capacity is reclaimed the On-Demand fallback keeps the job running. Checkpointing handles interruption, and the blend preserves cost-effectiveness while guaranteeing completion.

Why this answer

The mixed instances policy in an Auto Scaling group allows you to combine Spot and On-Demand Instances, with a configurable percentage of On-Demand capacity to act as a fallback when Spot capacity is unavailable or reclaimed. Since the job checkpoints and can tolerate interruptions, using a base of On-Demand instances ensures the job always has enough capacity to complete, while Spot instances provide cost savings for the remainder. This balances reliability and cost-effectiveness better than switching entirely to On-Demand or Reserved Instances.

Exam trap

SAP-C02 often tests the misconception that Spot Instances alone can be made reliable by simply increasing instance size or that On-Demand is the only reliable option, overlooking the balanced approach of a mixed instances policy with a base of On-Demand capacity.

How to eliminate wrong answers

Option A is wrong because increasing instance size does not prevent Spot reclamation; it may even increase cost and reduce the pool of available Spot capacity, and it does not guarantee completion. Option C is wrong because switching to On-Demand only ensures reliability but sacrifices cost savings entirely, making it less cost-effective than a mixed policy. Option D is wrong because Reserved Instances require a 1- or 3-year commitment and are not suitable for a nightly batch job that runs only 2 hours; they also do not provide the flexibility of Spot instances and would be more expensive for this intermittent workload.

219
MCQeasy

A company has a production AWS account with multiple VPCs connected via a transit gateway. The security team wants to centrally capture all VPC flow logs for analysis in Amazon Athena. What is the MOST cost-effective way to store the flow logs?

A.Publish VPC Flow Logs to an Amazon S3 bucket with S3 Intelligent-Tiering enabled.
B.Publish VPC Flow Logs to both CloudWatch Logs and S3 for redundancy.
C.Use Amazon Kinesis Data Firehose to stream flow logs to an S3 bucket.
D.Publish VPC Flow Logs to Amazon CloudWatch Logs and export them to S3 after 30 days.
AnswerA

S3 is cost-effective for log storage, and Intelligent-Tiering automatically moves data to lower-cost tiers.

Why this answer

VPC Flow Logs can be published directly to Amazon S3, and S3 Intelligent-Tiering automatically moves objects between frequent and infrequent access tiers based on usage patterns, minimizing storage cost for log data that is queried sporadically by Athena. This avoids CloudWatch Logs ingestion and storage charges, which are significantly higher per GB.

Exam trap

SAP-C02 often tests whether candidates default to CloudWatch Logs for log aggregation out of habit, missing that direct S3 delivery plus Intelligent-Tiering is the cost-optimized pattern for high-volume log analytics.

How to eliminate wrong answers

Option B is wrong because duplicating flow logs to both CloudWatch Logs and S3 incurs unnecessary CloudWatch ingestion and storage costs, defeating the cost-effectiveness requirement. Option C is wrong because Kinesis Data Firehose adds streaming infrastructure and per-GB delivery charges on top of S3 storage, which is unnecessary when VPC Flow Logs natively support direct S3 delivery. Option D is wrong because CloudWatch Logs ingestion and retention for 30 days is far more expensive than direct S3 delivery, and the export step adds complexity and cost.

220
MCQeasy

A company has deployed a web application on Amazon ECS with Fargate. The application needs to access an Amazon RDS database. The security team mandates that the database must not be publicly accessible. What is the best way to securely connect the ECS tasks to the RDS database?

A.Use a NAT gateway to route traffic from ECS tasks to RDS.
B.Attach an internet gateway to the VPC and route through it.
C.Enable public accessibility on the RDS instance and restrict access to the ECS task public IP.
D.Place the ECS tasks and RDS instance in the same VPC, and configure security groups to allow traffic on the database port.
AnswerD

Keeping both the Fargate tasks and the RDS instance in the same VPC lets traffic traverse private addresses, so the database never needs public accessibility. Security groups then restrict inbound access to the database port from the tasks' security group only.

Why this answer

Placing ECS tasks and RDS in the same VPC allows private communication via security groups. This ensures the database is not publicly accessible. Option A is incorrect because a NAT gateway is for outbound internet access, not for inbound traffic to RDS.

Option B is incorrect because an internet gateway would expose the RDS instance to the internet. Option C is incorrect because enabling public accessibility would violate the security mandate even with IP restrictions.

221
MCQhard

A company uses AWS CodePipeline to deploy a web application to Amazon ECS. The deployment often fails because the ECS service's desired count is not met during the update. The company wants to implement a blue/green deployment with automated rollback on failure. What is the MOST effective approach?

A.Use CodePipeline with a Lambda function to swap target groups and monitor health.
B.Use CodeDeploy with an in-place deployment configuration and a manual approval step.
C.Use CodePipeline with ECS rolling update and CloudWatch alarms to trigger rollback.
D.Use CodePipeline with CodeDeploy to perform a blue/green deployment on ECS and configure automatic rollback.
AnswerD

CodeDeploy's ECS blue/green deployment shifts production traffic between two target groups only after the replacement task set reaches steady state, so the desired-count constraint is verified before cutover. CloudWatch alarms trigger automatic rollback to the original task set, restoring the previous listener rule without manual intervention.

Why this answer

CodePipeline integrated with CodeDeploy for ECS blue/green deployments provides automated traffic shifting, health monitoring, and automatic rollback on failure. CodeDeploy manages the replacement task set, shifts traffic via the load balancer, and rolls back if alarms fire or health checks fail, which directly addresses the desired count issue.

Exam trap

The trap is thinking a custom Lambda or rolling update with alarms is equivalent to CodeDeploy blue/green — only CodeDeploy provides native automated rollback and traffic shifting for ECS.

How to eliminate wrong answers

Option A is wrong because a custom Lambda swapping target groups lacks built-in health monitoring and automated rollback semantics that CodeDeploy provides. Option B is wrong because in-place deployments do not provide blue/green traffic shifting and cannot roll back as cleanly; manual approval also does not automate rollback. Option C is wrong because ECS rolling updates with CloudWatch alarms can trigger rollback but do not provide true blue/green isolation or CodeDeploy's automated rollback hooks.

222
MCQmedium

A company runs a web application on EC2 instances behind an Application Load Balancer (ALB). Users report intermittent 503 errors. The ALB target group health checks are failing. Which step is MOST likely to resolve the issue?

A.Change the health check protocol from HTTP to HTTPS.
B.Use a Network Load Balancer instead of ALB.
C.Increase the number of instances in the target group.
D.Increase the health check timeout and decrease the unhealthy threshold.
AnswerD

Gives instances more time to respond and reduces sensitivity to transient failures.

Why this answer

Increasing the health check timeout gives instances more time to respond before being marked unhealthy, and decreasing the unhealthy threshold allows more consecutive failed health checks before considering an instance unhealthy, reducing false positives. Option A is incorrect because changing the protocol does not address the underlying cause of health check failures; it might even fail if the application does not support HTTPS. Option B is incorrect because using a Network Load Balancer does not resolve health check failures; NLB health checks are different but still need proper configuration.

Option C is incorrect because simply increasing the number of instances does not fix the health check issue; instances may still fail health checks if they are not healthy.

223
MCQmedium

A company runs a critical web application on Amazon EC2 instances behind an Application Load Balancer (ALB). The application experiences performance degradation during peak hours. CloudWatch metrics show that the CPU utilization of the EC2 instances regularly reaches 90-100% during these periods. The company wants to ensure the application remains responsive during peak loads while minimizing costs. Which solution should a solutions architect recommend?

A.Configure a target tracking scaling policy on the Auto Scaling group with a predefined metric of ASGAverageCPUUtilization and a target value of 50%.
B.Enable detailed monitoring for the EC2 instances and create a CloudWatch alarm that triggers a step scaling policy when CPU utilization exceeds 80%.
C.Configure a scheduled scaling policy to increase the desired capacity during known peak hours.
D.Configure a target tracking scaling policy on the Auto Scaling group with a predefined metric of ALBRequestCountPerTarget and a target value of 1000.
AnswerA

Target tracking with ASGAverageCPUUtilization at 50% will automatically adjust the number of instances to keep average CPU utilization near the target. This directly addresses the CPU bottleneck by scaling out when utilization rises, ensuring responsiveness during peak loads. It is a simple and effective solution that also minimizes costs by scaling in when demand drops.

Why this answer

The application's performance degradation is directly linked to high CPU utilization on the EC2 instances. A target tracking scaling policy using the ASGAverageCPUUtilization metric with a target of 50% will automatically add or remove instances to keep CPU utilization near that level. This provides responsive scaling during peak loads and cost savings during low demand.

Other options either do not directly address CPU load or require manual tuning and prediction.

Exam trap

The trap here is assuming that scaling based on request count or a fixed schedule is always sufficient, when the actual bottleneck is CPU utilization, which requires a metric that reflects compute load.

224
MCQmedium

A Solutions Architect runs the above AWS CLI command and gets the output shown. The instance is 'running' but the application is not accessible. What should the Solutions Architect check next?

A.Check if the instance is terminated.
B.Check if the instance ID is correct.
C.Check the instance status checks.
D.Check the security group rules for the instance.
AnswerD

A running instance with an unreachable application commonly indicates network filtering rather than instance state. Security group rules govern inbound traffic to the instance, so verifying that the required port is permitted from the client or load balancer is the logical next diagnostic step.

Why this answer

The instance is running but the application is inaccessible, which often indicates that security group rules are not allowing the required inbound traffic. Option A is wrong because the instance is reported as 'running', so it is not terminated. Option B is wrong because the command output successfully returns instance details, meaning the instance ID is correct.

Option C is wrong because status checks relate to the health of the instance OS and system, not network access.

225
MCQeasy

A company uses AWS CloudFormation to deploy infrastructure. A recent change to a stack failed because an IAM role name already exists. The company wants to avoid this issue in the future. What should a solutions architect do?

A.Enable termination protection on the stack.
B.Use a DeletionPolicy of Retain on the IAM role resource.
C.Create a custom resource with an AWS Lambda function to generate a random role name.
D.Use the Fn::Sub function with a reference to the AWS::StackName in the IAM role name.
AnswerD

This ensures unique role names across stacks.

Why this answer

Using `Fn::Sub` with a reference to `AWS::StackName` (e.g., `${AWS::StackName}-role`) makes the IAM role name unique per stack, preventing collisions when multiple stacks are deployed in the same account. This is the standard CloudFormation pattern for avoiding hardcoded name conflicts and enabling repeatable deployments.

Exam trap

The trap is picking a 'clever' solution (custom resource with Lambda) when a built-in CloudFormation feature (`Fn::Sub` + `AWS::StackName`) solves the problem more simply — candidates who don't know pseudo-parameters may over-engineer.

How to eliminate wrong answers

Option A is wrong because termination protection only prevents accidental stack deletion; it does nothing to resolve name collisions during updates or parallel deployments. Option B is wrong because a DeletionPolicy of Retain keeps the IAM role after stack deletion, which actually worsens the problem — the orphaned role's name remains reserved and blocks future stacks from creating a role with the same name. Option C is wrong because a custom resource with Lambda to generate random names adds unnecessary complexity, cost, and operational overhead; CloudFormation's built-in pseudo-parameter `AWS::StackName` already provides uniqueness without custom code.

← PreviousPage 3 of 4 · 228 questions totalNext →

Ready to test yourself?

Try a timed practice session using only Continuous Improvement for Existing Solutions questions.