Error libncurses.so.6 when using Bref Lambda custom runtime with AWS CDK #910
-
|
I am trying to use Bref custom runtime in AWS Lambda using AWS CDK instead of Serverless. The CDK code is like below. const region = cdk.Stack.of(this).region;
//arn:aws:lambda:ap-southeast-1:209497400698:layer:php-74:18
const brefLayerVersion = `arn:aws:lambda:${region}:209497400698:layer:php-80:8`;
const assetPath = path.join(__dirname, '../../lambda');
const asset = lambda.Code.fromAsset(assetPath);
const lambdaFunc = new lambda.Function(this, 'LambdaFunction', {
runtime: lambda.Runtime.PROVIDED,
handler: 'src/index.php',
layers: [
lambda.LayerVersion.fromLayerVersionArn(this, 'BrefPHPLayer', brefLayerVersion),
],
code: asset,
});
new cdk.CfnOutput(this, 'LambdaFunctionArn', { value: lambdaFunc.functionArn });Here's the full source code https://github.com/petrabarus/cdk-bref-function When I tried manually invoking using AWS CLI The Cloudwatch Log shows something like this. If I compare the deployment with Serverless Framework, the configuration (layer, code, etc) is pretty much the same. What did I miss? I also post this in StackOverflow https://stackoverflow.com/questions/67059259/error-libncurses-so-6-when-using-bref-lambda-custom-runtime-with-aws-cdk |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
|
Hi! With Bref 1.0 you need to use the |
Beta Was this translation helpful? Give feedback.
Hi!
With Bref 1.0 you need to use the
provided.al2runtime (instead ofprovided). I'm not sure what's the corresponding value in CDK, but I think that should solve it.