Skip to content

Setting up s3 Vector Buckets via terraform

0

I know it's possible to setup s3 vector buckets from the aws console https://repost.aws/articles/ARY9EKiGFISfisAyvigDX3lQ/amazon-s3-vectors-revolutionizing-ai-data-storage-with-use-cases But I can't find a clue on how to do this with terraform, I'd be glad for a pointer for this (or a way to setup s3 via terraform and then define this as s3 vector, if the next terraform run won't change it back - not sure there is a path like this)

asked a year ago1.4K views

3 Answers
0

Hello.

As of September 18, 2025, creating S3 Vector buckets via CloudFormation or Terraform is not supported.
As described in the GitHub Issue below, creating S3 Vector via Terraform is expected to be released when the service becomes GA.
https://github.com/hashicorp/terraform-provider-aws/issues/43409

Although CloudFormation does not directly support this, creation is supported by the AWS CLI and SDK.
Therefore, in the case of CloudFormation, it can be created by using a custom resource.
https://docs.aws.amazon.com/AmazonS3/latest/API/API_S3VectorBuckets_CreateVectorBucket.html
https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-vectors-buckets-create.html

EXPERT

answered a year ago

0

answered 9 months ago

-1

Amazon S3 Vectors is a relatively new feature (currently in preview), and as of now, there doesn't appear to be direct Terraform support for creating vector buckets.

While Terraform has resources for standard S3 buckets (aws_s3_bucket), S3 vector buckets require specific API operations that are different from regular S3 buckets. Vector buckets are created using dedicated API operations like create-vector-bucket in the AWS CLI.

For now, you have a few options:

  1. Use AWS CloudFormation templates if you need Infrastructure as Code capabilities for S3 vector buckets.

  2. Use the AWS CLI within your automation scripts. You could incorporate AWS CLI commands in your deployment pipeline:

aws s3vectors create-vector-bucket --vector-bucket-name "your-vector-bucket-name"
  1. Use AWS CDK which might have more up-to-date constructs for newer AWS services.

  2. Create a custom Terraform provider or module that wraps the AWS CLI commands for S3 Vectors.

Since S3 Vectors is still in preview, it's likely that Terraform support will be added in the future as the service becomes more widely available. Until then, you'll need to use one of the alternative approaches mentioned above for automating the creation of vector buckets.
Sources
Creating a vector bucket - Amazon Simple Storage Service
Tutorial: Getting started with S3 Vectors - Amazon Simple Storage Service
S3 provision related | AWS re:Post
Introducing Amazon S3 Vectors: First cloud storage with native vector support at scale (preview) | AWS News Blog

answered a year ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.