You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
### Reason for this change
Existing `cdk list` functionality does not display stack dependencies. This PR introduces that functionality.
For instance,
Existing functionality:
```
❯ cdk list
producer
consumer
```
Feature functionality:
```
❯ cdk list --show-dependencies
- id: producer
dependencies: []
- id: consumer
dependencies:
- id: producer
dependencies: []
```
### Description of changes
Changes are based on internal team design discussions.
* A new flag `--show-dependencies` is being introduced for `list` cli command.
* A new file `list-stacks.ts` is being added.
* Adding `listStacks` function within the file for listing stack and their dependencies using cloud assembly from the cdk toolkit.
### Description of how you validated changes
* Unit and Integration testing
### Checklist
- [x] My code adheres to the [CONTRIBUTING GUIDE](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) and [DESIGN GUIDELINES](https://github.com/aws/aws-cdk/blob/main/docs/DESIGN_GUIDELINES.md)
### Co-Author
Co-authored-by: @SankyRed
-----
> NOTE: We are currently getting it reviewed by UX too so the final display output might change.
----
*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
Copy file name to clipboardExpand all lines: packages/aws-cdk/lib/cli.ts
+3-2
Original file line number
Diff line number
Diff line change
@@ -87,7 +87,8 @@ async function parseCommandLineArguments(args: string[]) {
87
87
.option('no-color',{type: 'boolean',desc: 'Removes colors and other style from console output',default: false})
88
88
.option('ci',{type: 'boolean',desc: 'Force CI detection. If CI=true then logs will be sent to stdout instead of stderr',default: process.env.CI!==undefined})
89
89
.command(['list [STACKS..]','ls [STACKS..]'],'Lists all stacks in the app',(yargs: Argv)=>yargs
90
-
.option('long',{type: 'boolean',default: false,alias: 'l',desc: 'Display environment information for each stack'}),
90
+
.option('long',{type: 'boolean',default: false,alias: 'l',desc: 'Display environment information for each stack'})
91
+
.option('show-dependencies',{type: 'boolean',default: false,alias: 'd',desc: 'Display stack dependency information for each stack'}),
91
92
)
92
93
.command(['synthesize [STACKS..]','synth [STACKS..]'],'Synthesizes and prints the CloudFormation template for this stack',(yargs: Argv)=>yargs
93
94
.option('exclusively',{type: 'boolean',alias: 'e',desc: 'Only synthesize requested stacks, don\'t include dependencies'})
0 commit comments