aws-cdk-lib.aws_s3.CfnBucket.NotificationConfigurationProperty

interface NotificationConfigurationProperty

LanguageType name
.NETAmazon.CDK.AWS.S3.CfnBucket.NotificationConfigurationProperty
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3#CfnBucket_NotificationConfigurationProperty
Javasoftware.amazon.awscdk.services.s3.CfnBucket.NotificationConfigurationProperty
Pythonaws_cdk.aws_s3.CfnBucket.NotificationConfigurationProperty
TypeScript aws-cdk-lib » 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 { 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',
        }],
      },
    },
  }],
};

Properties

NameTypeDescription
eventBridgeConfiguration?IResolvable | EventBridgeConfigurationPropertyEnables delivery of events to Amazon EventBridge.
lambdaConfigurations?IResolvable | IResolvable | LambdaConfigurationProperty[]Describes the AWS Lambda functions to invoke and the events for which to invoke them.
queueConfigurations?IResolvable | IResolvable | QueueConfigurationProperty[]The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.
topicConfigurations?IResolvable | IResolvable | TopicConfigurationProperty[]The topic to which notifications are sent and the events for which notifications are generated.

eventBridgeConfiguration?

Type: IResolvable | EventBridgeConfigurationProperty (optional)

Enables delivery of events to Amazon EventBridge.


lambdaConfigurations?

Type: IResolvable | IResolvable | LambdaConfigurationProperty[] (optional)

Describes the AWS Lambda functions to invoke and the events for which to invoke them.


queueConfigurations?

Type: IResolvable | IResolvable | QueueConfigurationProperty[] (optional)

The Amazon Simple Queue Service queues to publish messages to and the events for which to publish messages.


topicConfigurations?

Type: IResolvable | IResolvable | TopicConfigurationProperty[] (optional)

The topic to which notifications are sent and the events for which notifications are generated.