@@ -491,7 +491,10 @@ function getSyncParamsFromConfig(config: SamConfig) {
491
491
return params
492
492
}
493
493
494
- export async function prepareSyncParams ( arg : vscode . Uri | AWSTreeNodeBase | undefined ) : Promise < Partial < SyncParams > > {
494
+ export async function prepareSyncParams (
495
+ arg : vscode . Uri | AWSTreeNodeBase | undefined ,
496
+ validate ?: boolean
497
+ ) : Promise < Partial < SyncParams > > {
495
498
// Skip creating dependency layers by default for backwards compat
496
499
const baseParams : Partial < SyncParams > = { skipDependencyLayer : true }
497
500
@@ -519,7 +522,7 @@ export async function prepareSyncParams(arg: vscode.Uri | AWSTreeNodeBase | unde
519
522
520
523
const template = {
521
524
uri : arg ,
522
- data : await CloudFormation . load ( arg . fsPath ) ,
525
+ data : await CloudFormation . load ( arg . fsPath , validate ) ,
523
526
}
524
527
525
528
return { ...baseParams , template, projectRoot : getWorkspaceUri ( template ) }
@@ -533,7 +536,11 @@ export type SamSyncResult = {
533
536
}
534
537
535
538
export function registerSync ( ) {
536
- async function runSync ( deployType : SyncParams [ 'deployType' ] , arg ?: unknown ) : Promise < SamSyncResult > {
539
+ async function runSync (
540
+ deployType : SyncParams [ 'deployType' ] ,
541
+ arg ?: unknown ,
542
+ validate ?: boolean
543
+ ) : Promise < SamSyncResult > {
537
544
telemetry . record ( { syncedResources : deployType === 'infra' ? 'AllResources' : 'CodeOnly' } )
538
545
539
546
const connection = Auth . instance . activeConnection
@@ -547,7 +554,10 @@ export function registerSync() {
547
554
548
555
await confirmDevStack ( )
549
556
const registry = await globals . templateRegistry
550
- const params = await new SyncWizard ( { deployType, ...( await prepareSyncParams ( input ) ) } , registry ) . run ( )
557
+ const params = await new SyncWizard (
558
+ { deployType, ...( await prepareSyncParams ( input , validate ) ) } ,
559
+ registry
560
+ ) . run ( )
551
561
if ( params === undefined ) {
552
562
throw new CancellationError ( 'user' )
553
563
}
@@ -567,7 +577,7 @@ export function registerSync() {
567
577
id : 'aws.samcli.sync' ,
568
578
autoconnect : true ,
569
579
} ,
570
- ( arg ?: unknown ) => telemetry . sam_sync . run ( ( ) => runSync ( 'infra' , arg ) )
580
+ ( arg ?: unknown , validate ?: boolean ) => telemetry . sam_sync . run ( ( ) => runSync ( 'infra' , arg , validate ) )
571
581
)
572
582
573
583
const settings = SamCliSettings . instance
@@ -608,11 +618,11 @@ async function confirmDevStack() {
608
618
}
609
619
610
620
const message = `
611
- The SAM CLI will use the AWS Lambda, Amazon API Gateway, and AWS StepFunctions APIs to upload your code without
621
+ The SAM CLI will use the AWS Lambda, Amazon API Gateway, and AWS StepFunctions APIs to upload your code without
612
622
performing a CloudFormation deployment. This will cause drift in your CloudFormation stack.
613
- **The sync command should only be used against a development stack**.
623
+ **The sync command should only be used against a development stack**.
614
624
615
- Confirm that you are synchronizing a development stack.
625
+ Confirm that you are synchronizing a development stack.
616
626
` . trim ( )
617
627
618
628
const okDontShow = "OK, and don't show this again"
0 commit comments