Free AWS SAP-C02 practice questions

10 free AWS SAP-C02 practice questions with the correct answer and a full explanation for each, taken from the CertStash pack of 529 questions. Work through them, then open each answer to check your reasoning.

Question 1

A company needs to architect a hybrid DNS solution. This solution will use an Amazon Route 53 private hosted zone for the domain cloud.example.com for the resources stored within VPCs.

The company has the following DNS resolution requirements:

On-premises systems should be able to resolve and connect to cloud.example.com.

All VPCs should be able to resolve cloud.example.com.

There is already an AWS Direct Connect connection between the on-premises corporate network and AWS Transit Gateway.

Which architecture should the company use to meet these requirements with the HIGHEST performance?

  1. Associate the private hosted zone to all the VPCs. Create a Route 53 inbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.
  2. Associate the private hosted zone to all the VPCs. Deploy an Amazon EC2 conditional forwarder in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the conditional forwarder.
  3. Associate the private hosted zone to the shared services VPC. Create a Route 53 outbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the outbound resolver.
  4. Associate the private hosted zone to the shared services VPC. Create a Route 53 inbound resolver in the shared services VPC. Attach the shared services VPC to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.
Show answer and explanation

Correct answer: A. Associate the private hosted zone to all the VPCs. Create a Route 53 inbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver.

Create a Route 53 inbound resolver in the shared services VPC. Attach all VPCs to the transit gateway and create forwarding rules in the on-premises DNS server for cloud.example.com that point to the inbound resolver. Option A correctly addresses all requirements with highest performance: it associates the private hosted zone to ALL VPCs (enabling all VPCs to resolve cloud.example.com), creates a Route 53 inbound resolver in the shared services VPC (enabling on-premises systems to resolve via the existing Direct Connect), and uses the transit gateway for connectivity. The inbound resolver specifically handles DNS queries coming from on- premises over the Direct Connect connection. Option D fails because it only associates the private hosted zone to the shared services VPC, preventing other VPCs from directly resolving the domain.

Why the other options are wrong

  • B. EC2 conditional forwarders are not managed AWS services and require manual maintenance, reducing performance and reliability compared to Route 53 resolvers.
  • C. Outbound resolvers are for resolving external/on-premises domains from AWS, not for receiving queries from on-premises systems.
  • D. Associating the private hosted zone only to the shared services VPC prevents other VPCs from resolving cloud.example.com directly.

Question 2

A company is providing weather data over a REST-based API to several customers. The API is hosted by Amazon API Gateway and is integrated with different AWS Lambda functions for each API operation. The company uses Amazon Route 53 for DNS and has created a resource record of weather.example.com. The company stores data for the API in Amazon DynamoDB tables. The company needs a solution that will give the API the ability to fail over to a different AWS Region.

Which solution will meet these requirements?

  1. Deploy a new set of Lambda functions in a new Region. Update the API Gateway API to use an edge-optimized API endpoint with Lambda functions from both Regions as targets. Convert the DynamoDB tables to global tables.
  2. Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a multivalue answer. Add both API Gateway APIs to the answer. Enable target health monitoring. Convert the DynamoDB tables to global tables.
  3. Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a failover record. Enable target health monitoring. Convert the DynamoDB tables to global tables.
  4. Deploy a new API Gateway API in a new Region. Change the Lambda functions to global functions. Change the Route 53 DNS record to a multivalue answer. Add both API Gateway APIs to the answer. Enable target health monitoring. Convert the DynamoDB tables to global tables.
Show answer and explanation

Correct answer: C. Deploy a new API Gateway API and Lambda functions in another Region. Change the Route 53 DNS record to a failover record. Enable target health monitoring. Convert the DynamoDB tables to global tables.

