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

Output YAML format template to cdk.out #6461

Closed
2 tasks
hiraken-w opened this issue Feb 26, 2020 · 3 comments
Closed
2 tasks

Output YAML format template to cdk.out #6461

hiraken-w opened this issue Feb 26, 2020 · 3 comments
Assignees
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI

Comments

@hiraken-w
Copy link

Currently, JSON format XXX.template.json is output to cdk.out directory.
I want to be able to change the format of this file to YAML format.

Use Case

To change to a format that is easy for humans to understand.

I know the command "cdk synth" can output template as YAML format.
But I want to be able to select YAML and JSON for the file format of the template in cdk.out.

  • 👋 I may be able to implement this feature request
  • ⚠️ This feature might incur a breaking change

This is a 🚀 Feature Request

@hiraken-w hiraken-w added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 26, 2020
@SomayaB SomayaB added the package/tools Related to AWS CDK Tools or CLI label Feb 27, 2020
@shivlaks shivlaks added the effort/medium Medium work item – several days of effort label May 18, 2020
@shivlaks
Copy link
Contributor

@hiraken-w - I believe this request is something that was raised in #2965

as mentioned in this comment

This is not something we will likely support. cdk.out is designed to be machine-readable and there is value in keeping it "agnostic" of visual representation. YAML is not an ideal format for that.
It should trivial to convert the templates from cdk.out to YAML using any standard tool if you desire to review them as YAML.

I'm closing this so we can keep the related conversation in #2965
Please continue the conversation there.

Cheers!

@navjyotnishant
Copy link

you can always out yaml

cdk synth > //template.yaml

@karanthakkaredwards
Copy link

Came here to point out that depending on the use case, the above solution may not work. Found that out the annoying way, had a pre-commit hook that did cdk synth > cft.yaml then ran checkov scan on the yaml. Worked fine initially then realized that it only works with a single stack and for multiple stacks you'd have to specify stack name in the command if you want to get output in cft.yaml

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
effort/medium Medium work item – several days of effort feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

5 participants