Conditions

The Conditions Section for Conditional Resources

A condition is a named boolean built from parameters with Fn::Equals, Fn::And, Fn::Or and Fn::Not, and evaluated once, before any resource is touched. You use it in three places: as a resource's Condition attribute, so the resource exists only when it is true; inside Fn::If, to choose a property value; and on an output.

infra/booknest-data.yaml: the Conditions sectionYAML
Conditions:
  IsProd: !Equals [!Ref Stage, prod]

The next slice uses IsProd both ways: an access-log group that exists only in production, and provisioned throughput that is set only in production. The pseudo parameter AWS 24 ::NoValue in the second branch of Fn::If removes the property altogether, which is different from setting it to an empty value.