Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import json
- import boto3
- S3_BUCKET = '<insert bucket name>'
- SNS_ARN = '<insert sns arn>'
- bucket = boto3.resource('s3').Bucket(S3_BUCKET)
- topic = boto3.resource('sns').Topic(SNS_ARN)
- for item in bucket.objects.all():
- if not item.key.endswith('.json.gz'):
- continue
- message = json.dumps({
- 's3Bucket': S3_BUCKET,
- 's3ObjectKey': [item.key]
- })
- topic.publish(Message=message)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement