From b535f2c36dfce55642fc5e099c843d49a385f7d6 Mon Sep 17 00:00:00 2001 From: nemanja-kovacevic-thinkit Date: Mon, 1 Apr 2024 22:24:25 +0200 Subject: [PATCH] feat: lambda worker - support maxConcurrency (SqsEventSource) --- lib/lambda-worker/lambda-worker-props.ts | 1 + lib/lambda-worker/lambda-worker.ts | 1 + 2 files changed, 2 insertions(+) diff --git a/lib/lambda-worker/lambda-worker-props.ts b/lib/lambda-worker/lambda-worker-props.ts index d71afa4..7e83757 100644 --- a/lib/lambda-worker/lambda-worker-props.ts +++ b/lib/lambda-worker/lambda-worker-props.ts @@ -45,6 +45,7 @@ export interface LambdaWorkerProps { timeout: cdk.Duration; vpc?: ec2.IVpc; vpcSubnets?: ec2.SubnetSelection; + queueMaxConcurrency?: number; } & Partial & Partial & Partial; diff --git a/lib/lambda-worker/lambda-worker.ts b/lib/lambda-worker/lambda-worker.ts index 776ed7f..bf9df48 100644 --- a/lib/lambda-worker/lambda-worker.ts +++ b/lib/lambda-worker/lambda-worker.ts @@ -141,6 +141,7 @@ export class LambdaWorker extends Construct { new SqsEventSource(lambdaQueue, { enabled: props.lambdaProps.enableQueue ?? true, batchSize: 1, + maxConcurrency: props.lambdaProps.queueMaxConcurrency, }), ); lambdaWorker.addEventSource(