AWSCDK::CodeStarNotifications

11 types

AWS CodeStarNotifications Construct Library

This module is part of the AWS Cloud Development Kit project.

NotificationRule

The NotificationRule construct defines an AWS CodeStarNotifications rule. The rule specifies the events you want notifications about and the targets (such as Amazon SNS topics or AWS Chatbot clients configured for Slack) where you want to receive them. Notification targets are objects that implement the INotificationRuleTarget interface and notification source is object that implement the INotificationRuleSource interface.

Notification Targets

This module includes classes that implement the INotificationRuleTarget interface for SNS and slack in AWS Chatbot.

The following targets are supported:

Examples

require 'aws-cdk-lib'


project = AWSCDK::CodeBuild::PipelineProject.new(self, "MyProject")

topic = AWSCDK::SNS::Topic.new(self, "MyTopic1")

slack = AWSCDK::Chatbot::SlackChannelConfiguration.new(self, "MySlackChannel", {
    slack_channel_configuration_name: "YOUR_CHANNEL_NAME",
    slack_workspace_id: "YOUR_SLACK_WORKSPACE_ID",
    slack_channel_id: "YOUR_SLACK_CHANNEL_ID",
})

rule = AWSCDK::CodeStarNotifications::NotificationRule.new(self, "NotificationRule", {
    source: project,
    events: [
        "codebuild-project-build-state-succeeded",
        "codebuild-project-build-state-failed",
    ],
    targets: [topic],
    notification_rule_name: "MyNotificationRuleName",
    enabled: true,
     # The default is true
    detail_type: AWSCDK::CodeStarNotifications::DetailType::FULL,
     # The default is FULL
    created_by: "Jone Doe",
})
rule.add_target(slack)

Notification Source

This module includes classes that implement the INotificationRuleSource interface for AWS CodeBuild, AWS CodePipeline and will support AWS CodeCommit, AWS CodeDeploy in future.

The following sources are supported:

Events

For the complete list of supported event types for CodeBuild and CodePipeline, see:

API Reference

Classes 2

CfnNotificationRuleCreates a notification rule for a resource. NotificationRuleA new notification rule.

Interfaces 8

CfnNotificationRulePropsProperties for defining a `CfnNotificationRule`. INotificationRuleRepresents a notification rule. INotificationRuleSourceRepresents a notification source The source that allows CodeBuild and CodePipeline to asso INotificationRuleTargetRepresents a notification target That allows AWS Chatbot and SNS topic to associate with t NotificationRuleOptionsStandard set of options for `notifyOnXxx` codestar notification handler on construct. NotificationRulePropsProperties for a new notification rule. NotificationRuleSourceConfigInformation about the Codebuild or CodePipeline associated with a notification source. NotificationRuleTargetConfigInformation about the SNS topic or AWS Chatbot client associated with a notification targe

Enums 1

DetailTypeThe level of detail to include in the notifications for this resource.