From 14699354574225ce234c50748b5f4688bb376601 Mon Sep 17 00:00:00 2001 From: Stefan Wachter Date: Mon, 2 Dec 2024 12:54:36 +0100 Subject: [PATCH] Fix construct check --- packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts index c7a837b23ff16..dfeb8f66b71ea 100644 --- a/packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts +++ b/packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts @@ -245,7 +245,7 @@ export class SelfManagedKafkaEventSource extends StreamEventSource { } public bind(target: lambda.IFunction) { - if (!(target instanceof Construct)) { throw new Error('Function is not a construct. Unexpected error.'); } + if (!(Construct.isConstruct(target))) { throw new Error('Function is not a construct. Unexpected error.'); } target.addEventSourceMapping( this.mappingId(target), this.enrichMappingOptions({