-
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
Long strings/refs incorrectly split over newlines causing broken user-data/etc #1309
Comments
How are you deploying this? Through the toolkit or by synthesizing a YAML output and then deploying via some other tool? I am wondering if the issue is our YAML formatter? |
Through the toolkit itself. I was only synthesising to try and debug the problem.
It seems it’s happening when I am using template strings (possibly also with string/variable concatenation), but I was able to work around it directly using cdk.FnJoin (see the UserData code on linked PR)
Get Outlook for iOS<https://aka.ms/o0ukef>
…________________________________
From: Elad Ben-Israel <[email protected]>
Sent: Sunday, December 9, 2018 8:52 pm
To: awslabs/aws-cdk
Cc: 0xdevalias; Author
Subject: Re: [awslabs/aws-cdk] Long strings/refs incorrectly split over newlines causing broken user-data/etc (#1309)
How are you deploying this? Through the toolkit or by synthesizing a YAML output and then deploying via some other tool? I am wondering if the issue is our YAML formatter?
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub<#1309 (comment)>, or mute the thread<https://github.com/notifications/unsubscribe-auth/AAuA4xzRtIvJM-91kdjNNLZ_Lc02zdC9ks5u3N1PgaJpZM4ZJ6xA>.
|
Okay, ran a few tests. It seems like the root cause is the way our YAML formatter renders the multiline value. I reproduced the issue with YAML output and successfully deployed with JSON. Also, when I shortened the lines (by changing the logical ID of the launch configuration), the YAML template also worked (which I suspect is what happens in your FnJoin case). @RomainMuller what do you think? This YAML output is giving us too much headache. Feels like a cat and mouse. Should we just support JSON in the toolkit and let people generate their own YAML at their own risk? Is there a configuration where our YAML output is "stupid" and doesn't do crazy things like splitting multiline outputs? (couldn't find it). |
The maintainer of this YAML was very responsive last time around and had a patch out the next day. We can also take this to them. |
But in the mean time, yeah, no reason not to use JSON internally I suppose. It's not for human consumption anyway. |
If we allow users to synthesize YAML, then it should work. It would be an awful experience if “cdk deploy” worked and “cdk synth” didn’t. Happy to continue to try make YAML work, but I am concerned... |
As far as I can tell the issue is because of the
quoting, as opposed to
|
Reported here: eemeli/yaml#55 |
This should be fixed by the just-released version 1.1.0 of |
@eemeli thanks for the amazingly quick turnaround! |
Fix the issue where incorrect UserData was generated by updating to a newer version of the yaml library. Fixes #1309.
When I am building strings to use in my user-data/etc, CDK seems to incorrectly insert newlines (at long lines?), causing scripts to break.
Relevant Snippets from code:
When synthesized, this ends up like:
Which ends up in the end user-data as:
Note how the
install
parameter ends up on a new line, when it shouldn't, which then breaks things.This is also happening in my
AWS::CloudFormation::Init
Metadata
override, breaking my/etc/cfn/cfn-hup.conf
config.The text was updated successfully, but these errors were encountered: