cdk-lambda-alias-retention
Project description
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
```ts
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.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for cdk-lambda-alias-retention-2.1.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1ef66fa2ff581e7f8afffd19eb0b163ecb82cc1553893e22fde3f6f3a7454ea3 |
|
MD5 | 7e1ba9c3f69e2980401a491f1b266588 |
|
BLAKE2b-256 | 46f80100070d37f2e3f448c55351fb98a40913c2ce792f6bb1574d4cb25c2cf6 |
Close
Hashes for cdk_lambda_alias_retention-2.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 24744172ed8d073f49d632e8fe621e829681e740a88627e2d6c84e661d3ecb9e |
|
MD5 | 322993e7a67eb44e8e011643637d0327 |
|
BLAKE2b-256 | ccd58cfb31b1b8b1a854718a1ee439b5ebfab6e547c05e21f5db7174d41fecea |