# CfnNotificationRuleProps

Properties for defining a `CfnNotificationRule`.

Used as props by: [CfnNotificationRule](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codestarnotifications.CfnNotificationRule.html)

- Source: Generated at build time
- Type last changed: v2.70.0 · 22 Mar 2023

## Example

TypeScript:

```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:

```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:

```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();
```

C# / .NET:

```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"
};
```

Golang:

```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

- `createdBy`: string — The name or email alias of the person who created the notification rule.

- `detailType`: string (required) — 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.

- `eventTypeId`: string — The event type associated with this notification rule.

  For a complete list of event types and IDs, see [Notification concepts](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .

- `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](https://docs.aws.amazon.com/dtconsole/latest/userguide/concepts.html#concepts-api) in the *Developer Tools Console User Guide* .

- `name`: string (required) — The name for the notification rule.

  Notification rule names must be unique in your AWS account .

- `resource`: 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 .

- `status`: 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.

- `tags`: { [key: string]: string } — A list of tags to apply to this notification rule.

  Key names cannot start with " `aws` ".

- `targetAddress`: string — The Amazon Resource Name (ARN) of the Amazon topic or client.

- `targets`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnNotificationRule.TargetProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_codestarnotifications.CfnNotificationRule.TargetProperty.html)[] (required) — A list of Amazon Resource Names (ARNs) of Amazon topics and clients to associate with the notification rule.
