question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

CFN template in yaml or json format

See original GitHub issue

Note: If your feature-request is regarding the AWS Amplify Console service, please log it in the official AWS Amplify Console forum

Is your feature request related to a problem? Please describe. I like to use yaml whenever possible. Its shorter to write and easier on the eyes.

Describe the solution you’d like I would like for the CLI so support the yaml format, particularly for the cloudfront hosting. The yaml templates work up to a point, like I can update the cloudfront with it, but when it gets to the step where it publishes my react app it fails. It says it cannot find a template.json file, which is true since I have a template.yaml file. The “issue” is on this line: https://github.com/aws-amplify/amplify-cli/blob/master/packages/amplify-category-hosting/lib/S3AndCloudFront/index.js#L120 If you guys could have a file reader that works for both yaml and json that would be great.

Describe alternatives you’ve considered Alternatives would be to go back to JSON, which is what I will do in the meantime. But it would be nice to have this feature, cause you guys say that formats are not enforced: https://github.com/aws-amplify/amplify-cli/issues/1286 (I know its related to Cognito there)

Additional context Add any other context or screenshots about the feature request here.

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:17
  • Comments:13 (6 by maintainers)

github_iconTop GitHub Comments

2reactions
berenddeboercommented, Sep 11, 2020

Still not working entirely on Amplify 4.29. Works with push, not with publish:

Publish started for S3AndCloudFront
File at path: '.../amplify/backend/hosting/S3AndCloudFront/template.json' does not exist

I have a template.yaml, but template.yml doesn’t work either.

2reactions
kevcam4891commented, Sep 10, 2019

Any update on this? Can we use YAML for our custom stacks yet in Amplify?

UPDATE: You can also install cfn-flip (it is an AWS managed utility) to convert YAML to JSON. I keep my YAML files in ./amplify/backend/{category}/{name}/stacks-yaml, and then before I run an amplify push, I run cfn-flip and output all JSON files to the prescribed ./stacks directory. I can see how difficult it would be to incorporate a YAML parser into this project though because there’s a lot of custom operator/logic, and you need JSON to merge all of the custom/boilerplate stacks.

Hope this ultimately gets in there in an automated fashion, but for now, this works!

Read more comments on GitHub >

github_iconTop Results From Across the Web

AWS CloudFormation template formats
You can author AWS CloudFormation templates in JSON or YAML formats. We support all AWS CloudFormation features and functions for both formats, including...
Read more >
Why I use YAML for AWS CloudFormation - Mark Richman
AWS CloudFormation Template Flip is a tool that converts AWS CloudFormation templates between JSON and YAML formats, making use of the YAML ...
Read more >
Converting Yaml cloudformation template to Json
Open your CloudFormation template in template designer. ... a tool that converts AWS CloudFormation templates between JSON and YAML formats, ...
Read more >
Convert Your CloudFormation template from JSON to YAML
YAML and JSON. When CloudFormation launched, JSON was the only format supported. YAML was introduced to CloudFormation in 2016. Both JSON and ...
Read more >
If You're not Using YAML for CloudFormation Templates, You ...
Some configuration in CloudFormation can only be expressed as JSON. Step Functions and some of the AppSync objects in CloudFormation only allow ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found