The CDK Construct Library for AWS::CodeStarNotifications
Project description
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:
SNS
: specify event and notify to SNS topic.AWS Chatbot
: specify event and notify to slack channel and only supportSlackChannelConfiguration
.
Examples
# Example automatically generated without compilation. See https://github.com/aws/jsii/issues/826
import aws_cdk.aws_codestarnotifications as notifications
import aws_cdk.aws_codebuild as codebuild
import aws_cdk.aws_sns as sns
import aws_cdk.aws_chatbot as chatbot
project = codebuild.PipelineProject(stack, "MyProject")
topic = sns.Topic(stack, "MyTopic1")
slack = chatbot.SlackChannelConfiguration(stack, "MySlackChannel",
slack_channel_configuration_name="YOUR_CHANNEL_NAME",
slack_workspace_id="YOUR_SLACK_WORKSPACE_ID",
slack_channel_id="YOUR_SLACK_CHANNEL_ID"
)
rule = notifications.NotificationRule(stack, "NotificationRule",
source=project,
events=["codebuild-project-build-state-succeeded", "codebuild-project-build-state-failed"
],
targets=[topic]
)
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:
AWS CodeBuild
: support codebuild project to trigger notification when event specified.AWS CodePipeline
: support codepipeline to trigger notification when event specified.
Events
For the complete list of supported event types for CodeBuild and CodePipeline, see:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for aws-cdk.aws-codestarnotifications-1.129.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 00b49be64aa494102b13fb78d94041e5e2aefad392fd8d73fda145e97ec8bd42 |
|
MD5 | c7d771cbd98998e6afa7a021fc4b1678 |
|
BLAKE2b-256 | 9bd9be582b730957bb198485b3658ea11b4557cf64839e50a3dc14c25eb6b0dc |
Hashes for aws_cdk.aws_codestarnotifications-1.129.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4213ff61c93ec33503ed76903f73f771fe298dd49c2e82bb857c729e3f531f1a |
|
MD5 | 945a96cc31a99da7f2f1be4c1d66e037 |
|
BLAKE2b-256 | 5971d4285dcbe4a64037280e862078252c22e3cf55fbc8afa19234692e6d7d6d |