cdk-lambda-llrt
cdk-lambda-llrt copied to clipboard
Add Support for Code instead of forcing bundling of the code.
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'),
});
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.