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.137.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | d13a340fee5590d0a609dec9ca88ebc2ed1952ff55a49292cae348f1227d8c13 |
|
MD5 | 4964447990daf3db70f4bc1bf6462b7e |
|
BLAKE2b-256 | 41c311c418687f4153fe78338a931c333982a1ac96722752dc61eebbe69b3ac9 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.137.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8406c783baf7e8cf7ef68205964febae0c1dd06c9664d00181d1a0989a173f4e |
|
MD5 | 1933ed2f740f407116eeeec133df2700 |
|
BLAKE2b-256 | 7cc3cfc630bc88d58f0202a5042bb531133be99f67b133a0886dc377395a96e4 |