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.145.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 93ab02579af6d6c51218d7bb9c3659e2310d36ad55e1d7e10594c1c44d29d973 |
|
MD5 | 4724a076befa45fe3b1d02453a0249fd |
|
BLAKE2b-256 | 1dad4bbde364e51e9c5c3ff5878818f724d04e748ed73139a1866d99df13faaa |
Close
Hashes for aws_cdk.aws_s3_notifications-1.145.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 28a226011be7305cbfb97f62c89dbb6c0921ae6c69e0f328fd62d7e02360608e |
|
MD5 | 694f4cf5201ada7583ccdeb130d45f44 |
|
BLAKE2b-256 | 9b522fa3a03d939c00d198e97106ccfa5fe5176314edc41a9c974cc098b75c93 |