Which mechanism can reject noncompliant resources before CloudFormation provisions them, including deployments from hand-written templates?
Show the answer
Correct answerC. A CloudFormation Hook configured to fail
AWhy not this: CDK aspects operate on CDK construct trees and do not validate hand-written templates deployed directly through CloudFormation.
BWhy not this: Periodic Config evaluation assesses resource compliance after provisioning rather than blocking CloudFormation provisioning.
CWhy this is right: A Hook can validate resource properties before provisioning and block the operation when configured to fail.
DWhy not this: Drift detection identifies differences between deployed resources and stack definitions; it does not enforce pre-provisioning policy.
A CloudFormation Hook configured to fail can block provisioning when resource properties violate policy. CDK aspects validate CDK construct trees during synthesis and do not cover deployments from hand-written templates.