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.141.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 04f8c7c336cef4b1aae324d26921dcfc8076e48e354a58bdbcdd95e8f1c66d10 |
|
MD5 | 9c141ec5f6a1c109c44dcfb902acc738 |
|
BLAKE2b-256 | 49dd3474b25e5775ca70f81fc5e373f627c862e59ea7b70e38f5880510b665cd |
Close
Hashes for aws_cdk.aws_s3_notifications-1.141.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2c0127d6efb478347598af233a544390e723d9f25593526430b5da04813ba840 |
|
MD5 | f23e0d5308866df7cc5079baa6d023e3 |
|
BLAKE2b-256 | 42b4d51d35e397ee827bacb8346b51e226bbc4706d714af11448c6d10396088c |