aws-toolkit-vscode icon indicating copy to clipboard operation
aws-toolkit-vscode copied to clipboard

Lambda Deploy automatically creates a new version and no option to disable that

Open surjithctly opened this issue 1 month ago • 3 comments

Problem

When deploying modified Lambda code, it automatically creates a new version in the console and there is no option to disable that feature. I want the deploy to change $latest only. not create new version each time.

Image

Steps to reproduce the issue

  1. download a lambda fn
  2. make some changes
  3. click deploy on the auto-prompted dialog
  4. visit aws lambda functions -> versions
  5. you can see a new version is created

Expected behavior

  1. it should not create new version until I manually specified
  2. should only make changes to $latest only.

System details (run AWS: About and/or Amazon Q: About)

OS: Darwin arm64 24.6.0 Visual Studio Code extension host: 1.106.1 AWS Toolkit: 3.88.0 node: 22.20.0 electron: 37.7.0

surjithctly avatar Nov 27 '25 14:11 surjithctly

Can you provide more information about the Lambda function? do you have the function in a template? Is the quick edit and quick deploy?

vicheey avatar Dec 05 '25 00:12 vicheey

I can confirm that this is creating new versions each time. This is because the Publish flag is set on each iteration of UpdateFunctionCode:

https://github.com/aws/aws-toolkit-vscode/blob/40ba183dc8a243438c62701f2d13a7a2c22dd7fa/packages/core/src/shared/clients/lambdaClient.ts#L178-L181

Let me confirm if this is intentional or not.

reedham-aws avatar Dec 05 '25 01:12 reedham-aws

@vicheey this is just a normal lambda function, no templates. I opened in a workspace and made the edit and clicked deploy on the auto-popup which appeared.

Image

surjithctly avatar Dec 05 '25 05:12 surjithctly