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.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 245807932fd402083d2132b7d5a5ab868463a30d7fbfd4930d9f503cba84974f |
|
MD5 | 4914a00258fc975a48c4b4b959b5452b |
|
BLAKE2b-256 | 50dcbac0167274fdd6ff3c9ff78f248db1ec4f0983d091e0c87d338101bba8d1 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.138.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | a48a7c972359dd7fcfda4580b097d97b5dc471bccdcfd6a3d2af1fbffbc6824f |
|
MD5 | d1206cf1dfff56c45620131cc40a9bc2 |
|
BLAKE2b-256 | ce31720a57215309346dbbb74d403e93b2d43ea4f1555eb58332962a3465832e |