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 without compilation. See https://github.com/aws/jsii/issues/826
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 without compilation. See https://github.com/aws/jsii/issues/826
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.132.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 07e1ca707e339a42ed9eca36c2147a98e574a8b242270042b2553d614326c9b1 |
|
MD5 | 33adf46f69e9ed3f3357727e32ab79b6 |
|
BLAKE2b-256 | 05b92638a2b13f0a3e09a8b579a646229aeb0379a8a4882346b276fcfa16d34a |
Close
Hashes for aws_cdk.aws_s3_notifications-1.132.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9dec9bb9b7630e92a478515d35a48292f78215c453bdb5770ac4f477c2451034 |
|
MD5 | 096eb148def9f8110d0fd33b3f664fcf |
|
BLAKE2b-256 | 8c05ad0cfa88a24f0306924985a4539266ef64ce116e3add7a01cdc7263ef398 |