Skip to content

Commit

Permalink
fix(lambda-event-sources): SelfManagedKafkaEventSource cannot be us…
Browse files Browse the repository at this point in the history
…ed in NPM symlinked workspaces (#32937)

### Reason for this change

Allow to use SelfManagedKafkaEventSource in symlinked setups.

### Description of changes

Replace instanceof check by `Construct.isConstruct()` call.

*By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
  • Loading branch information
swachter authored Feb 6, 2025
1 parent 9fd62cb commit fe656af
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-lambda-event-sources/lib/kafka.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,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({
Expand Down

0 comments on commit fe656af

Please sign in to comment.