Skip to content

Commit

Permalink
feat(cli): show stack progress info in cdk deploy/destroy commands (a…
Browse files Browse the repository at this point in the history
…ws#22883)

closes aws#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*
  • Loading branch information
AlexGurtoff authored and Brennan Ho committed Jan 20, 2023
1 parent e131ef5 commit b0585f4
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/aws-cdk/lib/cdk-toolkit.ts
Expand Up @@ -251,7 +251,8 @@ export class CdkToolkit {
}
}

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

let tags = options.tags;
Expand Down Expand Up @@ -527,8 +528,8 @@ export class CdkToolkit {
}

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

0 comments on commit b0585f4

Please sign in to comment.