Interface INotificationRuleProps
Properties for a new notification rule.
Inherited Members
Namespace: Amazon.CDK.AWS.CodeStarNotifications
Assembly: Amazon.CDK.Lib.dll
Syntax (csharp)
public interface INotificationRuleProps : INotificationRuleOptions
Syntax (vb)
Public Interface INotificationRuleProps
Inherits INotificationRuleOptions
Remarks
ExampleMetadata: infused
Examples
using Amazon.CDK.AWS.CodeStarNotifications;
using Amazon.CDK.AWS.CodeBuild;
using Amazon.CDK.AWS.SNS;
using Amazon.CDK.AWS.Chatbot;
var project = new PipelineProject(this, "MyProject");
var topic = new Topic(this, "MyTopic1");
var slack = new SlackChannelConfiguration(this, "MySlackChannel", new SlackChannelConfigurationProps {
SlackChannelConfigurationName = "YOUR_CHANNEL_NAME",
SlackWorkspaceId = "YOUR_SLACK_WORKSPACE_ID",
SlackChannelId = "YOUR_SLACK_CHANNEL_ID"
});
var rule = new NotificationRule(this, "NotificationRule", new NotificationRuleProps {
Source = project,
Events = new [] { "codebuild-project-build-state-succeeded", "codebuild-project-build-state-failed" },
Targets = new [] { topic },
NotificationRuleName = "MyNotificationRuleName",
Enabled = true, // The default is true
DetailType = DetailType.FULL, // The default is FULL
CreatedBy = "Jone Doe"
});
rule.AddTarget(slack);
Synopsis
Properties
Events | A list of event types associated with this notification rule. |
Source | The Amazon Resource Name (ARN) of the resource to associate with the notification rule. |
Targets | The targets to register for the notification destination. |
Properties
Events
A list of event types associated with this notification rule.
string[] Events { get; }
Property Value
System.String[]
Remarks
For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide.
See: https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api
Source
The Amazon Resource Name (ARN) of the resource to associate with the notification rule.
INotificationRuleSource Source { get; }
Property Value
Remarks
Currently, Supported sources include pipelines in AWS CodePipeline, build projects in AWS CodeBuild, and repositories in AWS CodeCommit in this L2 constructor.
Targets
The targets to register for the notification destination.
virtual INotificationRuleTarget[] Targets { get; }
Property Value
Remarks
Default: - No targets are added to the rule. Use addTarget()
to add a target.