Skip to content

Instantly share code, notes, and snippets.

@robnolen
Created December 13, 2017 05:56
Show Gist options
  • Save robnolen/a2b7560c31d48c63164ccf73808caee8 to your computer and use it in GitHub Desktop.
Save robnolen/a2b7560c31d48c63164ccf73808caee8 to your computer and use it in GitHub Desktop.
import boto3
bucketname = "<BUCKET_NAME>"
s3 = boto3.resource('s3')
bucket = s3.Bucket(bucketname)
client = boto3.client('s3')
for obj in bucket.objects.all():
url = client.generate_presigned_url(
ClientMethod='get_object',
Params={
'Bucket': bucket.name,
'Key': obj.key,
},
ExpiresIn=30
)
print url
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment