# NotificationConfigurationProperty

Describes the notification configuration for an Amazon S3 bucket.

> If you create the target resource and related permissions in the same template, you might have a circular dependency.
>
> For example, you might use the `AWS::Lambda::Permission` resource to grant the bucket permission to invoke an AWS Lambda function. However, AWS CloudFormation can't create the bucket until the bucket has permission to invoke the function ( AWS CloudFormation checks whether the bucket can invoke the function). If you're using Refs to pass the bucket name, this leads to a circular dependency.
>
> To avoid this dependency, you can create all resources without specifying the notification configuration. Then, update the stack with a notification configuration.
>
> For more information on permissions, see [AWS::Lambda::Permission](https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-lambda-permission.html) and [Granting Permissions to Publish Event Notification Messages to a Destination](https://docs.aws.amazon.com/AmazonS3/latest/dev/NotificationHowTo.html#grant-destinations-permissions-to-s3) .

- 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 notificationConfigurationProperty: s3.CfnBucket.NotificationConfigurationProperty = {
  eventBridgeConfiguration: {
    eventBridgeEnabled: false,
  },
  lambdaConfigurations: [{
    event: 'event',
    function: 'function',

    // the properties below are optional
    filter: {
      s3Key: {
        rules: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
  }],
  queueConfigurations: [{
    event: 'event',
    queue: 'queue',

    // the properties below are optional
    filter: {
      s3Key: {
        rules: [{
          name: 'name',
          value: 'value',
        }],
      },
    },
  }],
  topicConfigurations: [{
    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

notification_configuration_property = s3.CfnBucket.NotificationConfigurationProperty(
    event_bridge_configuration=s3.CfnBucket.EventBridgeConfigurationProperty(
        event_bridge_enabled=False
    ),
    lambda_configurations=[s3.CfnBucket.LambdaConfigurationProperty(
        event="event",
        function="function",

        # the properties below are optional
        filter=s3.CfnBucket.NotificationFilterProperty(
            s3_key=s3.CfnBucket.S3KeyFilterProperty(
                rules=[s3.CfnBucket.FilterRuleProperty(
                    name="name",
                    value="value"
                )]
            )
        )
    )],
    queue_configurations=[s3.CfnBucket.QueueConfigurationProperty(
        event="event",
        queue="queue",

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

NotificationConfigurationProperty notificationConfigurationProperty = NotificationConfigurationProperty.builder()
        .eventBridgeConfiguration(EventBridgeConfigurationProperty.builder()
                .eventBridgeEnabled(false)
                .build())
        .lambdaConfigurations(List.of(LambdaConfigurationProperty.builder()
                .event("event")
                .function("function")

                // the properties below are optional
                .filter(NotificationFilterProperty.builder()
                        .s3Key(S3KeyFilterProperty.builder()
                                .rules(List.of(FilterRuleProperty.builder()
                                        .name("name")
                                        .value("value")
                                        .build()))
                                .build())
                        .build())
                .build()))
        .queueConfigurations(List.of(QueueConfigurationProperty.builder()
                .event("event")
                .queue("queue")

                // the properties below are optional
                .filter(NotificationFilterProperty.builder()
                        .s3Key(S3KeyFilterProperty.builder()
                                .rules(List.of(FilterRuleProperty.builder()
                                        .name("name")
                                        .value("value")
                                        .build()))
                                .build())
                        .build())
                .build()))
        .topicConfigurations(List.of(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()))
        .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 notificationConfigurationProperty = new NotificationConfigurationProperty {
    EventBridgeConfiguration = new EventBridgeConfigurationProperty {
        EventBridgeEnabled = false
    },
    LambdaConfigurations = new [] { new LambdaConfigurationProperty {
        Event = "event",
        Function = "function",

        // the properties below are optional
        Filter = new NotificationFilterProperty {
            S3Key = new S3KeyFilterProperty {
                Rules = new [] { new FilterRuleProperty {
                    Name = "name",
                    Value = "value"
                } }
            }
        }
    } },
    QueueConfigurations = new [] { new QueueConfigurationProperty {
        Event = "event",
        Queue = "queue",

        // the properties below are optional
        Filter = new NotificationFilterProperty {
            S3Key = new S3KeyFilterProperty {
                Rules = new [] { new FilterRuleProperty {
                    Name = "name",
                    Value = "value"
                } }
            }
        }
    } },
    TopicConfigurations = new [] { 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"

notificationConfigurationProperty := &NotificationConfigurationProperty{
	EventBridgeConfiguration: &EventBridgeConfigurationProperty{
		EventBridgeEnabled: jsii.Boolean(false),
	},
	LambdaConfigurations: []interface{}{
		&LambdaConfigurationProperty{
			Event: jsii.String("event"),
			Function: jsii.String("function"),

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

			// the properties below are optional
			Filter: &NotificationFilterProperty{
				S3Key: &S3KeyFilterProperty{
					Rules: []interface{}{
						&FilterRuleProperty{
							Name: jsii.String("name"),
							Value: jsii.String("value"),
						},
					},
				},
			},
		},
	},
	TopicConfigurations: []interface{}{
		&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

- `eventBridgeConfiguration`: [IResolvable](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.IResolvable.html) | [CfnBucket.EventBridgeConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.EventBridgeConfigurationProperty.html) — Enables delivery of events to Amazon EventBridge.

- `lambdaConfigurations`: [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) | [CfnBucket.LambdaConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.LambdaConfigurationProperty.html)[] — Describes the AWS Lambda functions to invoke and the events for which to invoke them.

- `queueConfigurations`: [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) | [CfnBucket.QueueConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.QueueConfigurationProperty.html)[] — The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.

- `topicConfigurations`: [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) | [CfnBucket.TopicConfigurationProperty](https://docs.aws.amazon.com/cdk/api/v2/docs/aws-cdk-lib.aws_s3.CfnBucket.TopicConfigurationProperty.html)[] — The topic to which notifications are sent and the events for which notifications are generated.
