Skip to content

AutoPublishAlias is not triggered for environment variable changes #1305

Closed
@to-mc

Description

@to-mc

Description:

Changing or adding/removing environment variables for a function does not cause a new version to be published when using AutoPublishAlias.

Steps to reproduce the issue:

  1. Deploy a SAM template with an AWS::Serverless::Function resource, with AutoPublishAlias set, and including an environment variable:
HelloWorldFunction:
    Type: AWS::Serverless::Function
    Properties:
      CodeUri: hello_world/
      Handler: app.lambda_handler
      Runtime: python3.8
      AutoPublishAlias: live
      Environment:
        Variables:
          TestKey: TestVal1
  1. Change TestVal1 to TestVal2.
  2. Run sam deploy .

Observed result:
The lambda function is updated with the new environment variable, but no new version is published, and the defined alias still points to the last published version.

Expected result:
A new function version is published, and the defined alias is updated to point to it.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions