How to use the @aws-cdk/aws-sns-subscriptions.EmailSubscription function in @aws-cdk/aws-sns-subscriptions

To help you get started, we’ve selected a few @aws-cdk/aws-sns-subscriptions examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github aws / aws-cdk / packages / @aws-cdk / aws-codepipeline-actions / lib / manual-approval-action.ts View on Github external
protected bound(scope: cdk.Construct, _stage: codepipeline.IStage, options: codepipeline.ActionBindOptions):
      codepipeline.ActionConfig {
    if (this.props.notificationTopic) {
      this._notificationTopic = this.props.notificationTopic;
    } else if ((this.props.notifyEmails || []).length > 0) {
      this._notificationTopic = new sns.Topic(scope, 'TopicResource');
    }

    if (this._notificationTopic) {
      this._notificationTopic.grantPublish(options.role);
      for (const notifyEmail of this.props.notifyEmails || []) {
        this._notificationTopic.addSubscription(new subs.EmailSubscription(notifyEmail));
      }
    }

    return {
      configuration: this._notificationTopic
        ? {
          NotificationArn: this._notificationTopic.topicArn,
          CustomData: this.props.additionalInformation,
        }
        : undefined,
    };
  }
}

@aws-cdk/aws-sns-subscriptions

CDK Subscription Constructs for AWS SNS

Apache-2.0
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis