Sign Up for Free

RunKit +

Try any Node.js package right in your browser

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:

require("@aws-cdk/aws-iam/package.json"); // @aws-cdk/aws-iam is a peer dependency. require("@aws-cdk/aws-lambda/package.json"); // @aws-cdk/aws-lambda is a peer dependency. require("@aws-cdk/aws-s3/package.json"); // @aws-cdk/aws-s3 is a peer dependency. require("@aws-cdk/aws-sns/package.json"); // @aws-cdk/aws-sns is a peer dependency. require("@aws-cdk/aws-sqs/package.json"); // @aws-cdk/aws-sqs is a peer dependency. require("@aws-cdk/core/package.json"); // @aws-cdk/core is a peer dependency. require("constructs/package.json"); // constructs is a peer dependency. var awsS3Notifications = require("@aws-cdk/aws-s3-notifications")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@aws-cdk/aws-s3-notifications v1.70.0

Bucket Notifications API for AWS S3

S3 Bucket Notifications Destinations

cdk-constructs: Stable

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));
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free