in another Region. Change the Route 53 DNS record to a failover record. Enable target health monitoring. Convert the DynamoDB tables to global tables. Option C correctly implements a failover solution by deploying a new API Gateway and Lambda functions in another Region, converting DynamoDB tables to global tables for data replication, and using a Route 53 failover routing policy with health monitoring. The failover policy automatically routes traffic to the secondary Region when the primary Region's health check fails, providing the desired failover capability with minimal RTO. Global DynamoDB tables enable data consistency across regions.

Why the other options are wrong

  • A. Edge-optimized endpoints with multiple region targets do not provide automatic failover; they perform routing based on geography, not health. This requires manual intervention during outages.
  • B. Multivalue answer routing returns multiple healthy records but does not provide automatic failover; clients must retry independently. It's not designed for active-passive failover scenarios.
  • D. Lambda functions cannot be made global; they must be deployed in specific regions. The approach is otherwise similar to B, which lacks true automatic failover semantics.

Question 3

A company uses AWS Organizations with a single OU named Production to manage multiple accounts. All accounts are members of the Production OU. Administrators use deny list SCPs in the root of the organization to manage access to restricted services.

The company recently acquired a new business unit and invited the new unit’s existing AWS account to the organization. Once onboarded, the administrators of the new business unit discovered that they are not able to update existing AWS Config rules to meet the company’s policies.

Which option will allow administrators to make changes and continue to enforce the current policies without introducing additional long-term maintenance?

  1. Remove the organization’s root SCPs that limit access to AWS Config. Create AWS Service Catalog products for the company’s standard AWS Config rules and deploy them throughout the organization, including the new account.
  2. Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the new account to the Production OU when adjustments to AWS Config are complete.
  3. Convert the organization’s root SCPs from deny list SCPs to allow list SCPs to allow the required services only. Temporarily apply an SCP to the organization’s root that allows AWS Config actions for principals only in the new account.
  4. Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the organization’s root SCP to the Production OU. Move the new account to the Production OU when adjustments to AWS Config are complete.
Show answer and explanation

Correct answer: B. Create a temporary OU named Onboarding for the new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the new account to the Production OU when adjustments to AWS Config are complete.

new account. Apply an SCP to the Onboarding OU to allow AWS Config actions. Move the new account to the Production OU when adjustments to AWS Config are complete. Option B solves the problem with minimal long-term maintenance by creating a temporary Onboarding OU with an SCP that allows AWS Config actions, letting the new account make necessary updates. Once adjustments are complete, moving the account to the Production OU restores the deny list SCPs. This approach avoids modifying the organization-wide policies that enforce current compliance standards, and the temporary OU is easily managed and cleaned up. It provides the necessary exceptions during onboarding without permanent policy changes.

Why the other options are wrong

  • A. Removing root SCPs that limit access to AWS Config would weaken security controls across the entire organization and create ongoing maintenance burden.
  • C. Converting from deny list to allow list SCPs would require comprehensive enumeration of all allowed services and creates significant ongoing maintenance complexity across the organization.
  • D. Moving the root SCP to the Production OU removes it from the Onboarding OU, defeating the purpose of the exception and forcing the new account into unrestricted access during onboarding.

Question 4

A company is running a two-tier web-based application in an on-premises data center. The application layer consists of a single server running a stateful application. The application connects to a PostgreSQL database running on a separate server. The application’s user base is expected to grow significantly, so the company is migrating the application and database to AWS. The solution will use Amazon Aurora PostgreSQL, Amazon EC2 Auto Scaling, and Elastic Load Balancing.

Which solution will provide a consistent user experience that will allow the application and database tiers to scale?

  1. Enable Aurora Auto Scaling for Aurora Replicas. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled.
  2. Enable Aurora Auto Scaling for Aurora writers. Use an Application Load Balancer with the round robin routing algorithm and sticky sessions enabled.
  3. Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled.
  4. Enable Aurora Scaling for Aurora writers. Use a Network Load Balancer with the least outstanding requests routing algorithm and sticky sessions enabled. ✅Correct Answer: C, Enable Aurora Auto Scaling for Aurora Replicas. Use an Application Load Balancer with the round robin routing and sticky sessions enabled. Aurora Auto Scaling adds and removes Aurora Replicas, so it scales the database tier as the user base grows. For the stateful application layer, an Application Load Balancer with round robin routing spreads requests across the EC2 instances in the Auto Scaling group, and sticky sessions keep each user bound to the same instance so session state stays consistent. This gives both tiers room to scale while preserving the user experience.
