aws / aws/aws-cdk

aws-lambda: Migrating from currentVersion.addAlias() to function.addAlias()

Open
#27,884 10 comments 0 reactions 0 assignees View on GitHub
@aws-cdk/aws-lambda documentation effort/small feature-request p2
Dominant language
TypeScript
Stars
12.9k
Forks
4.6k
Avg merge
2d 3h
Merged PRs (30d)
83

Description

### Describe the issue

In the following commit `currentVersion.addAlias()` was deprecated: https://github.com/aws/aws-cdk/commit/a79bc47aaa6737628562c251e2f1990b2c7b88ef

The advice is to move to using `function.addAlias()`, however by moving to using that function the logical id of the alias will change, which means our alias would try to get recreated which will fail due to the alias already existing.

What is the best path to migrating off of the deprecated function?

### Links

https://github.com/aws/aws-cdk/blame/main/packages/aws-cdk-lib/aws-lambda/lib/lambda-version.ts

Contributor guide

Open the contributing guide

Research direction

Start with packages/aws-cdk-lib/aws-lambda/lib/lambda-version.ts and the linked deprecation commit. Compare how currentVersion.addAlias() and function.addAlias() determine the alias logical ID, then establish a migration path that avoids recreating an existing alias. Done means the migration guidance or behavior addresses the existing-alias failure.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, typescript
Domain
cloud, infrastructure
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.