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:
import aws_cdk.aws_sns as sns
bucket = s3.Bucket(self, "Bucket")
topic = sns.Topic(self, "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:
import aws_cdk.aws_lambda as lambda_
bucket = s3.Bucket(self, "Bucket")
fn = lambda_.Function(self, "MyFunction",
runtime=lambda_.Runtime.NODEJS_12_X,
handler="index.handler",
code=lambda_.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.144.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 257bb908a426a0bc3bb48f9c66641eb80fc65770e7a1d6a88f88b2d89910adc3 |
|
MD5 | 70c1ebb581f420cb2cc401a2583f1b8c |
|
BLAKE2b-256 | eb5d165c96dfbdb8b42a1f310646864250534012881e0c181ee558288dca8615 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.144.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 17ebcb890709d14825b7fd0fdf949a1d42224f6bc93f4a14bc9141165898db28 |
|
MD5 | fcb36782343f2464dc390344bd714753 |
|
BLAKE2b-256 | e7f9436e57ac4ab20ce35b97e11cba26c1bfd5bb6e3216f7be66b2842b4036c3 |