💾 Archived View for cfdocs.wetterberg.nu › intrinsic-function-reference-condition.gemini captured on 2021-12-04 at 18:04:22. Gemini links have been rewritten to link to archived content
⬅️ Previous capture (2021-12-03)
-=-=-=-=-=-=-
The intrinsic function `Condition` returns the evaluated result of the specified *condition*.
When you are declaring a condition in a template and you need to use another condition in the evaluation, you can use `Condition` to refer to that other condition. This is used when declaring a condition in the Conditions section of the template.
{ "Condition" : "conditionName" }
Syntax for the full function name:
Condition: conditionName
Syntax for the short function name:
!Condition conditionName
`conditionName`
The name of the condition you want to reference.
The boolean result of the condition referenced.
The following snippet is from the `Conditions` section of a template. The `MyAndCondition` condition includes the `SomeOtherCondition` condition:
"MyAndCondition": { "Fn::And": [ {"Fn::Equals": ["sg-mysggroup", {"Ref": "ASecurityGroup"}]}, {"Condition": "SomeOtherCondition"} ] }
MyAndCondition: !And - !Equals ["sg-mysggroup", !Ref "ASecurityGroup"] - !Condition SomeOtherCondition
You cannot use any functions in the `Condition` function. You must specify a string that is a condition name.