DEV Community

Discussion on: Emulating Fn::StartsWith in CloudFormation

Collapse
 
jacco profile image
Jacco Kulman

Hey there. Was trying to see if it is also possible to construct a Fn::EndsWith. Couldn't work one out because the !Select needs the last item instead of the first. Do you happen to know a similar trick for that?

Collapse
 
bjorg profile image
Steve Bjorg

It might be possible to approximate it if you allow for an upper-bound and you add a magic marker at the end. That way, you could incrementally do an Fn:::Contains operation (similar to Fn::StartsWith) and see if you reach the magic marker by itself.