Skip to main content

NPM version PyPI version Release

cdk-lambda-alias-retention

Create lambda alias and retain it forever.

What's the problem?

When using AWS CDK to create lambda with version and alias, it will retain the latest alias only. See the sample code as blow:

# Example automatically generated from non-compiling source. May contain errors.
const fn = new lambda.DockerImageFunction(stackTest, 'TestLambda', {
    code: lambda.DockerImageCode.fromImageAsset(
    path.join(__dirname, '../lambda'),
    ),
    currentVersionOptions: {
    removalPolicy: RemovalPolicy.RETAIN,
    },
});

fn.currentVersion.addAlias('v1.0.0');

In general, the lambda code will be iterated continuously and the alias will be changed probably ever time, such as v1.0.1, v1.0.2, v1.0.3 etc...

AWS CDK don't support to retain old alias now and it support to retain old version only.

Support CDKv1 and CDKv2

CDKv2

npm install cdk-lambda-alias-retention
or
npm install cdk-lambda-alias-retention@latest
or
npm install cdk-lambda-alias-retention@^2.0.0

CDKv1

npm install cdk-lambda-alias-retention@cdkv1
or
npm install cdk-lambda-alias-retention@^1.0.0

Usage

# Example automatically generated from non-compiling source. May contain errors.
new LambdaAliasRetention(stackTest, 'TestLambdaAliasRetention', {
    fn,
    lambdaAlias: 'v1',
});

Complete sample code is in src/integ.default.ts

It can use context or environemnt variable for lambdaAlias.

Release files for cdk-lambda-alias-retention 2.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cdk-lambda-alias-retention 2.1.2
File Size Uploaded
cdk-lambda-alias-retention-2.1.2.tar.gz 27.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cdk-lambda-alias-retention 2.1.2
File Interpreter ABI Platform
cdk_lambda_alias_retention-2.1.2-py3-none-any.whl Python 3 none any Details

Total release size: 55.6 kB

Release files / cdk-lambda-alias-retention-2.1.2.tar.gz

Download URL cdk-lambda-alias-retention-2.1.2.tar.gz
Size 27.7 kB
Tags Source
SHA-256 checksum
How to use checksums
61d9f5a7eea174be8f6693c33ae04a71f8a80286e20c51b13c8a1a167bf8e62c
BLAKE2b-256 checksum
How to use checksums
e71c5eae2b03b8e21bc90a7a1b7ce2eaa4e8c12892c50176f4b6ce0ea33b465a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

Release files / cdk_lambda_alias_retention-2.1.2-py3-none-any.whl

Download URL cdk_lambda_alias_retention-2.1.2-py3-none-any.whl
Size 27.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
dae6cef9eb9b88193960b3c0d65b3a1d218dfdfcab3f31dc5dcd72ae0b9ff956
BLAKE2b-256 checksum
How to use checksums
a0af306e00fb2d3fe819e0193b29b0b0d533fc700e2a46c17943beed28b675bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.7.1 importlib_metadata/4.8.2 pkginfo/1.8.2 requests/2.26.0 requests-toolbelt/0.9.1 tqdm/4.62.3 CPython/3.7.3

Release history Release notifications | RSS feed

This release

2.1.2 This release

2 release files

2.1.1

2 release files

2.1.0

2 release files

1.0.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page