Interface CfnBucketPropsMixin.NotificationConfigurationProperty

All Superinterfaces:
software.amazon.jsii.JsiiSerializable
All Known Implementing Classes:
CfnBucketPropsMixin.NotificationConfigurationProperty.Jsii$Proxy
Enclosing class:
CfnBucketPropsMixin

@Stability(Stable) public static interface CfnBucketPropsMixin.NotificationConfigurationProperty extends software.amazon.jsii.JsiiSerializable
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:

 // The code below shows an example of how to instantiate this type.
 // The values are placeholders you should change.
 import software.amazon.awscdk.cfnpropertymixins.services.s3.*;
 NotificationConfigurationProperty notificationConfigurationProperty = NotificationConfigurationProperty.builder()
         .eventBridgeConfiguration(EventBridgeConfigurationProperty.builder()
                 .eventBridgeEnabled(false)
                 .build())
         .lambdaConfigurations(List.of(LambdaConfigurationProperty.builder()
                 .event("event")
                 .filter(NotificationFilterProperty.builder()
                         .s3Key(S3KeyFilterProperty.builder()
                                 .rules(List.of(FilterRuleProperty.builder()
                                         .name("name")
                                         .value("value")
                                         .build()))
                                 .build())
                         .build())
                 .function("function")
                 .build()))
         .queueConfigurations(List.of(QueueConfigurationProperty.builder()
                 .event("event")
                 .filter(NotificationFilterProperty.builder()
                         .s3Key(S3KeyFilterProperty.builder()
                                 .rules(List.of(FilterRuleProperty.builder()
                                         .name("name")
                                         .value("value")
                                         .build()))
                                 .build())
                         .build())
                 .queue("queue")
                 .build()))
         .topicConfigurations(List.of(TopicConfigurationProperty.builder()
                 .event("event")
                 .filter(NotificationFilterProperty.builder()
                         .s3Key(S3KeyFilterProperty.builder()
                                 .rules(List.of(FilterRuleProperty.builder()
                                         .name("name")
                                         .value("value")
                                         .build()))
                                 .build())
                         .build())
                 .topic("topic")
                 .build()))
         .build();
 

See Also: