Cfn-python-lint: Leading Whitespace in GetAtt syntax of !Sub not ignored

Created on 24 Jul 2018  路  3Comments  路  Source: aws-cloudformation/cfn-python-lint

cfn-lint version: cfn-lint 0.4.1

Description of issue.

When using the ${} syntax in a sub it doesn't ignore whitespace and throws an error, e.g.

"Resource": {
    "Fn::Sub": "${ AppendNotificationWatchLambdaLogGroup.Arn}*"
}

Will throw the following error:

E1019 String parameter  AppendNotificationWatchLambdaLogGroup.Arn not found in string for Resources/AppendNotificationWatchLambdaRolePolicy/Properties/PolicyDocument/Statement/0/Resource/Fn::Sub

When the whitespace is removed this works perfectly fine in cfn-lint (and always works in CloudFormation).

bug

Most helpful comment

Good point. I will work on a fix for this. Thank you for the issue should have a fix shortly.

All 3 comments

Good point. I will work on a fix for this. Thank you for the issue should have a fix shortly.

Great! Let me know if there is anything I can help with. At a quick glance I wasn't sure where to implement this in the code, so didn't send a PR. If you let me know which part this is implemented in I'm happy to send a PR

I think I got it and I made a few improvements along the way. I think the same issue exists for spaces at the end of the parameter so we do a complete strip (left and right side empty spaces removed).

Was this page helpful?
0 / 5 - 0 ratings