Skip to content

Commit

Permalink
feat: set maxConcurrency on LambdaWorker DLQ (#92)
Browse files Browse the repository at this point in the history
  • Loading branch information
nemanja-kovacevic-thinkit authored Nov 20, 2024
1 parent fb0ee04 commit f4d3cd9
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
1 change: 1 addition & 0 deletions lib/lambda-worker/lambda-worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export class LambdaWorker extends Construct {
new SqsEventSource(lambdaDLQ, {
enabled: false,
batchSize: 1,
maxConcurrency: props.lambdaProps.queueMaxConcurrency,
}),
);

Expand Down
24 changes: 24 additions & 0 deletions test/infra/lambda-worker/lambda-worker.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,30 @@ describe("LambdaWorker", () => {
});
});

test("provisions Lambda EventSourceMapping", () => {
Template.fromStack(stack).hasResourceProperties(
"AWS::Lambda::EventSourceMapping",
{
Enabled: true,
BatchSize: 1,
ScalingConfig: {
MaximumConcurrency: 5,
},
},
);

Template.fromStack(stack).hasResourceProperties(
"AWS::Lambda::EventSourceMapping",
{
Enabled: false,
BatchSize: 1,
ScalingConfig: {
MaximumConcurrency: 5,
},
},
);
});

test("provisions three alarms", () => {
Template.fromStack(stack).resourceCountIs("AWS::CloudWatch::Alarm", 3);
});
Expand Down

0 comments on commit f4d3cd9

Please sign in to comment.