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

fix: wrap quotes around AWS::StackName #1238

Merged
merged 1 commit into from
Oct 18, 2023

Conversation

n-tucker
Copy link
Contributor

@n-tucker n-tucker commented Oct 13, 2023

Purpose 🎯

  • Fixes an error encountered when we attempt to unmarshal the YAML template via our internal tooling
  • After experimentation, I discovered that one I wrapped quotes around AWS::StackName our tooling was able to parse the template successfully

Context 🧠

  • We perform some wrangling of CFN parameters via an internal CLI tool. As part of this process, the tool parses a YAML template to figure out which parameters are required as input
  • Discovered this yaml parsing error when I was attempting to smoke test our upgrade to the v6 elastic stack
  • My best guess is that the yaml unmarshalling process doesn't like :: unless it's quoted and/or escaped? 🤷

Copy link
Contributor

@triarius triarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

My best guess is that the yaml unmarshalling process doesn't like :: unless it's quoted and/or escaped? 🤷

Maybe. I've tried out various parsers, and they DON'T seem to have issues with unquoted :: in a yaml string:
javascript (js-yaml):
https://stackblitz.com/edit/node-qeqetm?file=index.js

ruby:

❯ ruby -ryaml -rjson -e 'puts YAML.safe_load("test: AWS::Stack").to_json'
{"test":"AWS::Stack"}

yq (go)

echo 'test: AWS::Stack' | yq -o json
{
  "test": "AWS::Stack"
}

go (gopkg.in/yaml.v3):
https://goplay.tools/snippet/Mnv_QECRtZB

Can you let us know how you're parsing it? If it's common enough, we can add it to the CI pipeline to prevent future change from reintroducing the same problem elsewhere.

Copy link
Contributor

@triarius triarius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can merge it, and you can get back to us about the tool @n-tucker.

@triarius triarius merged commit 25cdd93 into buildkite:main Oct 18, 2023
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants