Skip to content

Instantly share code, notes, and snippets.

@hemchander007
hemchander007 / delete_all_objects.py
Created February 14, 2023 12:08 — forked from seventhskye/delete_all_objects.py
A script to delete all objects, versions and delete markers from an s3 bucket.
#!/usr/bin/env python
import boto3
client = boto3.client('s3')
Bucket = 'a-bucket'
Prefix = 'a-prefix' # leave blank to delete the entire contents
IsTruncated = True
MaxKeys = 1000
KeyMarker = None