Question 43 of 1,616
DeploymenthardMultiple ChoiceObjective-mapped

Quick Answer

The answer is to add a test stage after the Deploy stage with an action that invokes a Lambda function to run tests. This is correct because AWS CodePipeline stages execute sequentially, so placing a test stage immediately after the CloudFormation Deploy stage ensures integration tests run against the newly deployed stack before the pipeline finalizes. The Lambda action can execute custom test scripts, making it a flexible, serverless solution that avoids manual intervention. On the AWS Certified Developer Associate DVA-C02 exam, this scenario tests your understanding of CodePipeline stage ordering and Lambda as a custom action provider—a common trap is assuming you must use a separate CodeBuild project for testing, but Lambda is simpler and more direct for post-deploy validation. Remember that CodePipeline supports Lambda as a first-class action type, so you can invoke it directly without additional infrastructure. Memory tip: “Deploy first, then Lambda test—pipeline best.”

DVA-C02 Deployment Practice Question

This DVA-C02 practice question tests your understanding of deployment. This is a configuration task: choose the command set that satisfies every stated requirement. Small differences — like 'secret' vs 'password' or 'transport input ssh' vs 'all' — change whether the answer is correct. 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 developer uses AWS CodePipeline to deploy a serverless application defined with AWS SAM. The pipeline consists of Source (S3), Build (CodeBuild), and Deploy (CloudFormation) stages. The developer wants to run integration tests after the stack is deployed but before the pipeline completes. Which approach should the developer use?

Question 1hardmultiple choice
Full question →

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 test stage after the Deploy stage with an action that invokes a Lambda function to run tests.

Option A is correct because AWS CodePipeline allows you to add a test stage after the Deploy stage, and you can configure an action that invokes an AWS Lambda function to run integration tests. This ensures tests run automatically after the CloudFormation stack is deployed but before the pipeline completes, meeting the requirement 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 test stage after the Deploy stage with an action that invokes a Lambda function to run tests.

    Why this is correct

    This is the correct approach: a stage with an action type 'Invoke' or 'Test' can run integration tests after deployment.

    Related concept

    Read the scenario before looking for a memorised answer.

  • Use the CloudFormation stack's Outputs to trigger a Lambda function that runs tests.

    Why it's wrong here

    CloudFormation Outputs are used to export stack values, not to trigger actions.

  • Configure a post-deployment hook in the SAM template that runs tests.

    Why it's wrong here

    SAM does not support post-deployment hooks; all lifecycle events are handled by CloudFormation custom resources or CodePipeline.

  • Add a manual approval step after Deploy, then run tests manually.

    Why it's wrong here

    Manual approval requires human intervention, which is not automated.

Common exam traps

Common exam trap: answer the scenario, not the keyword

The trap here is that candidates may confuse CloudFormation Outputs with event-driven triggers or assume SAM has built-in post-deployment hooks, when in fact CodePipeline's custom action with Lambda is the correct mechanism for running automated tests after deployment.

Trap categories for this question

  • Command / output trap

    CloudFormation Outputs are used to export stack values, not to trigger actions.

Detailed technical explanation

How to think about this question

Under the hood, CodePipeline actions can be configured with a Lambda function as a custom action provider, where the function receives a JSON event with pipeline context and must call PutJobSuccessResult or PutJobFailureResult to signal completion. This pattern is commonly used for integration testing because it allows the function to interact with the deployed resources (e.g., API Gateway endpoints, DynamoDB tables) and report results back to the pipeline. A real-world scenario is validating that a new Lambda function version correctly processes test payloads before promoting the deployment to production.

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.

Related practice questions

Related DVA-C02 practice-question pages

Use these pages to review the topic behind this question. This is how one missed question becomes focused revision.

Practice this exam

Start a free DVA-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 DVA-C02 question test?

Deployment — This question tests Deployment — Read the scenario before looking for a memorised answer..

What is the correct answer to this question?

The correct answer is: Add a test stage after the Deploy stage with an action that invokes a Lambda function to run tests. — Option A is correct because AWS CodePipeline allows you to add a test stage after the Deploy stage, and you can configure an action that invokes an AWS Lambda function to run integration tests. This ensures tests run automatically after the CloudFormation stack is deployed but before the pipeline completes, meeting the requirement without manual intervention.

What should I do if I get this DVA-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 →

How Courseiva writes practice questions · Editorial policy

Keep practising

More DVA-C02 practice questions

Last reviewed: Jun 11, 2026

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.

Loading comments…

Sign in to join the discussion.

This DVA-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 DVA-C02 exam.