Created
May 8, 2019 14:35
-
-
Save jamesturk/7ead1093cd1cbfe55a7494b657fd9d8d to your computer and use it in GitHub Desktop.
This file contains 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 | |
client = boto3.client('s3') | |
s3 = boto3.resource('s3') | |
paginator = client.get_paginator('list_objects') | |
count = 0 | |
for page in paginator.paginate(Bucket='data.example', Prefix='images', MaxKeys=10000): | |
for key in page['Contents']: | |
object_acl = s3.ObjectAcl('data.example', key['Key']) | |
object_acl.put(ACL='public-read') | |
count += 1 | |
print(count) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment