Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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,
};
}
}