# TopicConfigurationProperty

A container for specifying the configuration for publication of messages to an Amazon Simple Notification Service (Amazon SNS) topic when Amazon S3 detects specified events.

- Source: Generated at build time
- Type last changed: v2.93.0 · 23 Aug 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_s3 as s3 } from 'aws-cdk-lib';
const topicConfigurationProperty: s3.CfnBucket.TopicConfigurationProperty = {
  event: 'event',
  topic: 'topic',

  // the properties below are optional
  filter: {
    s3Key: {
      rules: [{
        name: 'name',
        value: 'value',
      }],
    },
  },
};
```

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_s3 as s3

topic_configuration_property = s3.CfnBucket.TopicConfigurationProperty(
    event="event",
    topic="topic",

    # the properties below are optional
    filter=s3.CfnBucket.NotificationFilterProperty(
        s3_key=s3.CfnBucket.S3KeyFilterProperty(
            rules=[s3.CfnBucket.FilterRuleProperty(
                name="name",
                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.s3.*;

TopicConfigurationProperty topicConfigurationProperty = TopicConfigurationProperty.builder()
        .event("event")
        .topic("topic")

        // the properties below are optional
        .filter(NotificationFilterProperty.builder()
                .s3Key(S3KeyFilterProperty.builder()
                        .rules(List.of(FilterRuleProperty.builder()
                                .name("name")
                                .value("value")
                                .build()))
                        .build())
                .build())
        .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.S3;

var topicConfigurationProperty = new TopicConfigurationProperty {
    Event = "event",
    Topic = "topic",

    // the properties below are optional
    Filter = new NotificationFilterProperty {
        S3Key = new S3KeyFilterProperty {
            Rules = new [] { new FilterRuleProperty {
                Name = "name",
                Value = "value"
            } }
        }
    }
};
```

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"

topicConfigurationProperty := &TopicConfigurationProperty{
	Event: jsii.String("event"),
	Topic: jsii.String("topic"),

	// the properties below are optional
	Filter: &NotificationFilterProperty{
		S3Key: &S3KeyFilterProperty{
			Rules: []interface{}{
				&FilterRuleProperty{
					Name: jsii.String("name"),
					Value: jsii.String("value"),
				},
			},
		},
	},
}
```

## Properties

- `event`: string (required) — The Amazon S3 bucket event about which to send notifications.

  For more information, see [Supported Event Types](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html) in the *Amazon S3 User Guide* .

- `filter`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnBucket.NotificationFilterProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.NotificationFilterProperty.html) — The filtering rules that determine for which objects to send notifications.

  For example, you can create a filter so that Amazon S3 sends notifications only when image files with a `.jpg` extension are added to the bucket.

- `topic`: string (required) — The Amazon Resource Name (ARN) of the Amazon SNS topic to which Amazon S3 publishes a message when it detects events of the specified type.
