@mstuercke/pulumi-modules 0.0.23 → 0.0.25
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,4 +1,4 @@
|
|
|
1
|
-
import { ComponentResource, type ComponentResourceOptions, type
|
|
1
|
+
import { ComponentResource, type ComponentResourceOptions, type Output } from '@pulumi/pulumi';
|
|
2
2
|
import { type SimpleIamRolePolicyConfig } from '../iam/index.ts';
|
|
3
3
|
import type { WithInputs } from './WithInputs.ts';
|
|
4
4
|
export type NodeLambdaFunctionArgs<EnvironmentVariables> = {
|
|
@@ -10,7 +10,10 @@ export type NodeLambdaFunctionArgs<EnvironmentVariables> = {
|
|
|
10
10
|
lambdaPath: string;
|
|
11
11
|
additionalIamRolePolicies?: SimpleIamRolePolicyConfig[];
|
|
12
12
|
environmentVariables?: WithInputs<EnvironmentVariables>;
|
|
13
|
-
layers?:
|
|
13
|
+
layers?: {
|
|
14
|
+
name: string;
|
|
15
|
+
layerPath: string;
|
|
16
|
+
}[];
|
|
14
17
|
projectId: string;
|
|
15
18
|
};
|
|
16
19
|
export declare class NodeLambdaFunction<EnvironmentVariables extends Record<string, string> = Record<string, string>> extends ComponentResource {
|
|
@@ -52,7 +52,20 @@ export class NodeLambdaFunction extends ComponentResource {
|
|
|
52
52
|
runtime: runtime,
|
|
53
53
|
memorySize: memorySize,
|
|
54
54
|
timeout: timeoutSeconds,
|
|
55
|
-
layers: layers,
|
|
55
|
+
layers: layers?.map(({ name, layerPath }) => {
|
|
56
|
+
const layerZip = getFile({
|
|
57
|
+
type: 'zip',
|
|
58
|
+
sourceDir: layerPath,
|
|
59
|
+
outputPath: `dist/lambda-layer/${name}.zip`,
|
|
60
|
+
});
|
|
61
|
+
const layer = new lambda.LayerVersion(name, {
|
|
62
|
+
layerName: name,
|
|
63
|
+
code: new asset.FileArchive(layerZip.then((layerZip) => layerZip.outputPath)),
|
|
64
|
+
sourceCodeHash: layerZip.then((layerZip) => layerZip.outputBase64sha256),
|
|
65
|
+
compatibleRuntimes: [runtime],
|
|
66
|
+
}, opts);
|
|
67
|
+
return layer.arn;
|
|
68
|
+
}),
|
|
56
69
|
code: new asset.FileArchive(lambdaZip.then((lambdaZip) => lambdaZip.outputPath)),
|
|
57
70
|
sourceCodeHash: lambdaZip.then((lambdaZip) => lambdaZip.outputBase64sha256),
|
|
58
71
|
role: role.arn,
|