Show answer and explanation

Answer and explanation for question 4

Question 5

A company uses a service to collect metadata from applications that the company hosts on premises. Consumer devices such as TVs and internet radios access the applications. Many older devices do not support certain HTTP headers and exhibit errors when these headers are present in responses. The company has configured an on- premises load balancer to remove the unsupported headers from responses sent to older devices, which the company identified by the User-Agent headers.

The company wants to migrate the service to AWS, adopt serverless technologies, and retain the ability to support the older devices. The company has already migrated the applications into a set of AWS Lambda functions.

Which solution will meet these requirements?

  1. Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a CloudFront function to remove the problematic headers based on the value of the User-Agent header.
  2. Create an Amazon API Gateway REST API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Modify the default gateway responses to remove the problematic headers based on the value of the User-Agent header.
  3. Create an Amazon API Gateway HTTP API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Create a response mapping template to remove the problematic headers based on the value of the User-Agent. Associate the response data mapping with the HTTP API.
  4. Create an Amazon CloudFront distribution for the metadata service. Create an Application Load Balancer (ALB). Configure the CloudFront distribution to forward requests to the ALB. Configure the ALB to invoke the correct Lambda function for each type of request. Create a Lambda@Edge function that will remove the problematic headers in response to viewer requests based on the value of the User- Agent header.
Show answer and explanation

Correct answer: B. Create an Amazon API Gateway REST API for the metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Modify the default gateway responses to remove the problematic headers based on the value of the User-Agent header.

metadata service. Configure API Gateway to invoke the correct Lambda function for each type of request. Modify the default gateway responses to remove the problematic headers based on the value of the User-Agent header. A REST API in Amazon API Gateway provides a fully serverless front end that routes each type of request to the correct Lambda function. Gateway responses can be customized so the headers API Gateway returns are overridden or removed based on the User-Agent value, which keeps older TVs and internet radios working. No load balancer, distribution, or edge code has to be built or maintained.

Why the other options are wrong

  • A. Placing an ALB and a CloudFront distribution in front of the Lambda functions adds components that the serverless goal does not require.
  • C. HTTP APIs do not support mapping templates. They offer parameter mapping only, so the response mapping template described cannot be created.
  • D. Viewer request events act on requests before they reach the origin, so a Lambda@Edge function on that event cannot strip headers from responses.

Question 6

A company is running a traditional web application on Amazon EC2 instances. The company needs to refactor the application as microservices that run on containers. Separate versions of the application exist in two distinct environments: production and testing. Load for the application is variable, but the minimum load and the maximum load are known. A solutions architect needs to design the updated application with a serverless architecture that minimizes operational complexity.

Which solution will meet these requirements MOST cost-effectively?

  1. Upload the container images to AWS Lambda as functions. Configure a concurrency limit for the associated Lambda functions to handle the expected peak load. Configure two separate Lambda integrations within Amazon API Gateway: one for production and one for testing.
  2. Upload the container images to Amazon Elastic Container Registry (Amazon ECR). Configure two auto scaled Amazon Elastic Container Service (Amazon ECS) clusters with the Fargate launch type to handle the expected load. Deploy tasks from the ECR images. Configure two separate Application Load Balancers to direct traffic to the ECS clusters.
  3. Upload the container images to Amazon Elastic Container Registry (Amazon ECR). Configure two auto scaled Amazon Elastic Kubernetes Service (Amazon EKS) clusters with the Fargate launch type to handle the expected load. Deploy tasks from the ECR images. Configure two separate Application Load Balancers to direct traffic to the EKS clusters.
  4. Upload the container images to AWS Elastic Beanstalk. In Elastic Beanstalk, create separate environments and deployments for production and testing. Configure two separate Application Load Balancers to direct traffic to the Elastic Beanstalk deployments.
