Skip to content

Instantly share code, notes, and snippets.

@springcoil
Created January 12, 2019 13:36
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 springcoil/6a4a8c9473f4356d68beb4cbabe10a22 to your computer and use it in GitHub Desktop.
Save springcoil/6a4a8c9473f4356d68beb4cbabe10a22 to your computer and use it in GitHub Desktop.
This is a super hacky script for deleting objects one by one on a restricted s3 bucket
import boto3
boto3.setup_default_session(profile_name='dev')
client = boto3.client('s3')
def delete_object(key_name):
return client.delete_object(Bucket='s3_bucket', Key=key_name )
delete_object('bad_image.jpg')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment