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
+2
Original file line number
Diff line number
Diff line change
@@ -254,6 +254,8 @@ You can use Powertools for AWS Lambda (TypeScript) by installing it with your fa
254
254
255
255
[Lambda Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html){target="_blank"} is a `.zip` file archive that can contain additional code, pre-packaged dependencies, data, or configuration files. We compile and optimize [all dependencies](#install) to achieve an optimal build.
256
256
257
+
You can use the Lambda Layer both with CommonJS and ESM (ECMAScript modules) for Node.js 18.x and newer runtimes. **If you are using the managed Node.js 16.x runtime and cannot upgrade, you should use the CommonJS version only**.
258
+
257
259
??? note "Click to expand and copy any regional Lambda Layer ARN"
// eslint-disable-next-line func-style -- type assertions can't be arrow functions
28
+
functionassertLogs(
29
+
logs: TestInvocationLogs|undefined
30
+
): asserts logs is TestInvocationLogs{
31
+
if(!logs){
32
+
thrownewError('Function logs are not available');
33
+
}
34
+
}
35
+
27
36
/**
28
37
* This test has two stacks:
29
38
* 1. LayerPublisherStack - publishes a layer version using the LayerPublisher construct and containing the Powertools utilities from the repo
30
-
* 2. TestStack - uses the layer published in the first stack and contains a lambda function that uses the Powertools utilities from the layer
39
+
* 2. TestStack - uses the layer published in the first stack and contains two lambda functions that use the Powertools utilities from the layer
31
40
*
32
41
* The lambda function is invoked once and the logs are collected. The goal of the test is to verify that the layer creation and usage works as expected.
0 commit comments