@bifravst/aws-cdk-lambda-helpers 5.0.7 → 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cdk/TestStack.js +4 -13
- package/dist/lambdas/test.zip +0 -0
- package/dist/lambdas/testAliasImports.zip +0 -0
- package/dist/layers/baseLayer/nodejs/package-lock.json +485 -395
- package/dist/layers/baseLayer.zip +0 -0
- package/dist/package.json +10 -10
- package/dist/src/BaseLayerVersion.d.ts +7 -0
- package/dist/src/BaseLayerVersion.js +19 -0
- package/dist/src/cdk.d.ts +1 -0
- package/dist/src/cdk.js +1 -0
- package/package.json +10 -10
package/dist/cdk/TestStack.js
CHANGED
|
@@ -1,23 +1,14 @@
|
|
|
1
1
|
import { CfnOutput, Duration, aws_lambda as Lambda, Stack } from 'aws-cdk-lib';
|
|
2
|
-
import {
|
|
2
|
+
import { BaseLayerVersion } from '../src/cdk.js';
|
|
3
3
|
import { PackedLambdaFn } from '../src/PackedLambdaFn.js';
|
|
4
4
|
export class TestStack extends Stack {
|
|
5
5
|
constructor(parent, id, { lambdaSources, layer, }) {
|
|
6
6
|
super(parent, id, {});
|
|
7
|
-
const baseLayer = new
|
|
8
|
-
layerVersionName: `${Stack.of(this).stackName}-baseLayer`,
|
|
9
|
-
code: new LambdaSource(this, {
|
|
10
|
-
id: 'baseLayer',
|
|
11
|
-
zipFilePath: layer.layerZipFilePath,
|
|
12
|
-
hash: layer.hash,
|
|
13
|
-
}).code,
|
|
14
|
-
compatibleArchitectures: [Lambda.Architecture.ARM_64],
|
|
15
|
-
compatibleRuntimes: [Lambda.Runtime.NODEJS_24_X],
|
|
16
|
-
});
|
|
7
|
+
const baseLayer = new BaseLayerVersion(this, layer);
|
|
17
8
|
const lambda = new PackedLambdaFn(this, 'fn', lambdaSources.test, {
|
|
18
9
|
timeout: Duration.seconds(1),
|
|
19
10
|
description: 'Returns a ULID',
|
|
20
|
-
layers: [baseLayer],
|
|
11
|
+
layers: [baseLayer.layerVersion],
|
|
21
12
|
});
|
|
22
13
|
const url = lambda.fn.addFunctionUrl({
|
|
23
14
|
authType: Lambda.FunctionUrlAuthType.NONE,
|
|
@@ -30,7 +21,7 @@ export class TestStack extends Stack {
|
|
|
30
21
|
const lambdaAliasImports = new PackedLambdaFn(this, 'aliasImportsFn', lambdaSources.testAliasImports, {
|
|
31
22
|
timeout: Duration.seconds(1),
|
|
32
23
|
description: 'Uses aliased imports',
|
|
33
|
-
layers: [baseLayer],
|
|
24
|
+
layers: [baseLayer.layerVersion],
|
|
34
25
|
});
|
|
35
26
|
const urlAliasImports = lambdaAliasImports.fn.addFunctionUrl({
|
|
36
27
|
authType: Lambda.FunctionUrlAuthType.NONE,
|
package/dist/lambdas/test.zip
CHANGED
|
Binary file
|
|
Binary file
|