Skip to content

Commit 06b33d5

Browse files
authored
fix(sns-subscriptions): cannot add Lambda Subscription when using a Lambda Construct from a different Construct Library (#26206)
Fix the "is construct" check to ensure one can add a LambdaSubscription to an sns topic using the "addSubscription" method regardless of whether it came from a symlinked construct library or not. Closes #24788. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent 9364e94 commit 06b33d5

File tree

1 file changed

+1
-1
lines changed
  • packages/aws-cdk-lib/aws-sns-subscriptions/lib

1 file changed

+1
-1
lines changed

packages/aws-cdk-lib/aws-sns-subscriptions/lib/lambda.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export class LambdaSubscription implements sns.ITopicSubscription {
2424
public bind(topic: sns.ITopic): sns.TopicSubscriptionConfig {
2525
// Create subscription under *consuming* construct to make sure it ends up
2626
// in the correct stack in cases of cross-stack subscriptions.
27-
if (!(this.fn instanceof Construct)) {
27+
if (!Construct.isConstruct(this.fn)) {
2828
throw new Error('The supplied lambda Function object must be an instance of Construct');
2929
}
3030

0 commit comments

Comments
 (0)