elegant-pager-5412
04/27/2021, 12:15 PMnode_modules
? As mentioned in the docs: https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html#configuration-layers-pathmillions-furniture-75402
04/27/2021, 1:22 PMconst lambdaLayer = new aws.lambda.LayerVersion(`${appName}-lambda-layer`, {
code: new pulumi.asset.FileArchive("./node_modules"),
compatibleRuntimes: [aws.lambda.NodeJS12dXRuntime],
layerName: `${appName}-lambda-layer`,
});
const lambdaFunctionApi = new aws.lambda.Function(
`${appName}-api`,
{
code: new pulumi.asset.FileArchive("./dist/app"),
handler: "app.handler",
layers: [lambdaLayer.arn],
role: applicationRole.arn,
runtime: aws.lambda.NodeJS12dXRuntime,
},
{ dependsOn: [applicationRole, lambdaLayer] },
);
npm install --prefix ${DESTFOLDER} --production