aws-cloudformation / cloudformation-coverage-roadmap

The AWS CloudFormation Public Coverage Roadmap
https://aws.amazon.com/cloudformation/
Creative Commons Attribution Share Alike 4.0 International
1.1k stars 53 forks source link

Fn::Contains should be a supported Condition (as well as Fn::EachMemberIn, Fn::EachMemberEquals) #1973

Open rigsbyt opened 3 months ago

rigsbyt commented 3 months ago

Name of the resource

Other

Resource name

Fn::Condition intrinsic function

Description

Cloudformation only supports Equals / And / Or / Not as intrisics for Conditions

However there are additional intrinsic functions representing Conditions supported in the Rules section, such as Contains, EachMemberIn, and EachMemberEquals.

Notably, the CDK documentation represents these the same, ie there is no indication of a distinction between conditionAnd vs conditionContains; but if you attempt to use a Contains condition in the Conditions block, you will get an error at changeset creation.

I have a use case where I want to condition resource creation on the presence of a string in a SSM StringList Parameter evaluated at deploy-time. I am currently unable to do this.

My only workaround is leveraging a transform/macro which evaluates and replaces these conditions at macro-time.

Other Details

No response