Skip to content

Commit 52eee85

Browse files
authored
fix(sns-subscriptions): cannot add SqsSubscription when using an Sqs Construct from a different Constructs library (#27227)
Fix the "is construct" check to ensure one can add an SqsSubscription to an sns topic using the "addSubscription" method regardless of whether it came from a symlinked construct library or not. Closes #27225 ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license*
1 parent c68ea44 commit 52eee85

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/sqs.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export class SqsSubscription implements sns.ITopicSubscription {
3333
public bind(topic: sns.ITopic): sns.TopicSubscriptionConfig {
3434
// Create subscription under *consuming* construct to make sure it ends up
3535
// in the correct stack in cases of cross-stack subscriptions.
36-
if (!(this.queue instanceof Construct)) {
36+
if (!Construct.isConstruct(this.queue)) {
3737
throw new Error('The supplied Queue object must be an instance of Construct');
3838
}
3939
const snsServicePrincipal = new iam.ServicePrincipal('sns.amazonaws.com');

0 commit comments

Comments
 (0)