SOA-C02 Deployment, Provisioning, and Automation Practice Question
A SysOps administrator is using AWS OpsWorks to manage a stack of web servers. The administrator wants to automate the installation of custom software on all new instances that are added to the layer. What is the best approach?
⚠ Common exam trap
It's easy for candidates to confuse OpsWorks lifecycle events with EC2 user data or CloudFormation, not realizing that OpsWorks has its own built-in Chef-based automation for instance configuration.
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
✓
Assign a custom Chef recipe to the layer's Setup lifecycle event.
AWS OpsWorks uses Chef to manage configuration. Assigning a custom Chef recipe to the layer's Setup lifecycle event ensures the recipe runs automatically on every new instance when it boots, installing the custom software consistently. This is the native, best-practice approach within OpsWorks for automating software installation on new instances.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Assign a custom Chef recipe to the layer's Setup lifecycle event.
Why this is correct
In AWS OpsWorks, the Setup lifecycle event runs on every new instance immediately after it finishes booting and before the Deploy event. Assigning a custom Chef recipe to Setup gives the OpsWorks agent an idempotent, declarative way to install and configure required software, ensuring consistent state across all instances. This is the native OpsWorks mechanism for bootstrapping software and is fully integrated with the stack's configuration management.
- ✗
Use AWS CloudFormation to install software on new instances.
Why it's wrong here
AWS CloudFormation orchestrates the creation and updating of AWS resources, and it can create an OpsWorks stack, but it does not subscribe to or react to per-instance lifecycle events inside that stack. When OpsWorks launches a new instance through scaling or manual addition, CloudFormation does not execute on that instance or trigger software installation routines. Relying on it would require custom resources, Lambda functions, or other out-of-band orchestration, making it far less integrated than native Chef recipes.
- ✗
Create a custom AMI with the software pre-installed and use that in the layer.
Why it's wrong here
Creating a custom AMI with all software pre-installed is functionally possible — you could set that AMI in the layer's configuration — but it contradicts the automation model of OpsWorks. Every software patch or dependency change requires building, testing, and redeploying a new AMI, and you must track AMI versions across environments, which increases maintenance overhead and risks configuration drift. OpsWorks recipes let you treat infrastructure as code and update running fleets without reimaging.
- ✗
Use EC2 user data scripts in the layer configuration.
Why it's wrong here
OpsWorks Stacks does not support or execute EC2 user data scripts for its layer instances; it ignores user data and instead relies on the OpsWorks agent to run Chef recipes. User data scripts run once via cloud-init when the instance first boots, but OpsWorks manages the boot sequence and expects configuration to be driven through cookbooks. Therefore, setting a user data script in the layer configuration will not install software and is not a valid bootstrap mechanism in OpsWorks.
Go deeper
Related to this question
About these practice questions
This SOA-C02 question is part of Courseiva's 1,169-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 →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
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.