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.143.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | bcce137eab3c7f03b5320fe202b24a6026a35496cbea44db5d509dc091bf602e |
|
MD5 | 24bf7d1e6717c9a8dced84d1ee4ad396 |
|
BLAKE2b-256 | f5c6c7caa92cf548d9dc4d059d947617ae2a93c98f7d09d51ad9d64cc161e9b3 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.143.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ad851c76be208c2e46681734fbf810f7da5d7e36158e508a4e5e3183487211c6 |
|
MD5 | 168c7354cd1fbb1426702d5b0abd124e |
|
BLAKE2b-256 | 82b3c1c13b3be07658d99e3e9b6d556fcf1043b57ab2a8721c9acba567f3ed43 |