cdk-lambda-llrt icon indicating copy to clipboard operation
cdk-lambda-llrt copied to clipboard

Add Support for Code instead of forcing bundling of the code.

Open asheliahut opened this issue 1 year ago • 1 comments

I have some example code below that uses NodejsFunction today and I would like to be able to use this for LLRT, but I am bundling things myself using Bun. I would like a way to do this and then have it bundle the llrt with my pre bundled code.

const fn = new NodejsFunction(this, 'Lambda', {
    entry: 'index.mjs',
    handler: 'index.handler',
    code: Code.fromAsset('dist'),
    runtime: Runtime.NODEJS_20_X,
});

So the end result would look like this below and it would still be able to use llrt:

const fn = new LlrtFunction(this, 'Lambda', {
    entry: 'index.mjs',
    handler: 'index.handler',
    code: Code.fromAsset('dist'),
});

asheliahut avatar Jul 28 '24 04:07 asheliahut

This is actually difficult to achieve, because we cannot inject code to download LLRT binary to the Code instance. I'll research for available ways to do that.

tmokmss avatar Aug 14 '24 14:08 tmokmss