awslabs / sustainability-scanner

MIT No Attribution
107 stars 10 forks source link

Fixed edge case when comparing boolean types with strings #9

Closed Maurits-de-Groot closed 11 months ago

Maurits-de-Groot commented 11 months ago

Fixed edge case when comparing boolean types with strings

Changed == true to in ['true', true] to allow both usage of true and 'true' in CloudFormation templates

Issue #, if available: N/A

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

jyriseiger commented 11 months ago

Would be nice to add test cases which test both string and boolean values. At least in RDS tests I can see only string value.

Maurits-de-Groot commented 11 months ago

Added an example in test_scan.py based out of https://github.com/awslabs/aws-cloudformation-templates/blob/master/aws/services/RDS/RDS_with_DBParameterGroup.yaml