Advertisement
Guest User

Untitled

a guest
Mar 31st, 2020
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.57 KB | None | 0 0
  1. #!/usr/bin/env python
  2. import boto3
  3. import json
  4. import sys
  5.  
  6. BUCKET_NAME = ''
  7.  
  8. s3 = boto3.client('s3')
  9.  
  10. if __name__ == "__main__":
  11. # Get the object from the event and show its content type
  12. print ('Number of arguments:', len(sys.argv), 'arguments.')
  13. print ('Argument List:', str(sys.argv))
  14.  
  15. try:
  16. destinationBucket = BUCKET_NAME
  17. # objectKey = event['Records'][0]['s3']['object']['key'];
  18. response = s3.upload_file(str(sys.argv), BUCKET_NAME, str(sys.argv))
  19.  
  20. except Exception as e:
  21. print(e)
  22. raise e
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement