SOA-C02 Deployment, Provisioning, and Automation Practice Question
A company uses AWS OpsWorks to manage a stack of web servers. They need to deploy a configuration change that updates the /etc/nginx/nginx.conf file on all instances. Which OpsWorks feature should be used?
⚠ Common exam trap
Test-takers frequently confuse lifecycle events (the trigger) with the actual configuration logic (the recipe), leading candidates to pick 'Lifecycle events' when the question asks for the feature that performs the file update.
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
✓
Custom Chef recipes
Custom Chef recipes are the correct choice because OpsWorks uses Chef to manage configuration, and deploying a specific file change like /etc/nginx/nginx.conf requires a custom recipe that directly modifies the file using Chef resources (e.g., template or file resource). This allows precise, idempotent configuration management across all instances in the stack.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✓
Custom Chef recipes
Why this is correct
A custom Chef recipe is the executable configuration unit in OpsWorks Stacks: when assigned to a layer lifecycle event, it runs on the instance and uses Chef resources (file, template, package, service, execute) to actually change configuration, such as updating an application configuration file. This is why the scenario—applying a specific configuration change to web servers—maps directly to custom recipes, not to broader constructs.
- ✗
OpsWorks layers
Why it's wrong here
An OpsWorks layer defines the architecture and baseline settings of a set of instances, such as the AMI, instance type, security groups, and which recipes fire on lifecycle events. The layer is a metadata/grouping object; it does not itself perform any file modifications or configuration actions on the instances. So while the change would likely be configured by adding or modifying a recipe in the layer's settings, the layer is not the mechanism that updates files.
- ✗
Lifecycle events
Why it's wrong here
Lifecycle events (Setup, Configure, Deploy, Undeploy, Shutdown) represent moments in the instance lifecycle that trigger the related recipes in a layer. They are timing hooks only—without a recipe attached to the event, no configuration change occurs. The event itself never touches files or processes; it simply invokes whatever Chef recipe is associated with that lifecycle stage.
- ✗
Custom cookbooks
Why it's wrong here
A custom cookbook is a packaged collection containing recipes, templates, attributes, definitions, and libraries. Uploading a cookbook to OpsWorks (in S3 or a git repo) makes the code available on the instance, but that alone does not apply any changes—the change is applied only when a specific recipe within the cookbook is executed. Thus the cookbook is the delivery vessel, and the Chef recipe is the unit that actually enacts the configuration update.
Go deeper
Related to this question
About these practice questions
One of 1,169 original SOA-C02 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
Same concept, more angles
1 more way this is tested on SOA-C02
These questions test the same concept from different angles. Work through them to make sure you can recognise it however the exam phrases it.
Variation 1. A company is using AWS OpsWorks for configuration management. They have a stack with multiple layers, and they want to automate the deployment of a custom configuration file to all instances in a specific layer. What is the MOST efficient way to achieve this?
easy- A.Define the file in an AWS CloudFormation template using the AWS::OpsWorks::App resource.
- ✓ B.Create a custom cookbook and assign it to the layer.
- C.Use AWS Systems Manager Run Command to execute a script on each instance.
- D.Add the configuration file as user data in the layer's Auto Scaling group.
Why B: OpsWorks custom cookbooks allow you to run recipes that can deploy files to instances in a layer. Option A is incorrect because the AWS::OpsWorks::App resource is used to deploy applications, not configuration files, and it does not directly add custom configuration files to instances. Option C is incorrect because AWS Systems Manager Run Command can execute commands but is not specific to OpsWorks layers and is less efficient for automating deployments tied to a specific layer's lifecycle. Option D is incorrect because user data scripts run at boot time only, not on demand, and they are not directly associated with OpsWorks layers.
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.