Show answer and explanation

Correct answer: B. Upload the container images to Amazon Elastic Container Registry (Amazon ECR). Configure two auto scaled Amazon Elastic Container Service (Amazon ECS) clusters with the Fargate launch type to handle the expected load. Deploy tasks from the ECR images. Configure two separate Application Load Balancers to direct traffic to the ECS clusters.

Container Registry (Amazon ECR). Configure two auto scaled Amazon Elastic Container Service (Amazon ECS) clusters with the Fargate launch type to handle the expected load. Deploy tasks from the ECR images. Configure two separate Application Load Balancers to direct traffic to the ECS clusters. Option B provides the most cost-effective serverless solution by using Amazon ECS with Fargate launch type, which combines container support with serverless economics (pay- per-use, automatic scaling). ECS with Fargate is specifically designed for containerized microservices and eliminates operational complexity of managing EC2 instances. Two separate auto-scaled ECS clusters handle production and testing environments with known minimum/maximum loads. ALBs route traffic to each cluster. This is more cost- effective than EKS (which adds complexity) and more suitable for this workload than Lambda.

Why the other options are wrong

  • A. Lambda has limitations on execution time, memory, and package size that make it unsuitable for traditional web applications. Lambda also cannot efficiently handle continuous variable loads compared to ECS.
  • C. EKS adds operational complexity with Kubernetes management overhead compared to ECS, increasing both cost and maintenance burden without proportional benefit for this use case.
  • D. Elastic Beanstalk is not a pure serverless offering and still requires infrastructure management. It's less cost-effective than ECS Fargate for variable workloads.

Question 7

A company has a multi-tier web application that runs on a fleet of Amazon EC2 instances behind an Application Load Balancer (ALB). The instances are in an Auto

Scaling group. The ALB and the Auto Scaling group are replicated in a backup AWS Region. The minimum value and the maximum value for the Auto Scaling group are set to zero. An Amazon RDS Multi-AZ DB instance stores the application’s data. The DB instance has a read replica in the backup Region. The application presents an endpoint to end users by using an Amazon Route 53 record.

The company needs to reduce its RTO to less than 15 minutes by giving the application the ability to automatically fail over to the backup Region.

The company does not have a large enough budget for an active-active strategy.

What should a solutions architect recommend to meet these requirements?

  1. Reconfigure the application’s Route 53 record with a latency-based routing policy that load balances traffic between the two ALBs. Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Create an Amazon CloudWatch alarm that is based on the HTTPCode_Target_5XX_Count metric for the ALB in the primary Region. Configure the CloudWatch alarm to invoke the Lambda function.
  2. Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Configure Route 53 with a health check that monitors the web application and sends an Amazon Simple Notification Service (Amazon SNS) notification to the Lambda function when the health check status is unhealthy. Update the application’s Route 53 record with a failover policy that routes traffic to the ALB in the backup Region when a health check failure occurs.
  3. Configure the Auto Scaling group in the backup Region to have the same values as the Auto Scaling group in the primary Region. Reconfigure the application’s Route 53 record with a latency-based routing policy that load balances traffic between the two ALBs. Remove the read replica. Replace the read replica with a standalone RDS DB instance. Configure Cross-Region Replication between the RDS DB instances by using snapshots and Amazon S3.
  4. Configure an endpoint in AWS Global Accelerator with the two ALBs as equal weighted targets. Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Create an Amazon CloudWatch alarm that is based on the HTTPCode_Target_5XX_Count metric for the ALB in the primary Region. Configure the CloudWatch alarm to invoke the Lambda function. ✅Correct Answer: B, Create an AWS Lambda function in the backup Region to promote the read replica and modify the Auto Scaling group values. Configure Route 53 with a health check that monitors the web application and sends an Amazon Simple Notification Service (Amazon SNS) notification to the Lambda function when the health check status is unhealthy. Update the application's Route 53 record with a failover policy that routes traffic to the ALB in the backup Region when a health check failure occurs. Option B meets the sub-15-minute RTO with a Route 53 failover routing policy backed by health checks. When the health check for the primary Region fails, Route 53 shifts traffic to the ALB in the backup Region, and the health check notification goes through Amazon SNS to invoke a Lambda function that promotes the RDS read replica and raises the Auto Scaling group values. The backup Region stays scaled to zero until it is needed, so the design stays within the budget and avoids an active-active footprint.
Show answer and explanation

Answer and explanation for question 7

Question 8

A company is hosting a critical application on a single Amazon EC2 instance. The application uses an Amazon ElastiCache for Redis single-node cluster for an in-memory data store. The application uses an Amazon RDS for MariaDB DB instance for a relational database. For the application to function, each piece of the infrastructure must be healthy and must be in an active state.

A solutions architect needs to improve the application's architecture so that the infrastructure can automatically recover from failure with the least possible downtime.

Which combination of steps will meet these requirements? (Choose three.)

  1. Use an Elastic Load Balancer to distribute traffic across multiple EC2 instances. Ensure that the EC2 instances are part of an Auto Scaling group that has a minimum capacity of two instances.
  2. Use an Elastic Load Balancer to distribute traffic across multiple EC2 instances. Ensure that the EC2 instances are configured in unlimited mode.
  3. Modify the DB instance to create a read replica in the same Availability Zone. Promote the read replica to be the primary DB instance in failure scenarios.
  4. Modify the DB instance to create a Multi-AZ deployment that extends across two Availability Zones.
  5. Create a replication group for the ElastiCache for Redis cluster. Configure the cluster to use an Auto Scaling group that has a minimum capacity of two instances.
  6. Create a replication group for the ElastiCache for Redis cluster. Enable Multi-AZ on the cluster.
Show answer and explanation

Correct answer: A, D, F

A. Use an Elastic Load Balancer to distribute traffic across multiple EC2 instances. Ensure that the EC2 instances are part of an Auto Scaling group that has a minimum capacity of two instances. D. Modify the DB instance to create a Multi-AZ deployment that extends across two Availability Zones. F. Create a replication group for the ElastiCache for Redis cluster. Enable Multi- AZ on the cluster. The correct combination addresses each infrastructure component: A ensures EC2 redundancy with multiple instances across AZs in an Auto Scaling group (minimum 2) for automatic recovery from instance failure. D implements Multi-AZ deployment for RDS MariaDB with automatic failover capability. F creates ElastiCache replication group with Multi-AZ to handle Redis node failures. Together, these three options provide automatic recovery for all critical components: compute (A), database (D), and in-memory cache (F), meeting the requirement for least downtime.

Why the other options are wrong

  • B. Unlimited mode configures EC2 CPU credit behavior but does not improve availability or enable failover/recovery.
  • C. Creating a read replica in the same AZ provides no failover benefit since both instances remain in a single failure domain. Manual promotion negates the automatic recovery requirement.
  • E. Using an Auto Scaling group for ElastiCache is not valid; ElastiCache scaling is managed through replication groups, not Auto Scaling groups.

Question 9

A retail company is operating its ecommerce application on AWS. The application runs on Amazon EC2 instances behind an Application Load Balancer (ALB). The company uses an Amazon RDS DB instance as the database backend. Amazon CloudFront is configured with one origin that points to the ALB. Static content is cached. Amazon Route 53 is used to host all public zones.

After an update of the application, the ALB occasionally returns a 502 status code (Bad Gateway) error. The root cause is malformed HTTP headers that are returned to the ALB. The webpage returns successfully when a solutions architect reloads the webpage immediately after the error occurs.

While the company is working on the problem, the solutions architect needs to provide a custom error page instead of the standard ALB error page to visitors.

Which combination of steps will meet this requirement with the LEAST amount of operational overhead? (Choose two.)

  1. Create an Amazon S3 bucket. Configure the S3 bucket to host a static webpage. Upload the custom error pages to Amazon S3.
  2. Create an Amazon CloudWatch alarm to invoke an AWS Lambda function if the ALB health check response Target.FailedHealthChecks is greater than 0. Configure the Lambda function to modify the forwarding rule at the ALB to point to a publicly accessible web server.
  3. Modify the existing Amazon Route 53 records by adding health checks. Configure a fallback target if the health check fails. Modify DNS records to point to a publicly accessible webpage.
  4. Create an Amazon CloudWatch alarm to invoke an AWS Lambda function if the ALB health check response Elb.InternalError is greater than 0. Configure the Lambda function to modify the forwarding rule at the ALB to point to a public accessible web server.
  5. Add a custom error response by configuring a CloudFront custom error page. Modify DNS records to point to a publicly accessible web page. ✅Correct Answer: A, E
  6. Create an Amazon S3 bucket. Configure the S3 bucket to host a static webpage. Upload the custom error pages to Amazon S3.
  7. Add a custom error response by configuring a CloudFront custom error page. Modify DNS records to point to a publicly accessible web page. CloudFront custom error responses intercept the 502 returned by the origin and serve a friendly page instead, and that page can be a static site hosted in an S3 bucket. Setup is pure configuration: upload the error pages to S3 and define the custom error response on the existing distribution. There is no Lambda code, alarm, or failover automation to build and maintain, so operational overhead stays at a minimum.
Show answer and explanation

Answer and explanation for question 9

Question 10

A company has many AWS accounts and uses AWS Organizations to manage all of them. A solutions architect must implement a solution that the company can use to share a common network across multiple accounts.

The company’s infrastructure team has a dedicated infrastructure account that has a VPC. The infrastructure team must use this account to manage the network. Individual accounts cannot have the ability to manage their own networks. However, individual accounts must be able to create AWS resources within subnets.

Which combination of actions should the solutions architect perform to meet these requirements? (Choose two.)

  1. Create a transit gateway in the infrastructure account.
  2. Enable resource sharing from the AWS Organizations management account.
  3. Create VPCs in each AWS account within the organization in AWS Organizations. Configure the VPCs to share the same CIDR range and subnets as the VPC in the infrastructure account. Peer the VPCs in each individual account with the VPC in the infrastructure account.
  4. Create a resource share in AWS Resource Access Manager in the infrastructure account. Select the specific AWS Organizations OU that will use the shared network. Select each subnet to associate with the resource share.
  5. Create a resource share in AWS Resource Access Manager in the infrastructure account. Select the specific AWS Organizations OU that will use the shared network. Select each prefix list to associate with the resource share. ✅Correct Answer: B, D
  6. Enable resource sharing from the AWS Organizations management account.
  7. Create a resource share in AWS Resource Access Manager in the infrastructure account. Select the specific AWS Organizations OU that will use the shared network. Select each subnet to associate with the resource share. VPC sharing lets member accounts launch resources in subnets they do not own. Within an organization, resource sharing must first be enabled from the AWS Organizations management account. The infrastructure account then creates an AWS Resource Access Manager share targeting the OU and including each subnet, keeping network control centralized while other accounts build in it.
Show answer and explanation

Answer and explanation for question 10

Answer and explanation for question 10

That was 10 of 529.

The full AWS SAP-C02 pack has all 529 questions, each with the answer, the explanation and why the other options are wrong, plus a questions-only copy for timed runs. US$39, paid once, with free monthly updates and a pass-or-your-money-back guarantee.

Get the full pack