@@ -74,24 +74,31 @@ export type SkipSynthOptions = {
74
74
skipSynth ?: boolean ;
75
75
} ;
76
76
77
- export type FetchOutputOptions = SkipSynthOptions & MultipleStackOptions ;
77
+ export type SkipProviderLockOptions = {
78
+ skipProviderLock ?: boolean ;
79
+ } ;
80
+
81
+ export type FetchOutputOptions = SkipSynthOptions &
82
+ SkipProviderLockOptions &
83
+ MultipleStackOptions ;
78
84
79
85
export type AutoApproveOptions = {
80
86
autoApprove ?: boolean ;
81
87
} ;
82
88
83
89
export type DiffOptions = SingleStackOptions &
90
+ SkipProviderLockOptions &
84
91
SkipSynthOptions & {
85
92
refreshOnly ?: boolean ;
86
93
terraformParallelism ?: number ;
87
94
vars ?: string [ ] ;
88
95
varFiles ?: string [ ] ;
89
96
noColor ?: boolean ;
90
97
migrateState ?: boolean ;
91
- skipSynth ?: boolean ;
92
98
} ;
93
99
94
100
export type MutationOptions = MultipleStackOptions &
101
+ SkipProviderLockOptions &
95
102
SkipSynthOptions &
96
103
AutoApproveOptions & {
97
104
refreshOnly ?: boolean ;
@@ -400,7 +407,7 @@ export class CdktfProject {
400
407
const stack = this . getStackExecutor (
401
408
getSingleStack ( stacks , opts ?. stackName , "diff" ) ,
402
409
) ;
403
- await stack . initalizeTerraform ( opts . noColor ) ;
410
+ await stack . initalizeTerraform ( opts . noColor , opts . skipProviderLock ) ;
404
411
405
412
try {
406
413
await stack . diff ( opts ) ;
@@ -449,7 +456,10 @@ export class CdktfProject {
449
456
! opts . parallelism || opts . parallelism < 0 ? Infinity : opts . parallelism ;
450
457
const allExecutions = [ ] ;
451
458
452
- await this . initializeStacksToRunInSerial ( opts . noColor ) ;
459
+ await this . initializeStacksToRunInSerial (
460
+ opts . noColor ,
461
+ opts . skipProviderLock ,
462
+ ) ;
453
463
while ( this . stacksToRun . filter ( ( stack ) => stack . isPending ) . length > 0 ) {
454
464
const runningStacks = this . stacksToRun . filter ( ( stack ) => stack . isRunning ) ;
455
465
if ( runningStacks . length >= maxParallelRuns ) {
@@ -657,7 +667,7 @@ export class CdktfProject {
657
667
this . getStackExecutor ( stack , { } ) ,
658
668
) ;
659
669
660
- await this . initializeStacksToRunInSerial ( ) ;
670
+ await this . initializeStacksToRunInSerial ( undefined , opts . skipProviderLock ) ;
661
671
const outputs = await Promise . all (
662
672
this . stacksToRun . map ( async ( s ) => {
663
673
const output = await s . fetchOutputs ( ) ;
@@ -676,9 +686,10 @@ export class CdktfProject {
676
686
// Serially run terraform init to prohibit text file busy errors for the cache files
677
687
private async initializeStacksToRunInSerial (
678
688
noColor ?: boolean ,
689
+ skipProviderLock ?: boolean ,
679
690
) : Promise < void > {
680
691
for ( const stack of this . stacksToRun ) {
681
- await stack . initalizeTerraform ( noColor ) ;
692
+ await stack . initalizeTerraform ( noColor , skipProviderLock ) ;
682
693
}
683
694
}
684
695
}
0 commit comments