Reputation: 850
I used to do this:
const fn = new lambda.Function(this, "MyLambda", {
runtime: lambda.Runtime.NODEJS_12_X,
handler: "index.handler",
code: lambda.Code.fromAsset(path.join(__dirname, "../lambda"), {
exclude: ["cdk", "*.ts"],
}),
});
But the AWS CDK doc flagged exclude
as deprecated without providing a means to replace it. Is there a new mechanism now or should I come up with my own solution (e.g. create a clean folder)?
Upvotes: 1
Views: 1297
Reputation: 855
Nothing you need to do, looks like there is an effort to move assets classes to core. The aws-lambda package uses aws-s3-assets AssetOptions which still uses CopyOptions from assets and not core CopyOptions. Once they do you won't see that warning.
https://github.com/aws/aws-cdk/pull/7708
Upvotes: 1