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::Permissionresource 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 .
| Source | |
|---|---|
| Type last changed |
Example
// 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',
}],
},
},
}],
};
# 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"
)]
)
)
)]
)
// 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();
// 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"
} }
}
}
} }
};
// 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.event_bridge_configurationoptionaltyping.Union[IResolvable, EventBridgeConfigurationProperty]eventBridgeConfigurationoptionalIResolvableEventBridgeConfigurationoptionalIResolvableEventBridgeConfigurationoptionalinterface{} #lambdaConfigurationsoptionalIResolvable | IResolvable | CfnBucket.lambda_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, LambdaConfigurationProperty]]]lambdaConfigurationsoptionalIResolvableLambdaConfigurationsoptionalIResolvableLambdaConfigurationsoptionalinterface{} #queueConfigurationsoptionalIResolvable | IResolvable | CfnBucket.queue_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, QueueConfigurationProperty]]]queueConfigurationsoptionalIResolvableQueueConfigurationsoptionalIResolvableQueueConfigurationsoptionalinterface{} #topicConfigurationsoptionalIResolvable | IResolvable | CfnBucket.topic_configurationsoptionaltyping.Union[IResolvable, typing.List[typing.Union[IResolvable, TopicConfigurationProperty]]]topicConfigurationsoptionalIResolvableTopicConfigurationsoptionalIResolvableTopicConfigurationsoptionalinterface{} #