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.139.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 721fb59f8c24164f556bd65161fd3a455fa2bf90df6947aeec9521b5b1c5ba54 |
|
MD5 | d18eeac72cbeb09f139c665274b54583 |
|
BLAKE2b-256 | edbef2a4091433eb370567b956d744c4a3e3d6e005c7605952cd5baf31200d22 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.139.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7f2e999f0acf0f4783d4d378e6629f0c8cff2457a5fc3de1b4c5850966fd3d92 |
|
MD5 | 529d43013d922739a8be7dc1c0fa4288 |
|
BLAKE2b-256 | 79f8bf2e26c8d84c4e174f11668565ad21e8e89aec7e2b285ba9f2d177905f01 |