DOP-C02 Practice Question 74: CFN Init CFN Hup Metadata Update

AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 8 · question 4 of 10

Configuration Management and IaChard

A fleet of long-running EC2 instances is configured through AWS::CloudFormation::Init metadata on their launch template's underlying CloudFormation resource: a config set installs a package, writes an application configuration file, and starts a service. A DevOps engineer needs to push a change to that configuration file to every already-running instance by updating the stack, without replacing or rebooting any instance, and without SSH access or a custom Lambda function.

Which combination makes this work?

Select one answer
Show answer and explanation

Answer:

  • C. Ensure cfn-hup is installed and running as a service on each instance with a hook that calls cfn-init on changes to the AWS::CloudFormation::Init metadata, then update the stack with the new configuration content in that metadata

cfn-init only applies metadata at the moment it is invoked, typically once from UserData at launch; it does not watch for later changes on its own. cfn-hup is the companion daemon that polls the CloudFormation metadata for the resource on a schedule, and when it detects a change it runs the actions defined in its hook configuration, most commonly re-running cfn-init. With cfn-hup already running on every instance, updating the stack's AWS::CloudFormation::Init metadata is enough to have each running instance pick up and apply the new configuration file in place, with no replacement and no reboot.

Option A is wrong because UserData runs only when an instance boots (or, for some platforms, only on first boot); changing it in the template does not cause a running instance to re-execute it.

Option B achieves the update only by replacing every instance, which is the opposite of the "without replacing any instance" requirement, and rolling updates apply to Auto Scaling group instance refreshes, not metadata reapplication in place.

Option D describes a mechanism that does not exist; CloudFormation does not push metadata changes into an instance's IMDS, and there is no Immutable metadata attribute that triggers that behavior.

Reference: cfn-hup

Practice Test 8 ›

Study guides for DOP-C02

AWS Service Control Policies Explained: SCPs and DenialsAWS service control policies explained: how SCPs cap permissions, why admins still get access denied, inheritance, deny vs allow lists and the exam traps.
How AI Is Changing Software Jobs: Where to PrepareHow AI is changing software jobs: what history shows, the evidence on junior developers, what Klarna learned, new AI roles and five domains to prepare for.
How AWS Certification Exams Work: Scoring and RenewalHow AWS certification exams work: levels, booking, question types, unscored questions, scaled scores, pass marks, validity and how recertification works.
What Is Amazon RDS? Multi-AZ, Read Replicas and BackupsWhat is Amazon RDS? Engines, Multi-AZ, read replicas, backups, RDS Proxy, Aurora and pricing explained, with the traps that AWS exams set around each one.
Best DevOps certification: AWS, Azure, Google or CKAThe best DevOps certification for your stack: AWS DOP-C02, Azure AZ-400, Google Cloud DevOps Engineer and CKA compared on cost, level and prerequisites.
What Is AWS Lambda? Triggers, Concurrency and Cold StartsWhat is AWS Lambda? How functions run, cold starts, triggers vs event source mappings, concurrency, layers, aliases, pricing and the exam traps.
AWS CloudOps Engineer Associate (SOA-C03) exam guideAWS Certified CloudOps Engineer – Associate (SOA-C03) replaced SysOps Administrator. Format, cost, the five domains, what changed and how to prepare.
Which AWS certification should you get? 2026 roadmapWhich AWS certification to get first, by role and experience, with each exam's status in October 2026, what is changing, and prices in USD and INR.
What Is Amazon EC2? Instances, AMIs, EBS and Auto ScalingAmazon EC2 explained: instances, AMIs, instance types, security groups, EBS, Auto Scaling groups and pricing options, with the traps AWS exams set.
SQS vs SNS vs EventBridge on AWSWhen to use an SQS queue, an SNS topic or an EventBridge bus, plus fan-out, FIFO ordering, visibility timeouts and dead-letter queues for AWS exams.