AWS Fundamentals Logo
AWS Fundamentals
L2 Construct

NotificationRule

A new notification rule.

Import

import { NotificationRule } from 'aws-cdk-lib/aws-codestarnotifications';

Or use the module namespace:

import * as codestarnotifications from 'aws-cdk-lib/aws-codestarnotifications';
// codestarnotifications.NotificationRule

Properties

Configuration passed to the constructor as NotificationRuleProps.

eventsRequired
string[]

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.

sourceRequired
INotificationRuleSource

The Amazon Resource Name (ARN) of the resource to associate with the notification rule. Currently, Supported sources include pipelines in AWS CodePipeline, build projects in AWS CodeBuild, and repositories in AWS CodeCommit in this L2 constructor.

targetsOptional
INotificationRuleTarget[]

The targets to register for the notification destination.

Default: - No targets are added to the rule. Use `addTarget()` to add a target.

4 properties inherited from NotificationRuleOptions
createdByOptionalinherited from NotificationRuleOptions
string

The name or email alias of the person who created the notification rule. If not specified, it means that the creator's alias is not provided.

Default: - No alias provided

detailTypeOptionalinherited from NotificationRuleOptions
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 AWS 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.

Default: DetailType.FULL

enabledOptionalinherited from NotificationRuleOptions
boolean

The status of the notification rule. If the enabled is set to DISABLED, notifications aren't sent for the notification rule.

Default: true

notificationRuleNameOptionalinherited from NotificationRuleOptions
string

The name for the notification rule. Notification rule names must be unique in your AWS account.

Default: - generated from the `id`

Learn AWS the Practical Way

Our bi-weekly newsletter teaches hands-on AWS fundamentals. No certification fluff - just practical knowledge.

Subscribe to Newsletter

Quick Facts

LevelL2 (Higher-level)
Moduleaws-codestarnotifications
Properties7

Related Constructs

External Links