aws-cdk-lib.aws_s3_notifications.SnsDestination

class SnsDestination

LanguageType name
.NETAmazon.CDK.AWS.S3.Notifications.SnsDestination
Gogithub.com/aws/aws-cdk-go/awscdk/v2/awss3notifications#SnsDestination
Javasoftware.amazon.awscdk.services.s3.notifications.SnsDestination
Pythonaws_cdk.aws_s3_notifications.SnsDestination
TypeScript (source)aws-cdk-lib » aws_s3_notifications » SnsDestination

Implements IBucketNotificationDestination

Use an SNS topic as a bucket notification destination.

Example

const bucket = new s3.Bucket(this, 'MyBucket');
const topic = new sns.Topic(this, 'MyTopic');
bucket.addEventNotification(s3.EventType.OBJECT_CREATED, new s3n.SnsDestination(topic));

Initializer

new SnsDestination(topic: ITopic)

Parameters

  • topic ITopic

Methods

NameDescription
bind(_scope, bucket)Registers this resource to receive notifications for the specified bucket.

bind(_scope, bucket)

public bind(_scope: Construct, bucket: IBucket): BucketNotificationDestinationConfig

Parameters

  • _scope Construct
  • bucket IBucket

Returns

  • BucketNotificationDestinationConfig

Registers this resource to receive notifications for the specified bucket.

This method will only be called once for each destination/bucket pair and the result will be cached, so there is no need to implement idempotency in each destination.