Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # Boto setup:
- # The file ~/.aws/credentials contains:
- # [default]
- # region=eu-west-1
- # aws_access_key_id=xxxxxx
- # aws_secret_access_key=xxxxxx
- import boto3
- import requests
- from botocore.client import Config
- # Get the service client.
- s3 = boto3.client('s3', config=Config(signature_version='s3v4'))
- # Generate the URL to get 'key-name' from 'bucket-name'
- url = s3.generate_presigned_url(
- ClientMethod='get_object',
- Params={
- 'Bucket': 'yaronf',
- 'Key': 'signedObject.txt'
- }
- )
- print url
- response = requests.get(url)
- print response
Add Comment
Please, Sign In to add comment