Skip to content

Commit

Permalink
Merge pull request aws-cloudformation#874 from kddejong/Fix/EqualFunc…
Browse files Browse the repository at this point in the history
…tions

Support more functions in the equals
  • Loading branch information
kddejong authored May 8, 2019
2 parents 7bcb02f + 5ccba05 commit 868b226
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/cfnlint/rules/conditions/Equals.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ def match(self, cfn):
# Build the list of functions
equal_trees = cfn.search_deep_keys('Fn::Equals')

allowed_functions = ['Ref', 'Fn::FindInMap', 'Fn::Sub', 'Fn::Join', 'Fn::Select', 'Fn::Split']

for equal_tree in equal_trees:
equal = equal_tree[-1]
if not isinstance(equal, list):
Expand All @@ -54,7 +56,7 @@ def match(self, cfn):
if isinstance(element, dict):
if len(element) == 1:
for element_key in element.keys():
if element_key not in ['Ref', 'Fn::FindInMap']:
if element_key not in allowed_functions:
message = 'Fn::Equals element must be a string, Ref, or a Fn::FindInMap'
matches.append(RuleMatch(
equal_tree[:-1] + [index, element_key],
Expand Down

0 comments on commit 868b226

Please sign in to comment.