You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rain currently strips quotes from string values even when doing so changes the data type in CloudFormation. YAML treats certain unquoted words (ON, OFF, YES, NO, etc.) as booleans, but CloudFormation expects them as strings in certain parameters (e.g., when requiring SSL/TLS for all connections to a MySQL DB instance on Amazon RDS). This behavior leads to unintended type mismatches and deployment failures.
Running rain fmt or deploying via Rain strips the quotes:
Parameters:
require_secure_transport: ON
This causes CloudFormation to interpret ON as a boolean (true) instead of a string ("ON"), resulting in deployment issues.
Why This is a Bug
Stripping Quotes Here Alters the Meaning of the Data
Unlike normal YAML formatting, this is not just a stylistic change; it transforms a string into a boolean.
Unexpected and Subtle Behavior
This issue is difficult to debug because it happens at formatting time, and CloudFormation does not clearly indicate that the type changed due to YAML parsing.
Existing Workarounds are Insufficient
--node-style original is not a viable fix because:
It affects the entire template, not just the problematic values.
It prevents Rain from formatting other parts of the template where quotes should be stripped.
It is an opt-in fix rather than a default behavior correction.
Suggested Fix
Rain should preserve quotes around string values that match YAML’s boolean-like keywords (ON, OFF, YES, NO, TRUE, FALSE, etc.) to prevent unintentional type changes. This would ensure that templates maintain their intended behavior without requiring a global formatting override.
Rain currently strips quotes from string values even when doing so changes the data type in CloudFormation. YAML treats certain unquoted words (
ON
,OFF
,YES
,NO
, etc.) as booleans, but CloudFormation expects them as strings in certain parameters (e.g., when requiring SSL/TLS for all connections to a MySQL DB instance on Amazon RDS). This behavior leads to unintended type mismatches and deployment failures.Reproduction Steps
Given the following CloudFormation template:
Running
rain fmt
or deploying via Rain strips the quotes:This causes CloudFormation to interpret
ON
as a boolean (true
) instead of a string ("ON"
), resulting in deployment issues.Why This is a Bug
Stripping Quotes Here Alters the Meaning of the Data
Unexpected and Subtle Behavior
Existing Workarounds are Insufficient
--node-style original
is not a viable fix because:Suggested Fix
Rain should preserve quotes around string values that match YAML’s boolean-like keywords (
ON
,OFF
,YES
,NO
,TRUE
,FALSE
, etc.) to prevent unintentional type changes. This would ensure that templates maintain their intended behavior without requiring a global formatting override.Related issue #480
PR that fixes the issue #654
The text was updated successfully, but these errors were encountered: