SOA-C02 Deployment, Provisioning, and Automation Practice Question
A company uses AWS OpsWorks for configuration management. The SysOps administrator needs to deploy a new application version to a stack. What is the recommended way to update the application on the instances?
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
✓
Update the custom cookbook and run the 'deploy' recipe on the stack.
AWS OpsWorks uses recipes and custom cookbooks to manage application deployment. To deploy a new version, the SysOps administrator should update the custom cookbook with the new application code or configuration and then run the 'deploy' recipe on the stack. This triggers the deployment process on all instances automatically. Option A is incorrect because creating a new CloudFormation stack is not the recommended approach for updating an existing OpsWorks stack; CloudFormation is a different service for infrastructure as code. Option C is incorrect because the OpsWorks built-in 'deploy' command is meant for straightforward deployments and may not support custom cookbooks or complex application logic. Option D is incorrect because manually SSH-ing into each instance is not scalable and defeats the purpose of automation.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
Create a new CloudFormation stack to replace the OpsWorks stack.
Why it's wrong here
AWS CloudFormation is an infrastructure-as-code service used to provision and manage AWS resources declaratively, not a tool for applying application updates to existing OpsWorks-managed instances. Creating a new CloudFormation stack to replace an existing OpsWorks stack would require tearing down and rebuilding the entire environment, causing downtime and risking data loss or misconfiguration of dependent resources like load balancers or databases. Even if you used CloudFormation to manage the OpsWorks stack itself, you would still need to update the custom cookbook and trigger a deploy lifecycle event—so replacing the stack is an unnecessarily destructive and indirect approach.
- ✓
Update the custom cookbook and run the 'deploy' recipe on the stack.
Why this is correct
Updating the custom cookbook source (e.g., S3, Git, or HTTP) on the OpsWorks stack and then running the 'deploy' lifecycle recipe is the correct and intended method for rolling out application changes. The deploy recipe triggers a stack-wide command that executes your custom Chef recipes on all online instances in the selected layer or stack, following the defined deployment lifecycle (before_deploy, deploy, after_deploy). This ensures all instances receive the same application update in a coordinated, automated fashion, and because OpsWorks uses Chef, the recipe can handle dependencies, configuration templates, and service restarts consistently across the fleet.
- ✗
Use the OpsWorks built-in 'deploy' command on each instance.
Why it's wrong here
The OpsWorks built-in 'deploy' command executes only the default deploy recipe that AWS provides, which performs a simple checkout or copy of application files from a repository. It does not run your custom cookbook recipes or honor custom application logic such as database migrations, cache clears, or service restarts that you have defined in your own deploy recipe. Running it manually per instance also bypasses OpsWorks' orchestrated deployment lifecycle hooks (before_deploy, after_deploy) and requires repeated one-off commands, making it unsuitable for managing a fleet with complex deployment requirements.
- ✗
SSH into each instance and manually update the application files.
Why it's wrong here
Manually SSHing into each EC2 instance to update application files is an anti-pattern for configuration management because it is not scalable, auditable, or repeatable. It introduces configuration drift across instances, and any newly launched instance (e.g., via auto-scaling) would not receive the manual changes, leading to inconsistent runtime environments. Additionally, it bypasses OpsWorks' centralized deployment event system, so custom cookbook dependencies, file permissions, and service restarts would not be applied uniformly, and you lose the ability to roll back or track changes systematically.
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 →
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 uses AWS OpsWorks for configuration management. The SysOps administrator needs to deploy a new application version to existing EC2 instances managed by OpsWorks. Which OpsWorks lifecycle event should the administrator trigger to install the new application?
medium- A.Configure
- ✓ B.Deploy
- C.Shutdown
- D.Setup
Why B: The 'Deploy' lifecycle event is specifically designed for deploying applications. Option B (Deploy) is correct because it triggers the deploy recipes to install the new application version. Option A (Configure) is incorrect because it runs when instances come online or leave the stack, not for application deployment. Option C (Shutdown) is incorrect because it runs when an instance is terminated. Option D (Setup) is incorrect because it runs only once when the instance is first booted, not for ongoing deployments.
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.