-
Notifications
You must be signed in to change notification settings - Fork 4k
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
(aws-ec2): ec2.InitFile.fromObject falsely converts numbers to strings #14100
Comments
I think you are probably right. Calling This would need experimentation though. |
Hey everyone, I just stubbed my toe one this issue installing |
Hey guys, I tested described functionality and could not reproduce the issue with the latest version of cdk (commit 715158f). Decided to update appropriate unit and integration tests for ec2.InitFile.fromObject to cover int, bool, number types as well as string. @matthias-pichler-warrify, if you still facing this issue, could you please mention your aws-cdk version? Link to PR: #21394 |
…es (#21394) Issue link: #14100 I tested described functionality and could not reproduce it with the latest version of cdk (commit 715158f). Decided to update appropriate unit and integration tests for ec2.InitFile.fromObject to cover int, bool, number types as well as string. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
|
…es (aws#21394) Issue link: aws#14100 I tested described functionality and could not reproduce it with the latest version of cdk (commit 715158f). Decided to update appropriate unit and integration tests for ec2.InitFile.fromObject to cover int, bool, number types as well as string. ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
When creating the config file for the
amazon-cloudwatch-agent
usingec2.InitFile.fromObject
with the below config file the startup fails with the following error:And when reading the file on disk I get:
Notice how
metrics_collection_interval
is now a string as opposed to number in the actual code.Reproduction Steps
Use
ec2.InitFile.fromObject
with a file that contains a number and observe how it is written to disk with a string instead.What did you expect to happen?
Types of JSON objects should be preserved, it might be required to simply perform a
JSON.stringify
insideec2.InitFile.fromObject
and pass it through toec2.InitFile.fromString
What actually happened?
I think the culprit might be
cfn-init
here which turns all values into strings 🤷Environment
Other
This is 🐛 Bug Report
The text was updated successfully, but these errors were encountered: