From 047800ef436bfcc0567373f3c1bc43635b345101 Mon Sep 17 00:00:00 2001 From: Jonathan Ifegunni Date: Mon, 4 Mar 2024 17:38:12 -0800 Subject: [PATCH] added new feature to readme --- packages/aws-cdk-lib/aws-lambda-nodejs/README.md | 10 ++++++++++ packages/aws-cdk-lib/aws-lambda-nodejs/lib/types.ts | 2 +- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda-nodejs/README.md b/packages/aws-cdk-lib/aws-lambda-nodejs/README.md index f3cfd7a3b1065..b7d6ce23b02f4 100644 --- a/packages/aws-cdk-lib/aws-lambda-nodejs/README.md +++ b/packages/aws-cdk-lib/aws-lambda-nodejs/README.md @@ -168,6 +168,16 @@ new nodejs.NodejsFunction(this, 'my-handler', { }, }); ``` +Includes AWS SDK in the bundle asset by setting `bundleAwsSDK` to `true`. This will be essentially exclude sdk from the external +module and not be resolved to the Lambda provided sdk. + +```ts +new nodejs.NodejsFunction(this, 'my-handler', { + bundling: { + bundleAwsSDK: true, + }, +}); +``` ### Install modules diff --git a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/types.ts b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/types.ts index 9471b287ce22c..a2749ed1aa791 100644 --- a/packages/aws-cdk-lib/aws-lambda-nodejs/lib/types.ts +++ b/packages/aws-cdk-lib/aws-lambda-nodejs/lib/types.ts @@ -185,7 +185,7 @@ export interface BundlingOptions extends DockerRunOptions { * * @default - false * if `true` the `aws-sdk` will be included in the asset bundle and not be - * resolved to the Lambda provided bundle. + * resolved to the Lambda provided sdk. */ readonly bundleAwsSDK?: boolean;