DEV Community

Kenta Goto for AWS Heroes

Posted on

Easily Delete S3 Vectors with cls3

Amazon S3 Vectors

S3 Vectors

In July 2025, Amazon S3 Vectors, a new service, was announced. (As of July 2025, this is still in preview.)

AWS Blog: Introducing Amazon S3 Vectors

For more details, please refer to the following documentation:

Amazon S3 User Guide: S3 Vectors

S3 Bucket Types

With the introduction of S3 Vectors, Vector Buckets have been added as a new type of bucket in S3.

This means S3 now has the following types of buckets:

  • General Buckets
    • Traditional S3 buckets
  • Directory Buckets
    • S3 Express One Zone
  • Table Buckets
    • S3 Tables
  • Vector Buckets
    • S3 Vectors
    • Still in preview as of July 2025

S3 Vectors Components

The components of Vector Buckets in S3 Vectors are as follows:

  • Vector Bucket
    • Stores multiple indexes
  • Index
    • Stores vector data

To delete a Vector Bucket, you must first delete all indexes within it.

With cls3, I've made this simple - you can now do it with a single command.


cls3

What is cls3?

cls3 is a convenient CLI tool for S3 deletion that I develop as an OSS project.

Blog post about cls3

The GitHub repository is here. (Stars would be appreciated!)

cls3 GitHub Repository

Existing Features

Please refer to the blog post and GitHub repository mentioned above for details.

Specifically, cls3 can:

  • Delete buckets or empty them
  • Search and select multiple buckets in interactive mode
  • Delete multiple buckets in parallel
  • Delete multiple buckets across regions
  • Delete buckets with versioning enabled
  • Delete only old versions of objects
  • Delete Directory Buckets for S3 Express One Zone
  • Delete Table Buckets for S3 Tables
  • Delete only objects with specific key prefixes
  • Provide features for GitHub Actions
  • Automatically retry on throttling errors during bulk deletions

Installation

Various installation methods are available:

  • Homebrew
  • One-liner script
    • Linux, Darwin (macOS) and Windows
  • aqua
  • asdf
  • GitHub Releases
    • Direct download from browser
  • Git clone + install
    • For developers using Go

*For detailed installation instructions, see the following link:

Installation Guide


S3 Vectors Vector Bucket Deletion Feature

Vector Buckets Mode

The functionality to delete S3 Vectors Vector Buckets has been added to cls3 v0.27.0.

cls3 allows you to specify bucket names directly using the CLI option (-b), or specify buckets interactively through interactive mode (-i) by searching.

With this release, I've introduced Vector Buckets Mode, which makes it easy to delete S3 Vectors Vector Buckets as shown below: (using interactive mode as an example)

cls3 Vector Buckets Mode

The "-V (uppercase) | --vectorBucketsMode" option deletes the contents of Vector Buckets, specifically all indexes in the specified Vector Bucket.

When combined with "-f | --forceMode", you can delete the entire Vector Bucket in addition to all indexes.

When combined with "-k | --keyPrefix", you can delete only indexes with specific prefixes.

Important Notes

S3 Vectors is still in preview, and API specifications may change in the future.

Therefore, Vector Buckets Mode might temporarily become unavailable. When this happens, cls3's Vector Buckets Mode will be updated to match future S3 Vectors specification changes.

Additionally, since this is currently in preview, the API behavior can be unstable at times. For this reason, cls3 internally sets certain parallel execution limits. I plan to tune this in the future.


Summary

I've introduced functionality to easily delete S3 Vectors Vector Buckets in cls3.

I hope this will encourage you to use this tool not only for S3 Vectors but also for deleting regular S3 buckets. I believe it will be very useful.

Top comments (0)