diff --git a/packages/core/src/shared/sam/deploy.ts b/packages/core/src/shared/sam/deploy.ts index 35cb29f95a9..6154e2e3def 100644 --- a/packages/core/src/shared/sam/deploy.ts +++ b/packages/core/src/shared/sam/deploy.ts @@ -377,10 +377,6 @@ export async function runDeploy(arg: any, wizardParams?: DeployParams): Promise< throw ToolkitError.chain(error, 'Failed to build SAM template', { details: { ...buildFlags } }) } - // Pass built template to deployFlags - const templatePath = vscode.Uri.joinPath(params.projectRoot, '.aws-sam', 'build', 'template.yaml').fsPath - deployFlags.push('--template-file', `${templatePath}`) - // Create a child process to run the SAM deploy command const deployProcess = new ChildProcess(samCliPath, ['deploy', ...deployFlags], { spawnOptions: await addTelemetryEnvVar({ diff --git a/packages/core/src/test/shared/sam/deploy.test.ts b/packages/core/src/test/shared/sam/deploy.test.ts index 37d94c4b10d..1da271fbdfb 100644 --- a/packages/core/src/test/shared/sam/deploy.test.ts +++ b/packages/core/src/test/shared/sam/deploy.test.ts @@ -709,8 +709,6 @@ describe('SAM Deploy', () => { '--parameter-overrides', `ParameterKey=SourceBucketName,ParameterValue=${mockDeployParams.SourceBucketName} ` + `ParameterKey=DestinationBucketName,ParameterValue=${mockDeployParams.DestinationBucketName}`, - '--template-file', - vscode.Uri.joinPath(projectRoot, '.aws-sam', 'build', 'template.yaml').fsPath, ], { spawnOptions: { @@ -787,8 +785,6 @@ describe('SAM Deploy', () => { '--parameter-overrides', `ParameterKey=SourceBucketName,ParameterValue=${mockDeployParams.SourceBucketName} ` + `ParameterKey=DestinationBucketName,ParameterValue=${mockDeployParams.DestinationBucketName}`, - '--template-file', - vscode.Uri.joinPath(projectRoot, '.aws-sam', 'build', 'template.yaml').fsPath, ], { spawnOptions: { @@ -867,8 +863,6 @@ describe('SAM Deploy', () => { '--parameter-overrides', `ParameterKey=SourceBucketName,ParameterValue=${mockDeployParams.SourceBucketName} ` + `ParameterKey=DestinationBucketName,ParameterValue=${mockDeployParams.DestinationBucketName}`, - '--template-file', - vscode.Uri.joinPath(projectRoot, '.aws-sam', 'build', 'template.yaml').fsPath, ], { spawnOptions: { diff --git a/packages/core/src/testInteg/sam.test.ts b/packages/core/src/testInteg/sam.test.ts index 5960df8bc20..03d00165e22 100644 --- a/packages/core/src/testInteg/sam.test.ts +++ b/packages/core/src/testInteg/sam.test.ts @@ -883,8 +883,6 @@ describe('SAM Integration Tests', async function () { '--capabilities', 'CAPABILITY_IAM', 'CAPABILITY_NAMED_IAM', - '--template-file', - vscode.Uri.joinPath(mockDeployParams.projectRoot, '.aws-sam', 'build', 'template.yaml').fsPath, ]) // Check that runInTerminal is called with the correct arguments for deploy diff --git a/packages/toolkit/.changes/next-release/Bug Fix-1ade44c5-bd1f-4b8f-a7f3-f2740ebb8097.json b/packages/toolkit/.changes/next-release/Bug Fix-1ade44c5-bd1f-4b8f-a7f3-f2740ebb8097.json new file mode 100644 index 00000000000..366b89443fc --- /dev/null +++ b/packages/toolkit/.changes/next-release/Bug Fix-1ade44c5-bd1f-4b8f-a7f3-f2740ebb8097.json @@ -0,0 +1,4 @@ +{ + "type": "Bug Fix", + "description": "SAM: Save SAM deploy parameters to correct samconfig.toml in project folder" +}