Skip to content

Commit

Permalink
fix(sns-subscriptions): cannot add SqsSubscription when using an Sqs …
Browse files Browse the repository at this point in the history
…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*
  • Loading branch information
gastonsilva committed Oct 5, 2023
1 parent c68ea44 commit 52eee85
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/aws-cdk-lib/aws-sns-subscriptions/lib/sqs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export class SqsSubscription implements sns.ITopicSubscription {
public bind(topic: sns.ITopic): sns.TopicSubscriptionConfig {
// Create subscription under *consuming* construct to make sure it ends up
// in the correct stack in cases of cross-stack subscriptions.
if (!(this.queue instanceof Construct)) {
if (!Construct.isConstruct(this.queue)) {
throw new Error('The supplied Queue object must be an instance of Construct');
}
const snsServicePrincipal = new iam.ServicePrincipal('sns.amazonaws.com');
Expand Down

0 comments on commit 52eee85

Please sign in to comment.