troposphere icon indicating copy to clipboard operation
troposphere copied to clipboard

Boolean values should not be quoted in output

Open eseglem opened this issue 5 years ago • 5 comments

When outputting to YAML or JSON, boolean values should not have quotes around them. An output file will produce E3012 errors when ran through cfn-lint because of this. See: https://github.com/awslabs/cfn-python-lint/issues/260 for more details on why its not a warning.

Changing the validators.boolean function to return bool values, rather than strings would correct this issue. I can make a PR for this, but I wanted to discuss any possible repercussions first, since all these types would need to be verified.

eseglem avatar Mar 01 '19 16:03 eseglem

this is related https://github.com/cloudtools/troposphere/pull/1136

minhio avatar May 14 '19 23:05 minhio

This is fixed in #1409

benbridts avatar Sep 23 '19 16:09 benbridts

@ikben Is this really fixed with that though? I downloaded the latest version of troposphere but the output json is still using string values for booleans instead of actual booleans: image image

Syntactical01 avatar Jan 22 '20 19:01 Syntactical01

This was fixed via #1409 with the use of adding the environment variable TROPO_REAL_BOOL=true. It was done this way to preserve backward compatibility for existing stacks and will be the default in troposphere 3.0.

markpeek avatar Jan 22 '20 19:01 markpeek

I didn't realize it was implying we need to set that environment variable, and not that troposphere itself set that environment variable. Of course that also made it difficult to find my answer in the documentation since the setting of environment variables are often not shown. Makes sense now.

Syntactical01 avatar Jan 22 '20 19:01 Syntactical01