This is a
playground to test code. It runs a full
Node.js environment and already has all of
npm’s 1,000,000+ packages pre-installed, including
@aws-cdk/aws-s3-notifications with all
npm packages installed. Try it out:
This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.
This module includes integration classes for using Topics, Queues or Lambdas as S3 Notification Destinations.
The following example shows how to send a notification to an SNS topic when an object is created in an S3 bucket:
import * as s3n from '@aws-cdk/aws-s3-notifications'; const bucket = new s3.Bucket(stack, 'Bucket'); const topic = new sns.Topic(stack, 'Topic'); bucket.addEventNotification(s3.EventType.OBJECT_CREATED_PUT, new s3n.SnsDestination(topic));