Skip to content

How can I write embeddings to an S3 Vector Bucket (PutVector) from Lambda?

0

Hi AWS Community,

I'm working on a document processing pipeline where I use a Lambda function to extract text from uploaded PDFs, generate embeddings for each text chunk, and store those embeddings for vector search.

I have already created an S3 Vector Bucket and a vector index. However, I'm unable to push vectors to the index using my Lambda function. When attempting to call the S3 Vector API endpoint via requests and SigV4 authentication, I receive a NameResolutionError, indicating the endpoint is not resolvable from Lambda.

I’ve also tried using aws s3api put-vector and boto3.client('s3vector'), but both are either unsupported or result in UnknownServiceError.

Is access to the S3 Vector Bucket Write API (PutVector) currently limited to allowlisted accounts or internal AWS services? If so, is there a way to request access or register for the preview?

My goal is to ingest vector embeddings into the vector bucket from within Lambda so they can later be queried or integrated with OpenSearch.

Thanks in advance for any guidance or pointers!

2 Answers
0

Hello.

I think the reason why UnknownServiceError occurs in Lambda is because the version of boto3 used by Lambda is old.
Please follow the steps in the document below to create the latest boto3 layer and set it in Lambda.
https://repost.aws/knowledge-center/lambda-python-runtime-errors

docker run --entrypoint "" -v "$PWD":/var/task "public.ecr.aws/lambda/python:3.13.2025.08.15.14" /bin/sh -c "mkdir -p /tmp/python && pip3 install boto3 -t /tmp/python && cd /tmp && dnf install -y zip && zip -r /var/task/boto3-mylayer.zip ."
aws lambda publish-layer-version --layer-name boto3-mylayer --zip-file fileb://boto3-mylayer.zip --compatible-runtimes python3.13
aws lambda update-function-configuration --function-name MY_FUNCTION --layers LAYER_ARN
EXPERT

answered a year ago

0

Is access to the S3 Vector Bucket Write API (PutVector) currently limited to allowlisted accounts or internal AWS services? If so, is there a way to request access or register for the preview?

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.