Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/usr/bin/env python
- import boto3
- import json
- import sys
- BUCKET_NAME = ''
- s3 = boto3.client('s3')
- if __name__ == "__main__":
- # Get the object from the event and show its content type
- print ('Number of arguments:', len(sys.argv), 'arguments.')
- print ('Argument List:', str(sys.argv))
- try:
- destinationBucket = BUCKET_NAME
- # objectKey = event['Records'][0]['s3']['object']['key'];
- response = s3.upload_file(str(sys.argv), BUCKET_NAME, str(sys.argv))
- except Exception as e:
- print(e)
- raise e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement