Created
January 12, 2019 13:36
-
-
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
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 | |
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