Testing and Deployment
A team uses one CloudFormation template for development and production. Production requires a monitoring resource that development must omit. How should the developer model this difference?
Show the answer
Correct answerC. Use a Condition to control creation of the resource.
AWhy not this: Mappings supply lookup values; they do not independently determine whether CloudFormation creates a resource.
BWhy not this: Outputs expose stack values; hiding an output does not prevent creation of its resource.
CWhy this is right: A resource's Condition attribute can reference a condition that evaluates whether the environment is production.
DWhy not this: DependsOn controls creation order, not environment-specific inclusion.
A CloudFormation Condition can use an environment parameter to determine whether a resource is created. Mappings provide lookup values but do not independently control resource creation.