Last active
October 12, 2021 21:19
-
-
Save dkhmelenko/4e229f813e89e9ec949b550747599e8e to your computer and use it in GitHub Desktop.
AWS CDK example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from aws_cdk import (aws_s3, aws_s3_notifications, core, aws_sns) | |
# create S3 bucket | |
s3 = aws_s3.Bucket(self, "s3bucket_cdk") | |
# define SNS topic ans assign it | |
sns_topic = aws_sns.Topic(self, "CDK Notification") | |
sns_notification = aws_s3_notifications.SnsDestination(sns_topic) | |
# assign notification for the s3 event type when new object created | |
s3.add_event_notification(aws_s3.EventType.OBJECT_CREATED, sns_notification) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment