Bucket Notifications API for AWS S3
Project description
S3 Bucket Notifications Destinations
---This module includes integration classes for using Topics, Queues or Lambdas as S3 Notification Destinations.
Examples
The following example shows how to send a notification to an SNS topic when an object is created in an S3 bucket:
import aws_cdk.aws_sns as sns
bucket = s3.Bucket(self, "Bucket")
topic = sns.Topic(self, "Topic")
bucket.add_event_notification(s3.EventType.OBJECT_CREATED_PUT, s3n.SnsDestination(topic))
The following example shows how to send a notification to an SQS queue when an object is created in an S3 bucket:
import aws_cdk.aws_sqs as sqs
bucket = s3.Bucket(self, "Bucket")
queue = sqs.Queue(self, "Queue")
bucket.add_event_notification(s3.EventType.OBJECT_CREATED_PUT, s3n.SqsDestination(queue))
The following example shows how to send a notification to a Lambda function when an object is created in an S3 bucket:
import aws_cdk.aws_lambda as lambda_
bucket = s3.Bucket(self, "Bucket")
fn = lambda_.Function(self, "MyFunction",
runtime=lambda_.Runtime.NODEJS_12_X,
handler="index.handler",
code=lambda_.Code.from_asset(path.join(__dirname, "lambda-handler"))
)
bucket.add_event_notification(s3.EventType.OBJECT_CREATED, s3n.LambdaDestination(fn))
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for aws-cdk.aws-s3-notifications-1.165.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3da3a9d33534546f818857543f55f1f089279ff0fab3645c2a3994c4b06ec7da |
|
MD5 | e5d67d563a1aab8c40299cda7f1581f2 |
|
BLAKE2b-256 | 666cd1fc46fccdc05394d5102c80b4b2fbdc40ce47d781d79abb5dbc5bc44259 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.165.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19b33f496bbfcc3d33ce4bf13c72f6046592509710dd53e749365db8298497b0 |
|
MD5 | e42181bf44a1dfb82ffeb983bf233f60 |
|
BLAKE2b-256 | 6bdb15c002a9fb5352086ebf2c5af53c9c67175d18dbd239ac0c86e70906bbc8 |