AWS::CodeStarNotifications::NotificationRule
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as AWS Chatbot topics or AWS Chatbot clients configured for Slack) where you want to receive them.
Syntax
To declare this entity in your AWS CloudFormation template, use the following syntax:
JSON
{ "Type" : "AWS::CodeStarNotifications::NotificationRule", "Properties" : { "CreatedBy" :
String
, "DetailType" :String
, "EventTypeId" :String
, "EventTypeIds" :[ String, ... ]
, "Name" :String
, "Resource" :String
, "Status" :String
, "Tags" :{
, "TargetAddress" :Key
:Value
, ...}String
, "Targets" :[ Target, ... ]
} }
YAML
Type: AWS::CodeStarNotifications::NotificationRule Properties: CreatedBy:
String
DetailType:String
EventTypeId:String
EventTypeIds:- String
Name:String
Resource:String
Status:String
Tags:TargetAddress:
Key
:Value
String
Targets:- Target
Properties
CreatedBy
Property description not available.
Required: No
Type: String
Update requires: No interruption
DetailType
-
The level of detail to include in the notifications for this resource.
BASIC
will include only the contents of the event as it would appear in Amazon CloudWatch.FULL
will include any supplemental information provided by AWS CodeStar Notifications and/or the service for the resource for which the notification is created.Required: Yes
Type: String
Allowed values:
BASIC | FULL
Update requires: No interruption
EventTypeId
Property description not available.
Required: No
Type: String
Update requires: No interruption
EventTypeIds
-
A list of event types associated with this notification rule. For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide.
Required: Yes
Type: List of String
Update requires: No interruption
Name
-
The name for the notification rule. Notification rule names must be unique in your AWS account.
Required: Yes
Type: String
Minimum:
1
Maximum:
64
Pattern:
[A-Za-z0-9\-_ ]+$
Update requires: No interruption
Resource
-
The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Supported resources include pipelines in AWS CodePipeline, repositories in AWS CodeCommit, and build projects in AWS CodeBuild.
Required: Yes
Type: String
Pattern:
^arn:aws[^:\s]*:[^:\s]*:[^:\s]*:[0-9]{12}:[^\s]+$
Update requires: Replacement
Status
-
The status of the notification rule. The default value is
ENABLED
. If the status is set toDISABLED
, notifications aren't sent for the notification rule.Required: No
Type: String
Allowed values:
DISABLED | ENABLED
Update requires: No interruption
Tags
-
A list of tags to apply to this notification rule. Key names cannot start with "
aws
".Required: No
Type: Map of String
Update requires: No interruption
TargetAddress
Property description not available.
Required: No
Type: String
Update requires: No interruption
Targets
-
A list of Amazon Resource Names (ARNs) of Amazon Simple Notification Service topics and AWS Chatbot clients to associate with the notification rule.
Required: Yes
Type: List of Target
Maximum:
10
Update requires: No interruption
Return values
Ref
When the logical ID of this resource is provided to the Ref intrinsic function, Ref
returns the notification rule ARN.
Fn::GetAtt
Examples
Example
The following example creates a notification rule with a name of My Notification Rule for Comments on Commits. The notification rule is tagged with a key-value pair indicating what team owns the rule.
JSON
{ "Type": "AWS::CodeStarNotifications::NotificationRule", "Properties": { "Name": "My Notification Rule for Comments on Commits", "DetailType": "FULL", "Resource": "arn:aws:codecommit:us-east-2:123456789012:MyDemoRepo", "EventTypeIds": [ "codecommit-repository-comments-on-commits" ], "Targets": [ { "TargetType": "SNS", "TargetAddress": "arn:aws:sns:us-east-2:123456789012:MyNotificationTopic" } ], "Tags": { "Team": "Saanvi" } } }
YAML
Type: 'AWS::CodeStarNotifications::NotificationRule' Properties: Name: 'My Notification Rule for Comments on Commits' DetailType: FULL Resource: 'arn:aws:codecommit:us-east-2:123456789012:MyDemoRepo' EventTypeIds: - codecommit-repository-comments-on-commits Targets: - TargetType: SNS TargetAddress: 'arn:aws:sns:us-east-2:123456789012:MyNotificationTopic' Tags: Team: Saanvi