You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/index.md
+49Lines changed: 49 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -204,6 +204,55 @@ You can include Lambda Powertools Lambda Layer using [AWS Lambda Console](https:
204
204
205
205
Container Image deployment (OCI) or inline Lambda functions do not support Lambda Layers.
206
206
207
+
If you use `esbuild` to bundle your code, make sure to exclude `@aws-lambda-powertools` from being bundled since the packages will be brought by the Layer:
208
+
209
+
=== "SAM"
210
+
211
+
```yaml hl_lines="5"
212
+
MyLambdaFunction:
213
+
Type: AWS::Serverless::Function
214
+
Properties:
215
+
...
216
+
Metadata:
217
+
# Manage esbuild properties
218
+
BuildMethod: esbuild
219
+
BuildProperties:
220
+
Minify: true
221
+
External:s
222
+
- '@aws-lambda-powertools/commons'
223
+
- '@aws-lambda-powertools/logger'
224
+
- '@aws-lambda-powertools/metrics'
225
+
- '@aws-lambda-powertools/tracer'
226
+
```
227
+
228
+
=== "Serverless framework"
229
+
230
+
```yaml hl_lines="5"
231
+
custom:
232
+
esbuild:
233
+
external:
234
+
- '@aws-lambda-powertools/commons'
235
+
- '@aws-lambda-powertools/logger'
236
+
- '@aws-lambda-powertools/metrics'
237
+
- '@aws-lambda-powertools/tracer'
238
+
```
239
+
240
+
=== "CDK"
241
+
242
+
```typescript hl_lines="11 16"
243
+
new awsLambdaNodejs.NodejsFunction(this, 'Function', {
244
+
...
245
+
bundling: {
246
+
externalModules: [
247
+
'@aws-lambda-powertools/commons',
248
+
'@aws-lambda-powertools/logger',
249
+
'@aws-lambda-powertools/metrics',
250
+
'@aws-lambda-powertools/tracer',
251
+
],
252
+
}
253
+
});
254
+
```
255
+
207
256
### NPM Modules
208
257
209
258
The AWS Lambda Powertools for TypeScript utilities (which from here will be referred as Powertools) follow a modular approach, similar to the official [AWS SDK v3 for JavaScript](https://github.com/aws/aws-sdk-js-v3).
0 commit comments