Skip to main content

The CDK Construct Library for AWS::CodeStarNotifications

Project description

AWS CodeStarNotifications Construct Library

---

End-of-Support

AWS CDK v1 has reached End-of-Support on 2023-06-01. This package is no longer being updated, and users should migrate to AWS CDK v2.

For more information on how to migrate, see the Migrating to AWS CDK v2 guide.


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 support SlackChannelConfiguration.

Examples

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(self, "MyProject")

topic = sns.Topic(self, "MyTopic1")

slack = chatbot.SlackChannelConfiguration(self, "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(self, "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

File details

Details for the file aws-cdk.aws-codestarnotifications-1.204.0.tar.gz.

File metadata

File hashes

Hashes for aws-cdk.aws-codestarnotifications-1.204.0.tar.gz
Algorithm Hash digest
SHA256 b802ceae4726ee5870a1a364caa6e37cc9f4218da171804cd75f620f8ee23185
MD5 907ab2813d5a1fee9607eb8e5027bba7
BLAKE2b-256 aea555957b242d6d27bd55720455267923728931cc1c19afb50ea3e343f56df8

See more details on using hashes here.

File details

Details for the file aws_cdk.aws_codestarnotifications-1.204.0-py3-none-any.whl.

File metadata

File hashes

Hashes for aws_cdk.aws_codestarnotifications-1.204.0-py3-none-any.whl
Algorithm Hash digest
SHA256 34214038c4ec86e964f4c43f4d35af54efee991ebd7fa22430a12ee7928297b6
MD5 79715202cb284e52beebdccc9fb4fe19
BLAKE2b-256 d275368be51a373cff49ab6dad86865dcdb0f2c7065993b91768fc3884f2fb2d

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page