Skip to content
v2.277.0

ProjectNotifyOnOptions Struct ​

Additional options to pass to the notification rule.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codebuild as codebuild } from 'aws-cdk-lib';
import { aws_codestarnotifications as codestarnotifications } from 'aws-cdk-lib';
const projectNotifyOnOptions: codebuild.ProjectNotifyOnOptions = {
  events: [codebuild.ProjectNotificationEvents.BUILD_FAILED],

  // the properties below are optional
  createdBy: 'createdBy',
  detailType: codestarnotifications.DetailType.BASIC,
  enabled: false,
  notificationRuleName: 'notificationRuleName',
};
python
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_codebuild as codebuild
from aws_cdk import aws_codestarnotifications as codestarnotifications

project_notify_on_options = codebuild.ProjectNotifyOnOptions(
    events=[codebuild.ProjectNotificationEvents.BUILD_FAILED],

    # the properties below are optional
    created_by="createdBy",
    detail_type=codestarnotifications.DetailType.BASIC,
    enabled=False,
    notification_rule_name="notificationRuleName"
)
java
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import software.amazon.awscdk.services.codebuild.*;
import software.amazon.awscdk.services.codestarnotifications.*;

ProjectNotifyOnOptions projectNotifyOnOptions = ProjectNotifyOnOptions.builder()
        .events(List.of(ProjectNotificationEvents.BUILD_FAILED))

        // the properties below are optional
        .createdBy("createdBy")
        .detailType(DetailType.BASIC)
        .enabled(false)
        .notificationRuleName("notificationRuleName")
        .build();
csharp
// Install: dotnet add package Amazon.CDK.Lib
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
using Amazon.CDK.AWS.CodeBuild;
using Amazon.CDK.AWS.CodeStarNotifications;

var projectNotifyOnOptions = new ProjectNotifyOnOptions {
    Events = new [] { ProjectNotificationEvents.BUILD_FAILED },

    // the properties below are optional
    CreatedBy = "createdBy",
    DetailType = DetailType.BASIC,
    Enabled = false,
    NotificationRuleName = "notificationRuleName"
};
go
// Install: go get github.com/aws/aws-cdk-go/awscdk/v2
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import "github.com/aws/aws-cdk-go/awscdk"
import "github.com/aws/aws-cdk-go/awscdk"

projectNotifyOnOptions := &ProjectNotifyOnOptions{
	Events: []ProjectNotificationEvents{
		awscdk.Aws_codebuild.ProjectNotificationEvents_BUILD_FAILED,
	},

	// the properties below are optional
	CreatedBy: jsii.String("createdBy"),
	DetailType: awscdk.Aws_codestarnotifications.DetailType_BASIC,
	Enabled: jsii.Boolean(false),
	NotificationRuleName: jsii.String("notificationRuleName"),
}

Properties ​

createdByoptionalstringcreated_byoptionalstrcreatedByoptionalStringCreatedByoptionalstringCreatedByoptional*string #
The name or email alias of the person who created the notification rule.

Default: No alias provided

If not specified, it means that the creator's alias is not provided.

detailTypeoptionalDetailTypedetail_typeoptionalDetailTypedetailTypeoptionalDetailTypeDetailTypeoptionalDetailTypeDetailTypeoptionalDetailType = DetailType.FULL #
The level of detail to include in the notifications for this resource.
notes

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.

enabledoptionalbooleanenabledoptionalboolenabledoptionalBooleanEnabledoptionalboolEnabledoptional*bool = true #
The status of the notification rule.

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

A list of event types associated with this notification rule for CodeBuild Project.

For a complete list of event types and IDs, see Notification concepts in the Developer Tools Console User Guide.

notificationRuleNameoptionalstringnotification_rule_nameoptionalstrnotificationRuleNameoptionalStringNotificationRuleNameoptionalstringNotificationRuleNameoptional*string #
The name for the notification rule.

Default: generated from the id

Notification rule names must be unique in your AWS account.