Skip to content
v2.278.0

CfnNotificationRuleProps Struct ​

Properties for defining a CfnNotificationRule.

Example ​

ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_codestarnotifications as codestarnotifications } from 'aws-cdk-lib';
const cfnNotificationRuleProps: codestarnotifications.CfnNotificationRuleProps = {
  detailType: 'detailType',
  eventTypeIds: ['eventTypeIds'],
  name: 'name',
  resource: 'resource',
  targets: [{
    targetAddress: 'targetAddress',
    targetType: 'targetType',
  }],

  // the properties below are optional
  createdBy: 'createdBy',
  eventTypeId: 'eventTypeId',
  status: 'status',
  tags: {
    tagsKey: 'tags',
  },
  targetAddress: 'targetAddress',
};
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_codestarnotifications as codestarnotifications

cfn_notification_rule_props = codestarnotifications.CfnNotificationRuleProps(
    detail_type="detailType",
    event_type_ids=["eventTypeIds"],
    name="name",
    resource="resource",
    targets=[codestarnotifications.CfnNotificationRule.TargetProperty(
        target_address="targetAddress",
        target_type="targetType"
    )],

    # the properties below are optional
    created_by="createdBy",
    event_type_id="eventTypeId",
    status="status",
    tags={
        "tags_key": "tags"
    },
    target_address="targetAddress"
)
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.codestarnotifications.*;

CfnNotificationRuleProps cfnNotificationRuleProps = CfnNotificationRuleProps.builder()
        .detailType("detailType")
        .eventTypeIds(List.of("eventTypeIds"))
        .name("name")
        .resource("resource")
        .targets(List.of(TargetProperty.builder()
                .targetAddress("targetAddress")
                .targetType("targetType")
                .build()))

        // the properties below are optional
        .createdBy("createdBy")
        .eventTypeId("eventTypeId")
        .status("status")
        .tags(Map.of(
                "tagsKey", "tags"))
        .targetAddress("targetAddress")
        .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.CodeStarNotifications;

var cfnNotificationRuleProps = new CfnNotificationRuleProps {
    DetailType = "detailType",
    EventTypeIds = new [] { "eventTypeIds" },
    Name = "name",
    Resource = "resource",
    Targets = new [] { new TargetProperty {
        TargetAddress = "targetAddress",
        TargetType = "targetType"
    } },

    // the properties below are optional
    CreatedBy = "createdBy",
    EventTypeId = "eventTypeId",
    Status = "status",
    Tags = new Dictionary<string, string> {
        { "tagsKey", "tags" }
    },
    TargetAddress = "targetAddress"
};
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"

cfnNotificationRuleProps := &CfnNotificationRuleProps{
	DetailType: jsii.String("detailType"),
	EventTypeIds: []*string{
		jsii.String("eventTypeIds"),
	},
	Name: jsii.String("name"),
	Resource: jsii.String("resource"),
	Targets: []interface{}{
		&TargetProperty{
			TargetAddress: jsii.String("targetAddress"),
			TargetType: jsii.String("targetType"),
		},
	},

	// the properties below are optional
	CreatedBy: jsii.String("createdBy"),
	EventTypeId: jsii.String("eventTypeId"),
	Status: jsii.String("status"),
	Tags: map[string]*string{
		"tagsKey": jsii.String("tags"),
	},
	TargetAddress: jsii.String("targetAddress"),
}

Properties ​

createdByoptionalstringcreated_byoptionalstrcreatedByoptionalStringCreatedByoptionalstringCreatedByoptional*string #
The name or email alias of the person who created the notification rule.
detailTypestringdetail_typestrdetailTypeStringDetailTypestringDetailType*string required #
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 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.

eventTypeIdoptionalstringevent_type_idoptionalstreventTypeIdoptionalStringEventTypeIdoptionalstringEventTypeIdoptional*string #
The event type associated with this notification rule.

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

eventTypeIdsstring[]event_type_idstyping.List[str]eventTypeIdsList<String>EventTypeIdsstring[]EventTypeIds*[]*string required #
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 .

namestringnamestrnameStringNamestringName*string required #
The name for the notification rule.

Notification rule names must be unique in your AWS account .

resourcestringresourcestrresourceStringResourcestringResource*string required #
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 .

statusoptionalstringstatusoptionalstrstatusoptionalStringStatusoptionalstringStatusoptional*string #
The status of the notification rule.

The default value is ENABLED . If the status is set to DISABLED , notifications aren't sent for the notification rule.

tagsoptional{ [key: string]: string }tagsoptionaltyping.Mapping[str, str]tagsoptionalMap<String, String>TagsoptionalIDictionary<string, string>Tagsoptional*map[string]*string #
A list of tags to apply to this notification rule.

Key names cannot start with " aws ".

targetAddressoptionalstringtarget_addressoptionalstrtargetAddressoptionalStringTargetAddressoptionalstringTargetAddressoptional*string #
The Amazon Resource Name (ARN) of the Amazon topic or client.
targetsIResolvable | IResolvable | CfnNotificationRule.TargetProperty[]targetstyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TargetProperty]]]targetsIResolvableTargetsIResolvableTargetsinterface{} required #
A list of Amazon Resource Names (ARNs) of Amazon topics and clients to associate with the notification rule.