Skip to content

Commit 62c82d7

Browse files
authored
feat(cli): show stack progress info in cdk deploy/destroy commands (#22883)
closes #22879 ---- ### All Submissions: * [x] Have you followed the guidelines in our [Contributing guide?](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md) ### Adding new Unconventional Dependencies: * [ ] This PR adds new unconventional dependencies following the process described [here](https://github.com/aws/aws-cdk/blob/main/CONTRIBUTING.md/#adding-new-unconventional-dependencies) ### New Features * [ ] Have you added the new feature to an [integration test](https://github.com/aws/aws-cdk/blob/main/INTEGRATION_TESTS.md)? * [ ] Did you use `yarn integ` to deploy the infrastructure and generate the snapshot (i.e. `yarn integ` without `--dry-run`)? *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent fe08aa9 commit 62c82d7

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

packages/aws-cdk/lib/cdk-toolkit.ts

+4-3
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,8 @@ export class CdkToolkit {
251251
}
252252
}
253253

254-
print('%s: deploying...', chalk.bold(stack.displayName));
254+
const stackIndex = stacks.indexOf(stack)+1;
255+
print('%s: deploying... [%s/%s]', chalk.bold(stack.displayName), stackIndex, stackCollection.stackCount);
255256
const startDeployTime = new Date().getTime();
256257

257258
let tags = options.tags;
@@ -527,8 +528,8 @@ export class CdkToolkit {
527528
}
528529

529530
const action = options.fromDeploy ? 'deploy' : 'destroy';
530-
for (const stack of stacks.stackArtifacts) {
531-
success('%s: destroying...', chalk.blue(stack.displayName));
531+
for (const [index, stack] of stacks.stackArtifacts.entries()) {
532+
success('%s: destroying... [%s/%s]', chalk.blue(stack.displayName), index+1, stacks.stackCount);
532533
try {
533534
await this.props.cloudFormation.destroyStack({
534535
stack,

0 commit comments

Comments
 (0)