mapbox / mapbox/cfn-config

cfn.getTemplate may return YAML instead of JSON

Open
#196 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
53
Forks
16
PR merge metrics
No merged PRs in 30d

Description

It appears that cfn.getTemplate may return JSON or YAML, but L126 in lookup.js presumes that it is necessarily JSON. I am trying to deploy a particular stack, but the content is YAML and so it throws an error when parsed as JSON. I'm not sure what dictates which the content is, or if there's a way to determine which it is, except to try one and then try the other if that fails.

https://github.com/mapbox/cfn-config/blob/2c6b4b09768e3d85bfe8689eb136d1dbd0c9865b/lib/lookup.js#L126

See: https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/template-anatomy.html

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at lib/lookup.js line 126 and inspect how cfn.getTemplate output is parsed. Read the linked AWS CloudFormation template documentation to determine the possible template formats. Done means templates returned as YAML as well as JSON no longer trigger the reported JSON parsing error.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, javascript
Domain
cloud
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.