Skip to content

Instantly share code, notes, and snippets.

@jamesturk
Created May 8, 2019 14:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jamesturk/7ead1093cd1cbfe55a7494b657fd9d8d to your computer and use it in GitHub Desktop.
Save jamesturk/7ead1093cd1cbfe55a7494b657fd9d8d to your computer and use it in GitHub Desktop.
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