Skip to content

bug: While using the CDK a Lambda with a Version is redeploy you get a 'Alias already exists' error #13351

@jostout

Description

@jostout

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

I've included a working example of the issue. In the example it will:

  1. Start the localstack server
  2. Bootstrap the CDK
  3. Deploy the nodejs function with a version (this works fine)
  4. Redeploy the nodejs function with a minor change to the handler. (this will fail)

The output from the example will provide you with all the details of the issue.

2:07:29 AM | UPDATE_FAILED | AWS::Lambda::Alias | FnAliaslive17DB7803 Resource provider operation failed: An error occurred (ResourceConflictException) when calling the CreateAlias operation: Alias already exists: arn:a ws:lambda:us-east-1:000000000000:function:AliasExampleStack-Fn9270CBC0-d1955cf2:live

Expected Behavior

The second deployment should work with the new handler.

How are you starting LocalStack?

With a docker-compose file

Steps To Reproduce

lambda-alias-error.tgz
docker-compose up --build

Environment

- OS:
- LocalStack:
  LocalStack version:
  LocalStack Docker image sha:
  LocalStack build date:
  LocalStack build git hash:

Anything else?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions