I have an s# bucket that has accumulated a lot of objects over time (millions) that now needs to be cleared and deleted. removing the objects both by UI and CLI is very slow. I also tried expiring the objects with the lifecycle approach without good success.
Is there any fast brute force way to clear and then delete an S3 bucket I am missing?
Why can’t you use Lifecycle Rules to delete the objects? Set the rule to delete current and non-current versioned objects (if you use versioning) at 1 day.
Agreed with the commenter above that your described use case of ‘cleaning out accumulated objects’ is the perfect scenario for a life cycle rule. What was the rule that you used that didn’t have success? It will take some time, it’s not instant.
If you go this route and not the above-mentioned and me-seconded AWS Batch or Lifecycle rule route, you’re gonna want to background that command with a “&” or use screen to let it run if you run it on a workspace or remote machine.