Courseiva
Deployment →mediumMultiple Choice

DVA-C02 Deployment Practice Question

A company uses AWS OpsWorks to manage a stack of EC2 instances. The operations team needs to deploy a new configuration file to all instances in a layer. Which approach should the team use to automate this deployment?

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 Chef recipe to the layer's custom cookbooks that copies the configuration file to the instances

The correct answer is B: adding a Chef recipe to the layer's custom cookbooks that copies the configuration file to the instances. AWS OpsWorks Stacks is built on Chef, so configuration management tasks like distributing files to all instances in a layer are performed through recipes executed during lifecycle events (Setup, Configure, Deploy), making this the native and automated approach. Option A is not the OpsWorks-native mechanism and would bypass the stack's Chef-based lifecycle, requiring manual invocation or separate targeting. Option C is incorrect because CloudFormation provisions infrastructure and does not manage in-instance configuration files for an existing OpsWorks stack. Option D is also wrong because CodeDeploy is a separate deployment service not integrated with OpsWorks Stacks' Chef recipe model.

Answer analysis

Option-by-option breakdown

For each option: why learners choose it and why it is or isn't the right answer here.

  • ✗

    Use AWS Systems Manager Run Command to execute a script that deploys the file

    Why it's wrong here

    Systems Manager Run Command is a general-purpose command execution service that operates independently of OpsWorks and its Chef/Puppet configuration lifecycle; using it would bypass the stack's managed configuration model entirely, meaning the change wouldn't be captured in OpsWorks recipes and would be lost or overwritten the next time OpsWorks runs its standard lifecycle events.

  • ✓

    Add a Chef recipe to the layer's custom cookbooks that copies the configuration file to the instances

    Why this is correct

    OpsWorks Stacks is built on Chef, and adding a custom Chef recipe to the layer's cookbook (then associating it with a lifecycle event such as Configure or Deploy, or triggering it on demand) is the native, idempotent mechanism for pushing configuration file changes to every instance in that layer consistently and repeatably.

  • ✗

    Create a new AWS CloudFormation stack to update the instances

    Why it's wrong here

    CloudFormation is an infrastructure provisioning and orchestration service that manages the creation and lifecycle of AWS resources declaratively; it is not designed to push application-level or OS-level configuration file changes onto already-running instances managed by a separate OpsWorks stack, so it does not fit this operational task.

  • ✗

    Use AWS CodeDeploy to deploy the configuration file

    Why it's wrong here

    AWS CodeDeploy is purpose-built for deploying application revisions (code, scripts, artifacts defined in an AppSpec file) to EC2, on-premises, Lambda, or ECS targets, and is a separate deployment service from OpsWorks — it is not the native mechanism for updating configuration within an OpsWorks-managed stack's layer.

About these practice questions

This DVA-C02 question is part of Courseiva's 1,135-question bank — original exam-style content with full explanations and wrong-answer analysis, never real exam questions or exam dumps. Learn why practice questions differ from exam dumps →

How Courseiva writes practice questions · Editorial policy

JA

Written by Johnson Ajibi, MSc IT Security

Senior Network & Security Engineer · founder of Courseiva

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.