-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
feat(cli): Get StackOutputs in CDK application #8566
Comments
@rcollette I think what you're touching on is the programmatic usage of the CLI which would enable you to easily deploy stacks, write outputs wherever you would want with the instructions you want to share with the user. Right now deploy will finish deploying all the stacks that were specified and the outputs will be written to a file (if specified) and console. The simplest way today would be to read that output file, which would be keyed under your stack name and print it out. Out of curiosity, where would you want to be able to print your instructions out and how do you deploy your stacks today? |
For something like deploying a bastion host, the user would run a CDK application. I am aware of the JSON output, but that requires launching a separate application since, unless I am unaware, there is no callback when the CLI has completed performing a deployment. If there was some application callback method when deployment completes, then I could parse the json file in the same CDK application and write to the console, but it would seem more effective to return the same json data to that callback method, perhaps in a more general context object, allowing other completion data to be added as needed in the future (ex. a model of the stack current state?) |
@shivlaks We would also love some way to hook into a "Post Deploy" step of the CLI. In Serverless Framework this can be done a number of ways or even building a custom plugin that can hook into various steps of the build and deploy process. Our usecase is that we currently have SLS exporting a whitelist of CFN outputs as well as some custom ones stored statically in yaml... to a Having plugin or programmatic access is required (beyond Doing this with SLS looks like this... Doing this with CDK today looks like this... Reallllly would love plugin or programmatic CLI support to wrap CDK is super warm fussy helpers so that frontend devs love CDK too. |
Use Case
I have an output
And I want a simple way where I can console out a message to the user for how to to connect to the bastion host, without having to write another shell script or application that has to parse the output json file.
Proposed Solution
Unfortunately, I am not aware of the internals of the cli, but it would seem like perhaps some form of protected callback method in the Stack or App might be provided.
There is
Stack.resolve()
but the documentation isn't clear as to what scenario it is used for.This is a 🚀 Feature Request
The text was updated successfully, but these errors were encountered: