Created
December 13, 2017 05:56
-
-
Save robnolen/a2b7560c31d48c63164ccf73808caee8 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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