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:
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_s3_notifications as s3n
bucket = s3.Bucket(stack, "Bucket")
topic = sns.Topic(stack, "Topic")
bucket.add_event_notification(s3.EventType.OBJECT_CREATED_PUT, s3n.SnsDestination(topic))
The following example shows how to send a notification to a Lambda function when an object is created in an S3 bucket:
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_s3_notifications as s3n
bucket = s3.Bucket(stack, "Bucket")
fn = Function(self, "MyFunction", {
"runtime": Runtime.NODEJS_12_X,
"handler": "index.handler",
"code": 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.135.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | a101d225bf73ffb201acb5f7b7c01a2708fac26cf41a8f2f615344006d216621 |
|
MD5 | be3bc5052c8f83b96b6dacdd3c744124 |
|
BLAKE2b-256 | 125fea9dbfa1c29ab21562d455aa6a50363238fe599520e8891fd020fc8caa9f |
Close
Hashes for aws_cdk.aws_s3_notifications-1.135.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 311216fd1c5fe825328ce9e83ef93d25fa86ef09eb1b55c550daa383f0ae4b90 |
|
MD5 | d2a40913468c104347b6b47b59c84add |
|
BLAKE2b-256 | a683df6753781eae14c0112da803c61a3e17e5ab42bc695e7bd82e097f05f5cc |