interface NotificationConfigurationProperty
Language | Type name |
---|---|
.NET | Amazon.CDK.AWS.S3.CfnBucket.NotificationConfigurationProperty |
Java | software.amazon.awscdk.services.s3.CfnBucket.NotificationConfigurationProperty |
Python | aws_cdk.aws_s3.CfnBucket.NotificationConfigurationProperty |
TypeScript | @aws-cdk/aws-s3 » CfnBucket » 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 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 * as s3 from '@aws-cdk/aws-s3';
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',
}],
},
},
}],
};
Properties
Name | Type | Description |
---|---|---|
event | IResolvable | Event | Enables delivery of events to Amazon EventBridge. |
lambda | IResolvable | IResolvable | Lambda [] | Describes the AWS Lambda functions to invoke and the events for which to invoke them. |
queue | IResolvable | IResolvable | Queue [] | The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages. |
topic | IResolvable | IResolvable | Topic [] | The topic to which notifications are sent and the events for which notifications are generated. |
eventBridgeConfiguration?
Type:
IResolvable
|
Event
(optional)
Enables delivery of events to Amazon EventBridge.
lambdaConfigurations?
Type:
IResolvable
|
IResolvable
|
Lambda
[]
(optional)
Describes the AWS Lambda functions to invoke and the events for which to invoke them.
queueConfigurations?
Type:
IResolvable
|
IResolvable
|
Queue
[]
(optional)
The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.
topicConfigurations?
Type:
IResolvable
|
IResolvable
|
Topic
[]
(optional)
The topic to which notifications are sent and the events for which notifications are generated.