Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

String type characters are converted to Boolean type characters #480

Closed
yu40ta opened this issue Aug 2, 2024 · 3 comments
Closed

String type characters are converted to Boolean type characters #480

yu40ta opened this issue Aug 2, 2024 · 3 comments

Comments

@yu40ta
Copy link

yu40ta commented Aug 2, 2024

I am experiencing a phenomenon where source code that is recognized as "String" when deployed in the CloudFormation console is mistakenly converted to "Boolean" when deployed by rain.

For example, the following source code.

  EC2StopSchedule:
    Type: AWS::Scheduler::Schedule
    Properties:
      Name: ec2-auto-stop
      Description: "Scheduler to auto stop EC2 instances"
      ScheduleExpression: "cron(0 19 * * ? *)"
      ScheduleExpressionTimezone: Asia/Tokyo
      FlexibleTimeWindow:
        Mode: "OFF" # this
      State: ENABLED

Below I paste a capture of the execution result in console and in rain.

console

image

rain

image

Is this the expected behavior?
It appears that the double quotes have been removed for other properties except the FlexibleTimeWindow property too. (ex: Description property)
Unless this problem is resolved, templates that specify parameters with strings that can be Boolean will not be deployable.

@ericzbeard
Copy link
Contributor

YAML doesn't require strings to be quoted. This might be related to #316, #319, and #329.

#329 added this:

To maintain original double quotes around values that require them, you can now add --node-style original to the deploy, pkg, and fmt commands.

@richard-grainger-veeva
Copy link

richard-grainger-veeva commented Mar 3, 2025

@ericzbeard The issue is more subtle. If stripping quotes from a string like "ON" transforms it into a YAML boolean, I don't think Rain should strip them, even if it would normally do so. Changing a data type is certainly unexpected behaviour I would suggest.

@leinardi
Copy link
Contributor

leinardi commented Mar 5, 2025

@yu40ta this issue was fixed with #654

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants