DVA-C02 exam dumps

DVA-C02 practice question 269 of 399

AWS Certified Developer - Associate. Associate level, Amazon Web Services. Free question with the correct answer and a full explanation.

DVA-C02 Question 269

Select 2

You are managing a CI/CD pipeline in AWS CodePipeline for a web application. The pipeline has three stages: Source, Build, and Deploy. The source code is stored in a CodeCommit repository with two branches: 'main' and 'dev'. Your goal is to ensure that the 'main' branch triggers the pipeline for production deployments, while the 'dev' branch triggers the pipeline for testing purposes. Which actions should you take to achieve this?

  1. A

    Create two separate CodePipeline pipelines, one for the 'main' branch and one for the 'dev' branch.

  2. B

    Configure a single pipeline with two Source stages, one for the 'main' branch and one for the 'dev' branch.

  3. C

    Set up two event rules in Amazon EventBridge, one to trigger the pipeline when changes are pushed to the 'main' branch and another for the 'dev' branch.

  4. D

    Use AWS CodePipeline's built-in branch filtering feature in the Source stage to specify the branch for triggering the pipeline.

  5. E

    Manually trigger the pipeline for 'main' and 'dev' branches whenever necessary.

Show answer and explanation

Correct answers: B, D

Explanation

AWS CodePipeline supports configuring branch-based triggers directly in the Source stage. By setting up two Source stages in a single pipeline (one for the 'main' branch and one for the 'dev' branch) and using branch filtering, you can automate deployments for different environments. This approach is efficient and aligns with CI/CD best practices, avoiding the need for multiple pipelines or external tools like EventBridge.

  • A. Incorrect.

    Creating two separate CodePipeline pipelines for 'main' and 'dev' branches is not necessary and would add unnecessary complexity and cost. A single pipeline can handle branch filtering.

  • B. Correct.

    Configuring a single pipeline with two Source stages, one for the 'main' branch and one for the 'dev' branch, is a valid approach. Each Source stage can independently monitor a specific branch and trigger the pipeline accordingly.

  • C. Incorrect.

    EventBridge rules are not required for this scenario, as AWS CodePipeline can natively handle branch-based triggers through the Source stage configuration.

  • D. Correct.

    Using AWS CodePipeline's built-in branch filtering feature in the Source stage is a straightforward and efficient way to specify which branch should trigger the pipeline. It eliminates the need for external triggers or additional configurations.

  • E. Incorrect.

    Manually triggering the pipeline is not an automated solution and does not align with the principles of CI/CD, which emphasize automation and consistency.

Timed practice exam

Take a DVA-C02 practice test under exam conditions

65 questions in 130 minutes, drawn from this bank, with a score report and a per-question review when you finish.

Start timed exam