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.134.0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6a7318e288069de47033da53d0d0d719b0bb4a36f225e08fd1f779991756a572 |
|
MD5 | 28157fcc0f658aba3a0aa42e36861e72 |
|
BLAKE2b-256 | 6ceeda0bed323adfad364d75b4ae68479acb2d7285f67c06e0b8105682c95c31 |
Close
Hashes for aws_cdk.aws_s3_notifications-1.134.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f625803ca5f00a5db83ea63fd9216729d372261dc291c85d98b6770359e00126 |
|
MD5 | 4e5b4cefb8e88e558b196c2e3edf2a7c |
|
BLAKE2b-256 | 720fa01747317d21e5dbabaa0e82cf6b3316ad2b49b24d79e555b00ab21d3d22 |