- A
Add a manual approval action between the source and deploy stages. The development team will manually run the tests on their local machines and then approve the pipeline to proceed.
Why wrong: This approach lacks automation and relies on manual intervention. It also does not run tests in an isolated environment; tests are run locally, which may not match the production environment. It does not guarantee that failed tests will automatically block the pipeline.
- B
Insert a test stage after the source stage with an AWS CloudFormation action that deploys a test stack and runs tests using a custom resource Lambda function.
Why wrong: CloudFormation is not the appropriate service for running code tests. This would be overly complex and not optimized for automated testing. CodeBuild is the native service for build and test actions in CodePipeline.
- C
Add a stage between source and deploy that uses an AWS CodeBuild action to run unit tests defined in a buildspec file. The pipeline will automatically stop if the build action fails.
CodeBuild is the ideal service for running automated tests in a controlled environment. It integrates natively with CodePipeline: if the CodeBuild build fails, the pipeline transitions to a failed state, stopping further execution and optionally sending notifications via Amazon SNS.
- D
Add a Lambda function as an action in the pipeline that runs the unit tests. The Lambda function writes the test results to an S3 bucket, and a subsequent approval action checks the results.
Why wrong: Using Lambda for running tests is not recommended because Lambda has execution time limits (15 minutes) and is not designed for complex build/test workflows. CodeBuild is purpose-built for this scenario and provides better isolation, logging, and integration.
Quick Answer
The correct action is to add a stage between source and deploy that uses an AWS CodeBuild action to run unit tests defined in a buildspec file. This works because CodeBuild is natively integrated with CodePipeline, providing an isolated, ephemeral environment for each build execution; when the build action fails, CodePipeline automatically halts the pipeline and can trigger an Amazon SNS notification to the development team without any manual intervention. On the AWS Certified SysOps Administrator Associate SOA-C02 exam, this scenario tests your understanding of how to insert a test stage using a fully managed build service, with a common trap being to mistakenly choose a manual approval action or a separate testing service that lacks native pipeline integration. Remember the key: CodeBuild is the only AWS service that runs code in an isolated container directly within a pipeline stage, and a failed build action stops the pipeline by default. A helpful memory tip is "Build to break the pipeline"—if the build fails, the pipeline stops.
SOA-C02 Deployment, Provisioning, and Automation Practice Question
This SOA-C02 practice question tests your understanding of deployment, provisioning, and automation. The scenario asks you to isolate a root cause — eliminate options that address a different problem before choosing. After answering, compare your reasoning against the explanation and wrong-answer breakdown below. Once you have made your selection, read the full explanation to reinforce the concept and understand why each distractor is designed to mislead on exam day.
A company uses AWS CodePipeline to automate the deployment of a web application. The pipeline consists of a source stage (AWS CodeCommit) and a deploy stage (AWS CodeDeploy) that deploys to an Auto Scaling group. The SysOps administrator needs to add a stage to run automated unit tests before the deployment proceeds. The tests must be executed in an isolated environment, and if they fail, the pipeline must stop and notify the development team. Which action should the administrator take?
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
Add a stage between source and deploy that uses an AWS CodeBuild action to run unit tests defined in a buildspec file. The pipeline will automatically stop if the build action fails.
Option C is correct because AWS CodeBuild is natively integrated with CodePipeline to run automated tests defined in a buildspec file. When the build action fails, CodePipeline automatically stops the pipeline execution and can send notifications via Amazon SNS, meeting the requirement for an isolated test environment and automatic failure notification without manual intervention.
Key principle: Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Add a manual approval action between the source and deploy stages. The development team will manually run the tests on their local machines and then approve the pipeline to proceed.
Why it's wrong here
This approach lacks automation and relies on manual intervention. It also does not run tests in an isolated environment; tests are run locally, which may not match the production environment. It does not guarantee that failed tests will automatically block the pipeline.
- ✗
Insert a test stage after the source stage with an AWS CloudFormation action that deploys a test stack and runs tests using a custom resource Lambda function.
Why it's wrong here
CloudFormation is not the appropriate service for running code tests. This would be overly complex and not optimized for automated testing. CodeBuild is the native service for build and test actions in CodePipeline.
- ✓
Add a stage between source and deploy that uses an AWS CodeBuild action to run unit tests defined in a buildspec file. The pipeline will automatically stop if the build action fails.
Why this is correct
CodeBuild is the ideal service for running automated tests in a controlled environment. It integrates natively with CodePipeline: if the CodeBuild build fails, the pipeline transitions to a failed state, stopping further execution and optionally sending notifications via Amazon SNS.
Related concept
Read the scenario before looking for a memorised answer.
- ✗
Add a Lambda function as an action in the pipeline that runs the unit tests. The Lambda function writes the test results to an S3 bucket, and a subsequent approval action checks the results.
Why it's wrong here
Using Lambda for running tests is not recommended because Lambda has execution time limits (15 minutes) and is not designed for complex build/test workflows. CodeBuild is purpose-built for this scenario and provides better isolation, logging, and integration.
Common exam traps
Common exam trap: answer the scenario, not the keyword
The trap here is that candidates may overcomplicate the solution by choosing CloudFormation or Lambda, overlooking that CodeBuild is the native, simplest, and most cost-effective service for running automated tests within a CodePipeline.
Trap categories for this question
Scenario analysis trap
Using Lambda for running tests is not recommended because Lambda has execution time limits (15 minutes) and is not designed for complex build/test workflows. CodeBuild is purpose-built for this scenario and provides better isolation, logging, and integration.
Detailed technical explanation
How to think about this question
CodeBuild runs in a managed, ephemeral build environment that is isolated per build, ensuring test integrity. The buildspec file defines phases such as 'pre_build', 'build', and 'post_build', where unit tests are executed; if any command returns a non-zero exit code, the build fails and CodePipeline transitions the stage to 'Failed', triggering any configured SNS notifications or CloudWatch Events. This pattern is widely used in CI/CD pipelines to enforce quality gates before deployment.
KKey Concepts to Remember
- Read the scenario before looking for a memorised answer.
- Find the constraint that changes the correct option.
- Eliminate answers that are true in general but not in this case.
TExam Day Tips
- Watch for words such as best, first, most likely and least administrative effort.
- Review why wrong options are wrong, not only why the correct option is correct.
Key takeaway
Answer the scenario, not the keyword: identify the specific constraint before choosing the most familiar-sounding option.
Real-world example
How this comes up in practice
A media company stores terabytes of video archives that are accessed once a year for audit purposes. Moving these objects to a cold storage tier (Azure Archive, S3 Glacier, or Google Nearline) costs a fraction of hot storage. Questions like this test whether you understand storage tiers, access frequency tradeoffs, and retrieval latency requirements.
What to study next
Got this wrong? Here's your next step.
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
- →
Deployment, Provisioning, and Automation — study guide chapter
Learn the concepts, then practise the questions
- →
Deployment, Provisioning, and Automation practice questions
Targeted practice on this topic area only
- →
All SOA-C02 questions
1,546 questions across all exam domains
- →
AWS Certified SysOps Administrator Associate SOA-C02 study guide
Full concept coverage aligned to exam objectives
- →
SOA-C02 practice test guide
How to use practice tests most effectively before exam day
Related practice questions
Related SOA-C02 practice-question pages
Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.
Monitoring, Logging, and Remediation practice questions
Practise SOA-C02 questions linked to Monitoring, Logging, and Remediation.
Reliability and Business Continuity practice questions
Practise SOA-C02 questions linked to Reliability and Business Continuity.
Deployment, Provisioning, and Automation practice questions
Practise SOA-C02 questions linked to Deployment, Provisioning, and Automation.
Security and Compliance practice questions
Practise SOA-C02 questions linked to Security and Compliance.
Networking and Content Delivery practice questions
Practise SOA-C02 questions linked to Networking and Content Delivery.
Cost and Performance Optimization practice questions
Practise SOA-C02 questions linked to Cost and Performance Optimization.
SOA-C02 fundamentals practice questions
Practise SOA-C02 questions linked to SOA-C02 fundamentals.
SOA-C02 scenario practice questions
Practise SOA-C02 questions linked to SOA-C02 scenario.
SOA-C02 troubleshooting practice questions
Practise SOA-C02 questions linked to SOA-C02 troubleshooting.
Practice this exam
Start a free SOA-C02 practice session
Short sessions build daily habit. Longer sessions build exam-day stamina. Try a timed session to simulate real conditions.
FAQ
Questions learners often ask
What does this SOA-C02 question test?
Deployment, Provisioning, and Automation — This question tests Deployment, Provisioning, and Automation — Read the scenario before looking for a memorised answer..
What is the correct answer to this question?
The correct answer is: Add a stage between source and deploy that uses an AWS CodeBuild action to run unit tests defined in a buildspec file. The pipeline will automatically stop if the build action fails. — Option C is correct because AWS CodeBuild is natively integrated with CodePipeline to run automated tests defined in a buildspec file. When the build action fails, CodePipeline automatically stops the pipeline execution and can send notifications via Amazon SNS, meeting the requirement for an isolated test environment and automatic failure notification without manual intervention.
What should I do if I get this SOA-C02 question wrong?
Identify which exam domain this question belongs to, review the core concept, then practise similar questions from the same domain.
What is the key concept behind this question?
Read the scenario before looking for a memorised answer.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, exam dumps, or protected exam content. Learn why practice questions differ from exam dumps →
Keep practising
More SOA-C02 practice questions
- A company uses an Amazon DynamoDB table with on-demand capacity mode. The table handles a workload with a steady baselin…
- A company uses Amazon CloudWatch Logs to store application logs. The SysOps administrator needs to count the occurrences…
- A SysOps administrator needs to monitor the CPU utilization of an Amazon EC2 instance and send an alert when it exceeds…
- A SysOps administrator needs to monitor the CPU utilization of an Amazon EC2 instance fleet and send an alert when the a…
- A company's security policy requires that all Amazon S3 buckets must have server-side encryption enabled. The SysOps adm…
- A SysOps administrator uses AWS CloudFormation to deploy a stack that includes an Amazon EC2 instance. The administrator…
Last reviewed: Jun 11, 2026
This SOA-C02 practice question is part of Courseiva's free Amazon Web Services certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the SOA-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.