@Generated(value="jsii-pacmak/1.67.0 (build 2c027f5)", date="2022-09-19T20:26:37.578Z") @Stability(value=Stable) public class NotificationRule extends Resource implements INotificationRule
Example:
import software.amazon.awscdk.services.codestarnotifications.*;
import software.amazon.awscdk.services.codebuild.*;
import software.amazon.awscdk.services.sns.*;
import software.amazon.awscdk.services.chatbot.*;
PipelineProject project = new PipelineProject(this, "MyProject");
Topic topic = new Topic(this, "MyTopic1");
SlackChannelConfiguration slack = SlackChannelConfiguration.Builder.create(this, "MySlackChannel")
.slackChannelConfigurationName("YOUR_CHANNEL_NAME")
.slackWorkspaceId("YOUR_SLACK_WORKSPACE_ID")
.slackChannelId("YOUR_SLACK_CHANNEL_ID")
.build();
NotificationRule rule = NotificationRule.Builder.create(this, "NotificationRule")
.source(project)
.events(List.of("codebuild-project-build-state-succeeded", "codebuild-project-build-state-failed"))
.targets(List.of(topic))
.build();
rule.addTarget(slack);
| Modifier and Type | Class and Description |
|---|---|
static class |
NotificationRule.Builder
A fluent builder for
NotificationRule. |
software.amazon.jsii.JsiiObject.InitializationModeINotificationRule.Jsii$Default, INotificationRule.Jsii$Proxy| Modifier | Constructor and Description |
|---|---|
|
NotificationRule(software.constructs.Construct scope,
String id,
NotificationRuleProps props) |
protected |
NotificationRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode) |
protected |
NotificationRule(software.amazon.jsii.JsiiObjectRef objRef) |
| Modifier and Type | Method and Description |
|---|---|
Boolean |
addTarget(INotificationRuleTarget target)
Adds target to notification rule.
|
static INotificationRule |
fromNotificationRuleArn(software.constructs.Construct scope,
String id,
String notificationRuleArn)
Import an existing notification rule provided an ARN.
|
String |
getNotificationRuleArn()
The ARN of the notification rule (i.e.
|
applyRemovalPolicy, generatePhysicalName, getEnv, getPhysicalName, getResourceArnAttribute, getResourceNameAttribute, getStack, isOwnedResource, isResourcejsiiAsyncCall, jsiiAsyncCall, jsiiCall, jsiiCall, jsiiGet, jsiiGet, jsiiSet, jsiiStaticCall, jsiiStaticCall, jsiiStaticGet, jsiiStaticGet, jsiiStaticSet, jsiiStaticSetclone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitapplyRemovalPolicy, getEnv, getStackprotected NotificationRule(software.amazon.jsii.JsiiObjectRef objRef)
protected NotificationRule(software.amazon.jsii.JsiiObject.InitializationMode initializationMode)
@Stability(value=Stable)
public NotificationRule(@NotNull
software.constructs.Construct scope,
@NotNull
String id,
@NotNull
NotificationRuleProps props)
scope - This parameter is required.id - This parameter is required.props - This parameter is required.@Stability(value=Stable) @NotNull public static INotificationRule fromNotificationRuleArn(@NotNull software.constructs.Construct scope, @NotNull String id, @NotNull String notificationRuleArn)
scope - The parent creating construct. This parameter is required.id - The construct's name. This parameter is required.notificationRuleArn - Notification rule ARN (i.e. arn:aws:codestar-notifications:::notificationrule/01234abcde). This parameter is required.@Stability(value=Stable) @NotNull public Boolean addTarget(@NotNull INotificationRuleTarget target)
addTarget in interface INotificationRuletarget - The SNS topic or AWS Chatbot Slack target. This parameter is required.@Stability(value=Stable) @NotNull public String getNotificationRuleArn()
getNotificationRuleArn in interface INotificationRuleCopyright © 2022. All rights reserved.