Show / Hide Table of Contents

Class NotificationRule

A new notification rule.

Inheritance
System.Object
Construct
Resource
NotificationRule
Implements
INotificationRule
IResource
IConstruct
Constructs.IConstruct
IDependable
Inherited Members
Resource.IsResource(IConstruct)
Resource.ApplyRemovalPolicy(RemovalPolicy)
Resource.GeneratePhysicalName()
Resource.GetResourceArnAttribute(String, IArnComponents)
Resource.GetResourceNameAttribute(String)
Resource.Env
Resource.PhysicalName
Resource.Stack
Construct.IsConstruct(Object)
Construct.OnPrepare()
Construct.OnSynthesize(ISynthesisSession)
Construct.OnValidate()
Construct.Prepare()
Construct.Synthesize(ISynthesisSession)
Construct.Validate()
Construct.Node
Namespace: Amazon.CDK.AWS.CodeStarNotifications
Assembly: Amazon.CDK.AWS.CodeStarNotifications.dll
Syntax (csharp)
public class NotificationRule : Resource, INotificationRule, IResource, IConstruct, IDependable
Syntax (vb)
Public Class NotificationRule
    Inherits Resource
    Implements INotificationRule, IResource, IConstruct, IDependable
Remarks

Resource: AWS::CodeStarNotifications::NotificationRule

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 }
});
rule.AddTarget(slack);

Synopsis

Constructors

NotificationRule(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

NotificationRule(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

NotificationRule(Construct, String, INotificationRuleProps)

Properties

NotificationRuleArn

The ARN of the notification rule (i.e. arn:aws:codestar-notifications:::notificationrule/01234abcde).

Methods

AddTarget(INotificationRuleTarget)

Adds target to notification rule.

FromNotificationRuleArn(Construct, String, String)

Import an existing notification rule provided an ARN.

Constructors

NotificationRule(ByRefValue)

Used by jsii to construct an instance of this class from a Javascript-owned object reference

protected NotificationRule(ByRefValue reference)
Parameters
reference Amazon.JSII.Runtime.Deputy.ByRefValue

The Javascript-owned object reference

NotificationRule(DeputyBase.DeputyProps)

Used by jsii to construct an instance of this class from DeputyProps

protected NotificationRule(DeputyBase.DeputyProps props)
Parameters
props Amazon.JSII.Runtime.Deputy.DeputyBase.DeputyProps

The deputy props

NotificationRule(Construct, String, INotificationRuleProps)

public NotificationRule(Construct scope, string id, INotificationRuleProps props)
Parameters
scope Constructs.Construct
id System.String
props INotificationRuleProps

Properties

NotificationRuleArn

The ARN of the notification rule (i.e. arn:aws:codestar-notifications:::notificationrule/01234abcde).

public virtual string NotificationRuleArn { get; }
Property Value

System.String

Remarks

Attribute: true

Methods

AddTarget(INotificationRuleTarget)

Adds target to notification rule.

public virtual bool AddTarget(INotificationRuleTarget target)
Parameters
target INotificationRuleTarget

The SNS topic or AWS Chatbot Slack target.

Returns

System.Boolean

FromNotificationRuleArn(Construct, String, String)

Import an existing notification rule provided an ARN.

public static INotificationRule FromNotificationRuleArn(Construct scope, string id, string notificationRuleArn)
Parameters
scope Constructs.Construct

The parent creating construct.

id System.String

The construct's name.

notificationRuleArn System.String

Notification rule ARN (i.e. arn:aws:codestar-notifications:::notificationrule/01234abcde).

Returns

INotificationRule

Implements

INotificationRule
IResource
IConstruct
Constructs.IConstruct
IDependable
Back to top Generated by DocFX