Skip to content

Commit

Permalink
feat: add Lambda Ephemeral storage to LambdaWorker props (#61)
Browse files Browse the repository at this point in the history
* feat: add Lambda Ephemeral storage to LambdaWorker props
  • Loading branch information
ShaunParsons authored Aug 24, 2022
1 parent de4cd95 commit f4c1ce8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/lambda-worker/lambda-worker-props.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ export interface LambdaWorkerProps {
entry?: string;
enableQueue?: boolean;
environment?: { [key: string]: string };
ephemeralStorageSize?: cdk.Size;
filesystem?: lambda.FileSystem;
memorySize: number; // LambdaWorker will set a minimum memory size of 1024
policyStatements?: iam.PolicyStatement[];
Expand Down
2 changes: 2 additions & 0 deletions lib/lambda-worker/lambda-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -252,6 +252,7 @@ export class LambdaWorker extends cdk.Construct {
handler: props.lambdaProps.handler,
description: props.lambdaProps.description,
environment: props.lambdaProps.environment,
ephemeralStorageSize: props.lambdaProps.ephemeralStorageSize,
memorySize: props.lambdaProps.memorySize,
reservedConcurrentExecutions:
props.lambdaProps.reservedConcurrentExecutions,
Expand Down Expand Up @@ -297,6 +298,7 @@ export class LambdaWorker extends cdk.Construct {
functionName: props.name,
description: props.lambdaProps.description,
environment: props.lambdaProps.environment,
ephemeralStorageSize: props.lambdaProps.ephemeralStorageSize,
memorySize: props.lambdaProps.memorySize,
reservedConcurrentExecutions:
props.lambdaProps.reservedConcurrentExecutions,
Expand Down
4 changes: 4 additions & 0 deletions test/infra/lambda-worker/lambda-worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ describe("LambdaWorker", () => {

// Optional
description: "Test Description",
ephemeralStorageSize: cdk.Size.mebibytes(1024),
environment: {
TALIS_ENV_VAR: "some value",
},
Expand Down Expand Up @@ -254,6 +255,9 @@ describe("LambdaWorker", () => {
AWS_NODEJS_CONNECTION_REUSE_ENABLED: "1",
},
},
EphemeralStorage: {
Size: 1024,
},
ReservedConcurrentExecutions: 10,
})
);
Expand Down

0 comments on commit f4c1ce8

Please sign in to comment.