Skip to content

Commit

Permalink
Merge branch 'main' into madeline-k/remove-cognito-cfnspec-patch
Browse files Browse the repository at this point in the history
  • Loading branch information
mergify[bot] authored Jul 7, 2022
2 parents 1b33c1d + e43e4f2 commit 7b48adb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/@aws-cdk/aws-sns/lib/topic-base.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ export interface ITopic extends IResource, notifications.INotificationRuleTarget
/**
* Subscribe some endpoint to this topic
*/
addSubscription(subscription: ITopicSubscription): void;
addSubscription(subscription: ITopicSubscription): Subscription;

/**
* Adds a statement to the IAM resource policy associated with this topic.
Expand Down Expand Up @@ -80,7 +80,7 @@ export abstract class TopicBase extends Resource implements ITopic {
/**
* Subscribe some endpoint to this topic
*/
public addSubscription(subscription: ITopicSubscription) {
public addSubscription(subscription: ITopicSubscription): Subscription {
const subscriptionConfig = subscription.bind(this);

const scope = subscriptionConfig.subscriberScope || this;
Expand All @@ -95,7 +95,7 @@ export abstract class TopicBase extends Resource implements ITopic {
throw new Error(`A subscription with id "${id}" already exists under the scope ${scope.node.path}`);
}

new Subscription(scope, id, {
return new Subscription(scope, id, {
topic: this,
...subscriptionConfig,
});
Expand Down

0 comments on commit 7b48adb

Please sign in to comment.