# CfnEventSubscriptionProps

Struct · External

Properties for defining a `CfnEventSubscription`.

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

- Source: Generated at build time

## Example

TypeScript:

```ts
// The code below shows an example of how to instantiate this type.
// The values are placeholders you should change.
import { aws_dms as dms } from 'aws-cdk-lib';
const cfnEventSubscriptionProps: dms.CfnEventSubscriptionProps = {
  snsTopicArn: 'snsTopicArn',

  // the properties below are optional
  enabled: false,
  eventCategories: ['eventCategories'],
  sourceIds: ['sourceIds'],
  sourceType: 'sourceType',
  subscriptionName: 'subscriptionName',
  tags: [{
    key: 'key',
    value: 'value',
  }],
};
```

Python:

```python
from aws_cdk import CfnTag
# The code below shows an example of how to instantiate this type.
# The values are placeholders you should change.
from aws_cdk import aws_dms as dms

cfn_event_subscription_props = dms.CfnEventSubscriptionProps(
    sns_topic_arn="snsTopicArn",

    # the properties below are optional
    enabled=False,
    event_categories=["eventCategories"],
    source_ids=["sourceIds"],
    source_type="sourceType",
    subscription_name="subscriptionName",
    tags=[CfnTag(
        key="key",
        value="value"
    )]
)
```

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.dms.*;

CfnEventSubscriptionProps cfnEventSubscriptionProps = CfnEventSubscriptionProps.builder()
        .snsTopicArn("snsTopicArn")

        // the properties below are optional
        .enabled(false)
        .eventCategories(List.of("eventCategories"))
        .sourceIds(List.of("sourceIds"))
        .sourceType("sourceType")
        .subscriptionName("subscriptionName")
        .tags(List.of(CfnTag.builder()
                .key("key")
                .value("value")
                .build()))
        .build();
```

C#:

```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.DMS;

var cfnEventSubscriptionProps = new CfnEventSubscriptionProps {
    SnsTopicArn = "snsTopicArn",

    // the properties below are optional
    Enabled = false,
    EventCategories = new [] { "eventCategories" },
    SourceIds = new [] { "sourceIds" },
    SourceType = "sourceType",
    SubscriptionName = "subscriptionName",
    Tags = new [] { new CfnTag {
        Key = "key",
        Value = "value"
    } }
};
```

Go:

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

cfnEventSubscriptionProps := &CfnEventSubscriptionProps{
	SnsTopicArn: jsii.String("snsTopicArn"),

	// the properties below are optional
	Enabled: jsii.Boolean(false),
	EventCategories: []*string{
		jsii.String("eventCategories"),
	},
	SourceIds: []*string{
		jsii.String("sourceIds"),
	},
	SourceType: jsii.String("sourceType"),
	SubscriptionName: jsii.String("subscriptionName"),
	Tags: []CfnTag{
		&CfnTag{
			Key: jsii.String("key"),
			Value: jsii.String("value"),
		},
	},
}
```

## Properties

- `enabled`: boolean | [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) — Indicates whether to activate the subscription.

  If you don't specify this property, CloudFormation activates the subscription.

- `eventCategories`: string[] — A list of event categories for a source type that you want to subscribe to.

  If you don't specify this property, you are notified about all event categories. For more information, see [Working with Events and Notifications](https://docs.aws.amazon.com//dms/latest/userguide/CHAP_Events.html) in the *AWS DMS User Guide* .

- `snsTopicArn`: string (required) — The Amazon Resource Name (ARN) of the Amazon SNS topic created for event notification.

  The ARN is created by Amazon SNS when you create a topic and subscribe to it.

- `sourceIds`: string[] — A list of identifiers for which AWS DMS provides notification events.

  If you don't specify a value, notifications are provided for all sources.

  If you specify multiple values, they must be of the same type. For example, if you specify a database instance ID, then all of the other values must be database instance IDs.

- `sourceType`: string — The type of AWS DMS resource that generates the events.

  For example, if you want to be notified of events generated by a replication instance, you set this parameter to `replication-instance` . If this value isn't specified, all events are returned.

  *Valid values* : `replication-instance` | `replication-task`

- `subscriptionName`: string — The name of the AWS DMS event notification subscription.

  This name must be less than 255 characters.

- `tags`: [CfnTag](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.CfnTag.html)[] — One or more tags to be assigned to the event subscription.
