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

cdk --help has issues #2848

Closed
Doug-AWS opened this issue Jun 12, 2019 · 10 comments
Closed

cdk --help has issues #2848

Doug-AWS opened this issue Jun 12, 2019 · 10 comments
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI

Comments

@Doug-AWS
Copy link
Contributor

It still states:

--json, -j Use JSON output instead of YAML
[boolean] [default: false]

Which makes no sense as it output JSON anyway. We need a -y (YAML) flag for those who want YAML

It also states:

--app, -a REQUIRED: command-line for executing your app or a cloud
assembly directory (e.g. "node bin/my-app.js") [string]

Which is also incorrect. The example should be "npx ts-node bin/my-app.ts"

Version:

  • Windows
  • TypeScript
  • 0.34.0
@Doug-AWS Doug-AWS added the bug This issue is a bug. label Jun 12, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 17, 2019

Which makes no sense as it output JSON anyway. We need a -y (YAML) flag for those who want YAML

Is that true? I was under the impression we were outputting YAML.

Which is also incorrect. The example should be "npx ts-node bin/my-app.ts"

What it should be is discutable. At the very least it's incorrect to say that the example is incorrect. It's a matter of workflow, preference and tooling.

  • The quoted example is correct for JavaScript apps and some TypeScript workflows.
  • Your example is only correct for some TypeScript workflows.
  • Neither the given nor your example would be correct if the application was a Java app, for example.

@NGL321 NGL321 added the needs-triage This issue or PR still needs to be triaged. label Jun 17, 2019
@mhuebner
Copy link

mhuebner commented Jun 18, 2019

Any ideas on how to set yaml output? Just updated to 0.34.0 and there seems to be no way to use yaml output anymore (already mentioned by @Doug-AWS). Is there a possibility to workaround this issue?

@Doug-AWS
Copy link
Contributor Author

Sorry, I was completely wrong. The cdk commands output YAML by default and you need only use the -j flag to get JSON.

@mhuebner
Copy link

I'm getting Json output only in 0.34.0. No chance to switch to yaml.

@Doug-AWS
Copy link
Contributor Author

Really? Here's the first 4 lines of cdk synth for the code created in the https://docs.aws.amazon.com/cdk/latest/guide/ecs_example.html:

  MyVpcF9F0CA6F:
    Type: AWS::EC2::VPC
    Properties:```

And with the -j flag:

```{
  "Resources": {
    "MyVpcF9F0CA6F": {
      "Type": "AWS::EC2::VPC",```

@mhuebner
Copy link

mhuebner commented Jun 18, 2019

Yes, console output is YML but looking into folder cdk.out only contains json files (./cdk.out/TestStack.template.json).

@Doug-AWS Doug-AWS reopened this Jun 18, 2019
@Doug-AWS
Copy link
Contributor Author

Excellent point. @rix0rrr?

@elexisvenator
Copy link

since 0.34, the yaml seems to be output to console (even when --output is specified) and the output folder always contains json. Previously if --output was specified no stacks were output in console. These are both problems - I would much prefer yaml file outputs, and I don't want to spam my console with stacks everytime I synth.

@NGL321 NGL321 added @aws-cdk/core Related to core CDK functionality package/tools Related to AWS CDK Tools or CLI and removed needs-triage This issue or PR still needs to be triaged. labels Jun 26, 2019
@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 26, 2019

cdk.out should be treated as a CLI-internal directory, and should not be treated as the final output directory.

@rix0rrr
Copy link
Contributor

rix0rrr commented Jun 26, 2019

I'm going to close this issue as the title no longer covers its contents. Please use #2965 to discuss the output of YAML/JSON to output directories.

@rix0rrr rix0rrr closed this as completed Jun 26, 2019
Ricool06 added a commit to Ricool06/aws-cdk that referenced this issue Nov 14, 2019
Ricool06 added a commit to Ricool06/aws-cdk that referenced this issue Nov 14, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/core Related to core CDK functionality bug This issue is a bug. package/tools Related to AWS CDK Tools or CLI
Projects
None yet
Development

No branches or pull requests

5 participants