public static interface CfnBucket.NotificationConfigurationProperty
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.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();
Modifier and Type | Interface and Description |
---|---|
static class |
CfnBucket.NotificationConfigurationProperty.Builder
A builder for
CfnBucket.NotificationConfigurationProperty |
static class |
CfnBucket.NotificationConfigurationProperty.Jsii$Proxy
An implementation for
CfnBucket.NotificationConfigurationProperty |
Modifier and Type | Method and Description |
---|---|
static CfnBucket.NotificationConfigurationProperty.Builder |
builder() |
default java.lang.Object |
getEventBridgeConfiguration()
Enables delivery of events to Amazon EventBridge.
|
default java.lang.Object |
getLambdaConfigurations()
Describes the AWS Lambda functions to invoke and the events for which to invoke them.
|
default java.lang.Object |
getQueueConfigurations()
The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.
|
default java.lang.Object |
getTopicConfigurations()
The topic to which notifications are sent and the events for which notifications are generated.
|
default java.lang.Object getEventBridgeConfiguration()
default java.lang.Object getLambdaConfigurations()
default java.lang.Object getQueueConfigurations()
default java.lang.Object getTopicConfigurations()
static CfnBucket.NotificationConfigurationProperty.Builder builder()