CFN template in yaml or json format
See original GitHub issueNote: 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:
- Created 4 years ago
- Reactions:17
- Comments:13 (6 by maintainers)
Still not working entirely on Amplify 4.29. Works with push, not with publish:
I have a
template.yaml
, buttemplate.yml
doesn’t work either.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 runcfn-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!