2 ms·
I get baited into these discussion all the time, but I'll point out that since YAML is as superset of JSON you're free to keep using JSON if you prefer it. But
by mdaniel 4y ago
I get baited into these discussion all the time, but I'll point out that since YAML is as superset of JSON you're free to keep using JSON if you prefer it. But let's just be real that omitting the `"` everywhere is a clearer separation between content and encoding, and then representing multi-line strings is hands-down easier in yaml than JSON
inst:
Type: AWS::EC2::Instance
Properties:
UserData: |
#!/bin/sh
echo "hello, world!"
cat >/root/.ssh/authorized_keys <<FOO
ssh-rsa cafebabedeadbeef
FOO
versus
{
"inst": {
"Type": "AWS::EC2::Instance",
"Properties": {
"UserData": "#!/bin/sh\necho \"hello, world!\"\ncat >/root/.ssh/authorized_keys <<FOO\nssh-rsa cafebabedeadbeef\nFOO\n"
}
}
}