@@ -36,7 +36,7 @@ import type { SDK, SdkProvider, ICloudFormationClient } from '../aws-auth';
3636import type { EnvironmentResources } from '../environment' ;
3737import { CfnEvaluationException } from '../evaluate-cloudformation-template' ;
3838import { HotswapMode , HotswapPropertyOverrides , ICON } from '../hotswap/common' ;
39- import { StackActivityMonitor , type StackActivityProgress } from '../stack-events' ;
39+ import { StackActivityMonitor } from '../stack-events' ;
4040import { StringWithoutPlaceholders } from '../util/placeholders' ;
4141import { type TemplateBodyParameter , makeBodyParameter } from '../util/template-body-parameter' ;
4242
@@ -153,14 +153,6 @@ export interface DeployStackOptions {
153153 */
154154 readonly usePreviousParameters ?: boolean ;
155155
156- /**
157- * Display mode for stack deployment progress.
158- *
159- * @default StackActivityProgress.Bar stack events will be displayed for
160- * the resource currently being deployed.
161- */
162- readonly progress ?: StackActivityProgress ;
163-
164156 /**
165157 * Deploy even if the deployed template is identical to the one we are about to deploy.
166158 * @default false
@@ -612,14 +604,16 @@ class FullCloudFormationDeployment {
612604 }
613605
614606 private async monitorDeployment ( startTime : Date , expectedChanges : number | undefined ) : Promise < SuccessfulDeployStackResult > {
615- const monitor = this . options . quiet
616- ? undefined
617- : StackActivityMonitor . withDefaultPrinter ( this . cfn , this . stackName , this . stackArtifact , {
618- resourcesTotal : expectedChanges ,
619- progress : this . options . progress ,
620- changeSetCreationTime : startTime ,
621- ci : this . options . ci ,
622- } ) . start ( ) ;
607+ const monitor = new StackActivityMonitor ( {
608+ cfn : this . cfn ,
609+ stack : this . stackArtifact ,
610+ stackName : this . stackName ,
611+ resourcesTotal : expectedChanges ,
612+ ioHost : this . ioHost ,
613+ action : this . action ,
614+ changeSetCreationTime : startTime ,
615+ } ) ;
616+ await monitor . start ( ) ;
623617
624618 let finalState = this . cloudFormationStack ;
625619 try {
@@ -631,9 +625,9 @@ class FullCloudFormationDeployment {
631625 }
632626 finalState = successStack ;
633627 } catch ( e : any ) {
634- throw new ToolkitError ( suffixWithErrors ( formatErrorMessage ( e ) , monitor ? .errors ) ) ;
628+ throw new ToolkitError ( suffixWithErrors ( formatErrorMessage ( e ) , monitor . errors ) ) ;
635629 } finally {
636- await monitor ? .stop ( ) ;
630+ await monitor . stop ( ) ;
637631 }
638632 debug ( this . action , format ( 'Stack %s has completed updating' , this . stackName ) ) ;
639633 return {
@@ -696,11 +690,14 @@ export async function destroyStack(options: DestroyStackOptions, { ioHost, actio
696690 if ( ! currentStack . exists ) {
697691 return ;
698692 }
699- const monitor = options . quiet
700- ? undefined
701- : StackActivityMonitor . withDefaultPrinter ( cfn , deployName , options . stack , {
702- ci : options . ci ,
703- } ) . start ( ) ;
693+ const monitor = new StackActivityMonitor ( {
694+ cfn,
695+ stack : options . stack ,
696+ stackName : deployName ,
697+ ioHost,
698+ action,
699+ } ) ;
700+ await monitor . start ( ) ;
704701
705702 try {
706703 await cfn . deleteStack ( { StackName : deployName , RoleARN : options . roleArn } ) ;
@@ -709,7 +706,7 @@ export async function destroyStack(options: DestroyStackOptions, { ioHost, actio
709706 throw new ToolkitError ( `Failed to destroy ${ deployName } : ${ destroyedStack . stackStatus } ` ) ;
710707 }
711708 } catch ( e : any ) {
712- throw new ToolkitError ( suffixWithErrors ( formatErrorMessage ( e ) , monitor ? .errors ) ) ;
709+ throw new ToolkitError ( suffixWithErrors ( formatErrorMessage ( e ) , monitor . errors ) ) ;
713710 } finally {
714711 if ( monitor ) {
715712 await monitor . stop ( ) ;
0 commit comments