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.140.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f5a7cc2c47188bac4f9cd23b616a62d9addc2b303ef285a215b269889b89be |
|
MD5 | fee6ca9cb5bdef4aa8ab1ec1512f0fc9 |
|
BLAKE2b-256 | 966d18526fc023f4b262d4a94696812e9547ef377da45bb1207df53d359b3bff |
Close
Hashes for aws_cdk.aws_s3_notifications-1.140.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9d60a1924b022f557601ac984ed4d22f5a0c529a7ae0d9338c5618491c6e25a1 |
|
MD5 | ced98b90d8b01ed7f0d5fe0d7de1e8a8 |
|
BLAKE2b-256 | 90045d9e98514040b02cf92cc4fcd6e5e05c2e26e2a226320af2a6de16b36ad2 |