cdk-lambda-runtime-hacker
TypeScript icon, indicating that this package has built-in type declarations

0.1.1 • Public • Published

cdk-lambda-runtime-hacker

npm GitHub package.json dynamic NPM

For hacking Lambda runtime versions in CDK

Note that this is definitely not safe in general. You might find that your code runs fine in the new runtime.

import { cdkLambdaRuntimeHack } from 'cdk-lambda-runtime-hacker';

...

const app = new cdk.App();

// Then attach things to app, like stacks, with constructs and Lambda functions

// Then force all uses of node10 Lambda runtimes to become node12, and
// hope that you don't get any bugs
cdkLambdaRuntimeHack(app, {
    maps: [{
        runtimeFrom: lambda.Runtime.NODEJS_10_X,
        runtimeTo: lambda.Runtime.NODEJS_12_X,
    }],
});

CDK v1 and v2

The export from the top level is for CDK v2. However, you can import an equivalent function that works with CDK v1 as follows:

import { cdkLambdaRuntimeHack } from 'cdk-lambda-runtime-hacker/cdkv1';

And, for consistency, CDK v2 is available as follows too:

import { cdkLambdaRuntimeHack } from 'cdk-lambda-runtime-hacker/cdkv2';

Readme

Keywords

Package Sidebar

Install

npm i cdk-lambda-runtime-hacker

Weekly Downloads

0

Version

0.1.1

License

MIT

Unpacked Size

13.8 kB

Total Files

8

Last publish

Collaborators

  • isotoma-ci