Question 1,462 of 256
OpsWorks IAM Instance Profile Permissions
A DevOps engineer is troubleshooting an AWS OpsWorks for Chef Automate deployment. The Chef server is configured with a custom run list that includes a recipe to install and configure an application. The test environment works correctly, but in the production environment, the application fails to start. The Chef client logs show that the recipe executed successfully, but the application process is not running. What is the most likely cause of this issue?
Quick Answer
The answer is the IAM instance profile attached to the production EC2 instance lacks the necessary permissions to start the application service. This is because OpsWorks IAM instance profile permissions govern which AWS API calls the instance can make, and if the profile is missing permissions for service startup actions—such as `ec2:StartInstances` or access to a Secrets Manager secret—the Chef recipe’s service resource may report success in the logs while the underlying systemd or init daemon silently fails to launch the process. On the AWS Certified DevOps Engineer Professional DOP-C02 exam, this scenario tests your understanding that Chef client logs only confirm recipe execution, not the outcome of external API calls or service management; a common trap is assuming a successful recipe run guarantees the application is running. To remember this, think “logs lie, permissions prove”—always verify the instance profile’s policy allows the specific actions the recipe’s service resource requires.
⚠ Common exam trap
Candidates often assume a successful Chef client run guarantees the application is running, but the exam tests the distinction between recipe execution success and the actual outcome of system commands that depend on IAM permissions.
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
✓
The IAM instance profile attached to the production EC2 instance does not have the necessary permissions to start the application service.
The IAM instance profile determines the AWS API permissions available to the EC2 instance. If the profile lacks permissions to call the service startup API (e.g., `ec2:StartInstances` or `autoscaling:CompleteLifecycleAction`), or to access required resources like an EFS mount target or Secrets Manager secret, the Chef recipe's service resource may execute without error but the underlying systemd or init daemon cannot actually start the application process. The Chef client logs only show recipe execution success, not the outcome of the service start, so the application fails silently.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
The OpsWorks stack is configured to use 'auto-healing' which automatically terminates and replaces instances that fail to start the application.
Why it's wrong here
Auto-healing replaces instances after failure, but the issue is that the recipe succeeded but the app didn't start.
- ✗
The Chef server in production is running a different version of Chef than the test environment, causing the recipe to behave differently.
Why it's wrong here
Chef versions are compatible within minor versions; differences would cause syntax errors, not silent failures.
- ✓
The IAM instance profile attached to the production EC2 instance does not have the necessary permissions to start the application service.
Why this is correct
The instance profile must allow actions like ec2:StartInstances or ssm:StartAutomationExecution if the recipe uses those, or the application may need permissions to access resources.
- ✗
The Chef recipe does not include a 'service' resource to start the application; it only installs the package.
Why it's wrong here
The problem states the recipe includes steps to install and configure the application; if it didn't include a start command, the logs would not show success.
About these practice questions
Courseiva creates original exam-style practice questions with explanations and wrong-answer analysis. It does not publish real exam questions, 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 DOP-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 Chef Automate. They have a stack that includes a PHP application layer. The application requires a custom PHP configuration file. The DevOps engineer creates a custom Chef cookbook with a recipe that deploys the configuration file. The recipe is assigned to the layer's Setup lifecycle event. The engineer notices that the configuration file is not being created on new instances when they are added to the layer. The cookbook is stored in a private S3 bucket. The engineer has verified that the cookbook is correctly associated with the stack. What should the engineer do to fix the issue?
medium- A.Assign the recipe to the Configure lifecycle event instead of Setup
- B.Verify that the recipe is included in the cookbook's default.rb file
- C.Update the cookbook version to the latest
- ✓ D.Ensure that the instance profile has permissions to read from the S3 bucket where the cookbook is stored
Why D: The issue is that the custom cookbook is stored in a private S3 bucket. For new instances to access the cookbook during the Setup lifecycle event, the instance must have the necessary IAM permissions to read from that S3 bucket. The instance profile attached to the OpsWorks stack's instances must include a policy that grants s3:GetObject for the cookbook's S3 bucket. Without these permissions, the instance cannot download the cookbook, so the recipe never runs. Therefore, the engineer should ensure that the instance profile has permissions to read from the S3 bucket. Option A is incorrect because the Setup lifecycle event is appropriate for deploying configuration files when the instance is being set up; moving to Configure would run later and might not achieve the same result. Option B is incorrect because the issue is not about the recipe being in default.rb; the cookbook is correctly associated, and the recipe is assigned to the layer lifecycle event directly, not necessarily via default.rb. Option C is incorrect because updating the cookbook version would not address the access permissions issue.
Last reviewed: Jun 24, 2026
This DOP-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 DOP-C02 exam.
Question Discussion
Share a tip, memory trick, or ask about the reasoning behind this question. Do not post real exam questions, leaked content, braindumps, or copyrighted exam material. Comments are moderated and may be removed without notice.
Sign in to join the discussion.