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 deploy: show outputs descriptions in --outputs-file output #33364

Open
2 tasks
saste opened this issue Feb 10, 2025 · 2 comments
Open
2 tasks

cdk deploy: show outputs descriptions in --outputs-file output #33364

saste opened this issue Feb 10, 2025 · 2 comments
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation @aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI feature-request A feature should be added or improved. p3

Comments

@saste
Copy link

saste commented Feb 10, 2025

Describe the feature

Currently, the cdk deploy --outputs-file outputs.json option enables writing the generated outputs to a file, in the format:

{ STACK_NAME: { KEY: VALUE } }

The information related to the description of the stack outputs items is lost.

It would be useful to keep this information, for example to auto-generate an UI starting from the outputs.

To do this, I suggest to extend the interface with another option, for example cdk deploy --outputs-file outputs.json --outputs-file-with-descriptions, generating the format:

{ STACK_NAME: [ {"key": KEY, "value": VALUE, "description": DESCRIPTION} ] }

In other words, each stack should contain a list of dictionaries with the key/value/description fields.

Currently it is not possible to get the description information, if not looking up in the cloudformation.

Use Case

The description field would be useful to convey the information of each output items in a human readable format.

For example you might use it to auto-generate a UI (either textual or graphical).

Currently it is possible to achieve this by querying cloudformation, but this implies more operations while this information should be already available when the outputs file is generated in the first place.

Proposed Solution

I suggest to extend the cdk deploy CLI with some new option.

It might either be:

cdk deploy --outputs-file outputs.json --outputs-file-with-descriptions

or:

cdk deploy --outputs-file outputs.json --outputs-file-mode include-descriptions

probably the latter being more extensible.

Other Information

No response

Acknowledgements

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

CDK version used

2.178

Environment details (OS name and version, etc.)

not relevant since it is OS independent

@saste saste added feature-request A feature should be added or improved. needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@github-actions github-actions bot added the @aws-cdk/aws-cloudformation Related to AWS CloudFormation label Feb 10, 2025
@pahud
Copy link
Contributor

pahud commented Feb 10, 2025

Looks like adding the description won't be a breaking change. I am not sure if it's necessary to have an additional flag just for the description. Bringing this up to the team for a very quick input here.

@pahud pahud added p3 @aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI and removed needs-triage This issue or PR still needs to be triaged. labels Feb 10, 2025
@saste
Copy link
Author

saste commented Feb 12, 2025

Looks like adding the description won't be a breaking change. I am not sure if it's necessary to have an additional flag just for the description. Bringing this up to the team for a very quick input here.

But probably there are already people parsing the outputs.json file, and expecting the STACK_KEY: { OUTPUT_KEY: OUTPUT_VALUE} format. That's why another switch specifying the format is needed or that would break that assumption.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
@aws-cdk/aws-cloudformation Related to AWS CloudFormation @aws-cdk/core Related to core CDK functionality cli Issues related to the CDK CLI feature-request A feature should be added or improved. p3
Projects
None yet
Development

No branches or pull requests

2 participants