Lambda Deploy automatically creates a new version and no option to disable that
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.
Steps to reproduce the issue
- download a lambda fn
- make some changes
- click deploy on the auto-prompted dialog
- visit aws lambda functions -> versions
- you can see a new version is created
Expected behavior
- it should not create new version until I manually specified
- 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
Can you provide more information about the Lambda function? do you have the function in a template? Is the quick edit and quick deploy?
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.
@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.