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:
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_s3_notifications as s3n
bucket = s3.Bucket(stack, "Bucket")
topic = sns.Topic(stack, "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:
# Example automatically generated from non-compiling source. May contain errors.
import aws_cdk.aws_s3_notifications as s3n
bucket = s3.Bucket(stack, "Bucket")
fn = Function(self, "MyFunction", {
"runtime": Runtime.NODEJS_12_X,
"handler": "index.handler",
"code": 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.133.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5d3730d2e60f9b69be172538ab2c04206231e61f566b4cfc0d49629fd1c8b411 |
|
MD5 | b0da437de1477c9485d6728a87f11b14 |
|
BLAKE2b-256 | 4b7d07cc690672395003eefe0330fcac7c2ba432d4f789fdaf926a9cccd9bc1d |
Close
Hashes for aws_cdk.aws_s3_notifications-1.133.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2ceb5976d0deb86392f6e62cf39d031e8ffba08dc7c4512d2b862a613ace55b |
|
MD5 | 3a76e6e4da07b274adcb4cdfbe2c71fb |
|
BLAKE2b-256 | 9a3750b65138f8480eb4027a762a92253a8f0c423d2083277a36fb7c5c85022c |