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.138.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67440c2fb666ef34c1a8b9e3b7298cc64a9f6733f067ab678064999f3b85ad7c |
|
MD5 | 75513a12a89fae288d5f9ff37a7bc811 |
|
BLAKE2b-256 | 81c4c48cd6536b9375749c4d0159708fd735dc17712e131ed3d8803e12d7884d |
Close
Hashes for aws_cdk.aws_s3_notifications-1.138.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d77086c3ddd028122d2300cd58bdea24459a57b06062d213dc1fe8e42d3965ba |
|
MD5 | e907cfa4a410b6e8849ea17719bd0db4 |
|
BLAKE2b-256 | 1a49d4c9c84981513a432dd5dc9265c2204335e58f1bef124c93a39f1c4de6db |