AWS::CodeStarNotifications::NotificationRule
Creates a notification rule for a resource. The rule specifies the events you want notifications about and the targets (such as Amazon Chatbot topics or Amazon Chatbot clients configured for Slack) where you want to receive them.
Syntax
To declare this entity in your Amazon 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:StringDetailType:StringEventTypeId:StringEventTypeIds:- StringName:StringResource:StringStatus:StringTags:TargetAddress:Key:ValueStringTargets:- Target
Properties
CreatedByProperty description not available.
Required: No
Type: String
Update requires: No interruption
DetailType-
The level of detail to include in the notifications for this resource.
BASICwill include only the contents of the event as it would appear in Amazon CloudWatch.FULLwill 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 | FULLUpdate requires: No interruption
EventTypeIdProperty 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 Amazon Web Services account.
Required: Yes
Type: String
Minimum:
1Maximum:
64Pattern:
[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 Amazon CodePipeline, repositories in Amazon CodeCommit, and build projects in Amazon 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 | ENABLEDUpdate 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
TargetAddressProperty 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 Amazon Chatbot clients to associate with the notification rule.
Required: Yes
Type: List of Target
Maximum:
10Update 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