@@ -74,24 +74,31 @@ export type SkipSynthOptions = {
7474 skipSynth ?: boolean ;
7575} ;
7676
77- export type FetchOutputOptions = SkipSynthOptions & MultipleStackOptions ;
77+ export type SkipProviderLockOptions = {
78+ skipProviderLock ?: boolean ;
79+ } ;
80+
81+ export type FetchOutputOptions = SkipSynthOptions &
82+ SkipProviderLockOptions &
83+ MultipleStackOptions ;
7884
7985export type AutoApproveOptions = {
8086 autoApprove ?: boolean ;
8187} ;
8288
8389export type DiffOptions = SingleStackOptions &
90+ SkipProviderLockOptions &
8491 SkipSynthOptions & {
8592 refreshOnly ?: boolean ;
8693 terraformParallelism ?: number ;
8794 vars ?: string [ ] ;
8895 varFiles ?: string [ ] ;
8996 noColor ?: boolean ;
9097 migrateState ?: boolean ;
91- skipSynth ?: boolean ;
9298 } ;
9399
94100export type MutationOptions = MultipleStackOptions &
101+ SkipProviderLockOptions &
95102 SkipSynthOptions &
96103 AutoApproveOptions & {
97104 refreshOnly ?: boolean ;
@@ -400,7 +407,7 @@ export class CdktfProject {
400407 const stack = this . getStackExecutor (
401408 getSingleStack ( stacks , opts ?. stackName , "diff" ) ,
402409 ) ;
403- await stack . initalizeTerraform ( opts . noColor ) ;
410+ await stack . initalizeTerraform ( opts . noColor , opts . skipProviderLock ) ;
404411
405412 try {
406413 await stack . diff ( opts ) ;
@@ -449,7 +456,10 @@ export class CdktfProject {
449456 ! opts . parallelism || opts . parallelism < 0 ? Infinity : opts . parallelism ;
450457 const allExecutions = [ ] ;
451458
452- await this . initializeStacksToRunInSerial ( opts . noColor ) ;
459+ await this . initializeStacksToRunInSerial (
460+ opts . noColor ,
461+ opts . skipProviderLock ,
462+ ) ;
453463 while ( this . stacksToRun . filter ( ( stack ) => stack . isPending ) . length > 0 ) {
454464 const runningStacks = this . stacksToRun . filter ( ( stack ) => stack . isRunning ) ;
455465 if ( runningStacks . length >= maxParallelRuns ) {
@@ -657,7 +667,7 @@ export class CdktfProject {
657667 this . getStackExecutor ( stack , { } ) ,
658668 ) ;
659669
660- await this . initializeStacksToRunInSerial ( ) ;
670+ await this . initializeStacksToRunInSerial ( undefined , opts . skipProviderLock ) ;
661671 const outputs = await Promise . all (
662672 this . stacksToRun . map ( async ( s ) => {
663673 const output = await s . fetchOutputs ( ) ;
@@ -676,9 +686,10 @@ export class CdktfProject {
676686 // Serially run terraform init to prohibit text file busy errors for the cache files
677687 private async initializeStacksToRunInSerial (
678688 noColor ?: boolean ,
689+ skipProviderLock ?: boolean ,
679690 ) : Promise < void > {
680691 for ( const stack of this . stacksToRun ) {
681- await stack . initalizeTerraform ( noColor ) ;
692+ await stack . initalizeTerraform ( noColor , skipProviderLock ) ;
682693 }
683694 }
684695}
0 commit comments