Skip to content
v2.278.0

NotificationConfigurationProperty Struct ​

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 and Granting Permissions to Publish Event Notification Messages to a Destination .

Example ​

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
# 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
// 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();
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"
                } }
            }
        }
    } }
};
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 ​

eventBridgeConfigurationoptionalIResolvable | CfnBucket.EventBridgeConfigurationPropertyevent_bridge_configurationoptionaltyping.Union[IResolvable, EventBridgeConfigurationProperty]eventBridgeConfigurationoptionalIResolvableEventBridgeConfigurationoptionalIResolvableEventBridgeConfigurationoptionalinterface{} #
Enables delivery of events to Amazon EventBridge.
lambdaConfigurationsoptionalIResolvable | IResolvable | CfnBucket.LambdaConfigurationProperty[]lambda_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LambdaConfigurationProperty]]]lambdaConfigurationsoptionalIResolvableLambdaConfigurationsoptionalIResolvableLambdaConfigurationsoptionalinterface{} #
Describes the AWS Lambda functions to invoke and the events for which to invoke them.
queueConfigurationsoptionalIResolvable | IResolvable | CfnBucket.QueueConfigurationProperty[]queue_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, QueueConfigurationProperty]]]queueConfigurationsoptionalIResolvableQueueConfigurationsoptionalIResolvableQueueConfigurationsoptionalinterface{} #
The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.
topicConfigurationsoptionalIResolvable | IResolvable | CfnBucket.TopicConfigurationProperty[]topic_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TopicConfigurationProperty]]]topicConfigurationsoptionalIResolvableTopicConfigurationsoptionalIResolvableTopicConfigurationsoptionalinterface{} #
The topic to which notifications are sent and the events for which notifications are generated.