Skip to main content

A CDK construct library for Amazon S3 Vectors. This construct simplifies the creation of vector buckets, vector indexes with full configuration options, and Amazon Bedrock knowledge bases using S3 Vectors as the underlying vector store.

Project description

cdk-s3-vectors

AWS CDK v2 npm version PyPI version NuGet version Maven Central

⚠️ Maintenance Notice: This library is intended as a temporary solution and will only be maintained until AWS CloudFormation and CDK introduce native support for Amazon S3 Vectors. Once native support is available, users are encouraged to migrate to the official AWS constructs.

Reference Documentation

Amazon S3 Vectors User Guide

Supported Languages

Language Package
Python Logo Python cdk-s3-vectors
TypeScript Logo TypeScript cdk-s3-vectors
Java Logo Java io.github.bimnett:cdk-s3-vectors
.NET Logo .NET bimnett.CdkS3Vectors

Overview

Amazon S3 Vectors is in preview release and provides native vector storage and similarity search capabilities within Amazon S3.

This AWS CDK construct library provides high-level constructs for Amazon S3 Vectors, enabling you to create vector buckets, indexes, and knowledge bases for AI/ML applications.

The library includes three main constructs:

  • Bucket: Creates S3 vector buckets with optional encryption
  • Index: Creates vector indexes within buckets for similarity search
  • KnowledgeBase: Creates Amazon Bedrock knowledge bases using S3 Vectors as the vector store

IMPORTANT: The constructs library version must be >= 10.0.5.

Examples

For complete, deployable examples in all supported languages, see the examples directory.

Bucket Construct Props

Name Type Description
vectorBucketName string The name of the vector bucket to create.
encryptionConfiguration? EncryptionConfiguration Optional encryption configuration for the vector bucket. Defaults to AES256.

Index Construct Props

Name Type Description
vectorBucketName string The name of the vector bucket to create the index in.
indexName string The name of the vector index to create.
dataType 'float32' The data type of the vectors in the index.
dimension number The dimensions of the vectors (1-4096).
distanceMetric 'euclidean' | 'cosine' The distance metric for similarity search.
metadataConfiguration? MetadataConfiguration Optional metadata configuration for the index.

KnowledgeBase Construct Props

Name Type Description
knowledgeBaseName string The name of the knowledge base to create.
knowledgeBaseConfiguration KnowledgeBaseConfiguration Vector embeddings configuration details.
vectorBucketArn string The ARN of the S3 vector bucket.
indexArn string The ARN of the vector index.
description? string Optional description of the knowledge base.
clientToken? string Optional idempotency token (≥33 characters).

Pattern Properties

Name Type Description
vectorBucketName string Returns the name of the created vector bucket
vectorBucketArn string Returns the ARN of the created vector bucket
indexArn string Returns the ARN of the created vector index
indexName string Returns the name of the created vector index
knowledgeBaseId string Returns the ID of the created knowledge base
knowledgeBaseArn string Returns the ARN of the created knowledge base

Default Settings

Out of the box implementation of the constructs without any override will set the following defaults:

Amazon S3 Vector Bucket

  • Server-side encryption with Amazon S3 managed keys (SSE-S3) using AES256
  • Least privilege IAM permissions for vector operations
  • Custom resource handlers for bucket lifecycle management

Vector Index

  • Support for float32 data type vectors
  • Configurable dimensions (1-4096)
  • Choice of euclidean or cosine distance metrics
  • Optional metadata configuration for enhanced search capabilities

Amazon Bedrock Knowledge Base

  • Integration with S3 Vectors as the vector store
  • Configurable embedding models
  • IAM role with least privilege permissions
  • Support for various embedding data types and dimensions

Architecture

Architecture Diagram

License

This project is licensed under the Apache License 2.0. See LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cdk_s3_vectors-0.3.0.tar.gz (1.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cdk_s3_vectors-0.3.0-py3-none-any.whl (1.7 MB view details)

Uploaded Python 3

File details

Details for the file cdk_s3_vectors-0.3.0.tar.gz.

File metadata

  • Download URL: cdk_s3_vectors-0.3.0.tar.gz
  • Upload date:
  • Size: 1.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.14.0

File hashes

Hashes for cdk_s3_vectors-0.3.0.tar.gz
Algorithm Hash digest
SHA256 68cf47957433493dfd6da10610bbc483e3ec59a391c13bfc9d7f9dd0b0c2bc45
MD5 fc15a56ee45a4ca5108b15736b4112ca
BLAKE2b-256 ace901b29a7e189f59b60e15424dfdd0b48c80121f9dcc741bc1211e0a49fb72

See more details on using hashes here.

File details

Details for the file cdk_s3_vectors-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: cdk_s3_vectors-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 1.7 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.14.0

File hashes

Hashes for cdk_s3_vectors-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ef26b74165c90edab817342e35cae4c02610131d48a116266a9e4eadd6cb8e2b
MD5 c9e53b1daeff3d92283ae39bb5f58722
BLAKE2b-256 e4a82e74e321abe4e0ab80afbf3004a4c2a29afbfa4842245b384ca1d627eca5

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page