@bifravst/aws-cdk-lambda-helpers 5.0.7 → 5.1.1

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.
@@ -1,23 +1,14 @@
1
1
  import { CfnOutput, Duration, aws_lambda as Lambda, Stack } from 'aws-cdk-lib';
2
- import { LambdaSource } from '../src/cdk.js';
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 Lambda.LayerVersion(this, 'baseLayer', {
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,
Binary file
Binary file