# AWS CodeStarNotifications Construct Library
<!--BEGIN STABILITY BANNER-->---
![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)
---
<!--END STABILITY BANNER-->
This module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) 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
```python
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:
* [Events for notification rules on build projects](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#events-ref-buildproject).
* [Events for notification rules on pipelines](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#events-ref-pipeline).
Raw data
{
"_id": null,
"home_page": "https://github.com/aws/aws-cdk",
"name": "aws-cdk.aws-codestarnotifications",
"maintainer": "",
"docs_url": null,
"requires_python": "~=3.7",
"maintainer_email": "",
"keywords": "",
"author": "Amazon Web Services",
"author_email": "",
"download_url": "https://files.pythonhosted.org/packages/3c/f4/991245259239cdbefe0820b2ddc371a2201241208a980b39cbcb630fae61/aws-cdk.aws-codestarnotifications-1.203.0.tar.gz",
"platform": null,
"description": "# AWS CodeStarNotifications Construct Library\n\n<!--BEGIN STABILITY BANNER-->---\n\n\n![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)\n\n![cfn-resources: Stable](https://img.shields.io/badge/cfn--resources-stable-success.svg?style=for-the-badge)\n\n---\n<!--END STABILITY BANNER-->\n\nThis module is part of the [AWS Cloud Development Kit](https://github.com/aws/aws-cdk) project.\n\n## NotificationRule\n\nThe `NotificationRule` construct defines an AWS CodeStarNotifications rule.\nThe rule specifies the events you want notifications about and the targets\n(such as Amazon SNS topics or AWS Chatbot clients configured for Slack)\nwhere you want to receive them.\nNotification targets are objects that implement the `INotificationRuleTarget`\ninterface and notification source is object that implement the `INotificationRuleSource` interface.\n\n## Notification Targets\n\nThis module includes classes that implement the `INotificationRuleTarget` interface for SNS and slack in AWS Chatbot.\n\nThe following targets are supported:\n\n* `SNS`: specify event and notify to SNS topic.\n* `AWS Chatbot`: specify event and notify to slack channel and only support `SlackChannelConfiguration`.\n\n## Examples\n\n```python\nimport aws_cdk.aws_codestarnotifications as notifications\nimport aws_cdk.aws_codebuild as codebuild\nimport aws_cdk.aws_sns as sns\nimport aws_cdk.aws_chatbot as chatbot\n\n\nproject = codebuild.PipelineProject(self, \"MyProject\")\n\ntopic = sns.Topic(self, \"MyTopic1\")\n\nslack = chatbot.SlackChannelConfiguration(self, \"MySlackChannel\",\n slack_channel_configuration_name=\"YOUR_CHANNEL_NAME\",\n slack_workspace_id=\"YOUR_SLACK_WORKSPACE_ID\",\n slack_channel_id=\"YOUR_SLACK_CHANNEL_ID\"\n)\n\nrule = notifications.NotificationRule(self, \"NotificationRule\",\n source=project,\n events=[\"codebuild-project-build-state-succeeded\", \"codebuild-project-build-state-failed\"\n ],\n targets=[topic]\n)\nrule.add_target(slack)\n```\n\n## Notification Source\n\nThis module includes classes that implement the `INotificationRuleSource` interface for AWS CodeBuild,\nAWS CodePipeline and will support AWS CodeCommit, AWS CodeDeploy in future.\n\nThe following sources are supported:\n\n* `AWS CodeBuild`: support codebuild project to trigger notification when event specified.\n* `AWS CodePipeline`: support codepipeline to trigger notification when event specified.\n\n## Events\n\nFor the complete list of supported event types for CodeBuild and CodePipeline, see:\n\n* [Events for notification rules on build projects](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#events-ref-buildproject).\n* [Events for notification rules on pipelines](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#events-ref-pipeline).\n\n\n",
"bugtrack_url": null,
"license": "Apache-2.0",
"summary": "The CDK Construct Library for AWS::CodeStarNotifications",
"version": "1.203.0",
"project_urls": {
"Homepage": "https://github.com/aws/aws-cdk",
"Source": "https://github.com/aws/aws-cdk.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6016d439a5e2db970d38318ecdcfcbb20b12278f5558aecb0eb305c3242c3db4",
"md5": "417d9cec29a3da4f8eaf0a5a4a380d41",
"sha256": "1f787d90816761d88bad77552bdea2dc9f4469bfce28aa5f14d3d1f213eb1c10"
},
"downloads": -1,
"filename": "aws_cdk.aws_codestarnotifications-1.203.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "417d9cec29a3da4f8eaf0a5a4a380d41",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "~=3.7",
"size": 56401,
"upload_time": "2023-05-31T22:53:50",
"upload_time_iso_8601": "2023-05-31T22:53:50.708778Z",
"url": "https://files.pythonhosted.org/packages/60/16/d439a5e2db970d38318ecdcfcbb20b12278f5558aecb0eb305c3242c3db4/aws_cdk.aws_codestarnotifications-1.203.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "3cf4991245259239cdbefe0820b2ddc371a2201241208a980b39cbcb630fae61",
"md5": "d09ff169ce0448bafe0eac842dc6b6bf",
"sha256": "77d3beb3af72570c8e930b5af96a310385860ebb1e1cafe49b96ce3c86f7b035"
},
"downloads": -1,
"filename": "aws-cdk.aws-codestarnotifications-1.203.0.tar.gz",
"has_sig": false,
"md5_digest": "d09ff169ce0448bafe0eac842dc6b6bf",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "~=3.7",
"size": 57368,
"upload_time": "2023-05-31T23:01:33",
"upload_time_iso_8601": "2023-05-31T23:01:33.128444Z",
"url": "https://files.pythonhosted.org/packages/3c/f4/991245259239cdbefe0820b2ddc371a2201241208a980b39cbcb630fae61/aws-cdk.aws-codestarnotifications-1.203.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-05-31 23:01:33",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "aws",
"github_project": "aws-cdk",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "aws-cdk.aws-codestarnotifications"
}