AWS CloudFormation Concepts Condition Functions: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 29: Line 29:


  Conditions:
  Conditions:
   CreateLogGroup:
   SomeCondition:
     Fn::Not: [!Equals ['blue', !Ref SomeParameter]]
     Fn::Not: [!Equals ['blue', !Ref SomeParameter]]
Conditions:
  SomeCondition:
    !Not [!Equals ['blue', !Ref SomeParameter]]


=Fn::Or: !Or=
=Fn::Or: !Or=

Revision as of 18:27, 18 April 2019

External

Condition Functions

Internal

Overview

As it is the case for intrinsic functions, condition functions have a full function name, and a short form. For more details see:

Intrinsic Functions - Overview

Fn::If: !If

Fn::If: function can be used to conditionally specify a property.

Fn::If is only supported in the metadata attribute, update policy attribute, and property values in the Resources section and Outputs sections of a template.

Fn::And: !And

Fn::Equals: !Equals

!Equals ['something', !Ref SomethingElse]

Fn::Not: !Not

Conditions:
  SomeCondition:
    Fn::Not: [!Equals ['blue', !Ref SomeParameter]]
Conditions:
  SomeCondition:
   !Not [!Equals ['blue', !Ref SomeParameter]]

Fn::Or: !Or

Expressions

Expressions can use pseudo-parameters, template input parameters and mappings. Expressions are useful when declaring Conditions. Other conditions can be referenced within conditions.