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.1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 78df6eaa8b65e98214ec79542be0d65aa9b96f4e94c58dc00d55c7584c34d9cb |
|
MD5 | 209515c6a3404ac5dd930f69c7d52b0f |
|
BLAKE2b-256 | 72d3a39c26b3b56105d1246a90366779d795df053f9efef8c4c621fd3b33b906 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.138.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | fb6a9dc6da29d5d1c65791dbf0452241988060fbcfcd9b0e31397df99af8a6c3 |
|
MD5 | 77373ed79e7632b914cd3c474a53c11c |
|
BLAKE2b-256 | 2746bc0dfadd27bd1f72925e9e1af547af862a1bf3a161a2e031e3f1fad8a90c |