DOP-C02 Practice Question 83: CloudFormation Hooks Proactive Controls
AWS Certified DevOps Engineer – Professional (DOP-C02) · Test 9 · question 3 of 10
A platform team wants to stop noncompliant infrastructure before it is ever created, not clean it up afterward. Specifically, whenever any team in the organization submits a CloudFormation create or update operation that would provision an unencrypted EBS volume, the operation itself must fail immediately with the resource never being provisioned at all, across every account in the organization. Config rules and Security Hub controls are already in place but only detect violations after resources exist. What should the team implement?
Show answer and explanation
Answer:
CloudFormation Hooks run proactive code against a resource's configuration before it is provisioned; when a hook's invocation point fails, CloudFormation stops the stack operation and the noncompliant resource is never created, which matches the "fail before provisioning" requirement, and Control Tower's proactive controls layer is built specifically on hooks to enforce this across every account. A is wrong because Config remediation is inherently reactive: the resource is created first and only cleaned up afterward, which the scenario explicitly rules out. C would also work in isolation, but an SCP denies at the IAM authorization layer regardless of the deployment tool and is a much blunter, harder-to-target instrument than a hook when the requirement is specifically about CloudFormation-driven provisioning with detailed evaluation logic; it is a plausible but less precise fit than a hook built for exactly this use case. D is wrong because an EventBridge-triggered Lambda also reacts after the CreateVolume API call has already succeeded, so the volume exists (even if briefly) before any action is taken.
Reference: Proactively keep resources secure and compliant with AWS CloudFormation Hooks