Integrate with Amazon S3 ↗
noOriginal Documentation
Documentation Index#
Fetch the complete documentation index at: https://docs.pinecone.io/llms.txt Use this file to discover all available pages before exploring further.
Set up Amazon S3 integrationfor data import and audit logs.
This feature is in public preview and available only on Standard and Enterprise plans.
This page shows you how to integrate Pinecone with an Amazon S3 bucket. Once your integration is set up, you can use it to import data from your Amazon S3 bucket into a Pinecone index hosted on AWS, or to export audit logs to your Amazon S3 bucket.
Before you begin#
Ensure you have the following:
1. Create an IAM policy#
In the AWS IAM console:
- In the navigation pane, click Policies.
- Click Create policy.
- In Select a service section, select S3.
- Select the following actions to allow:
ListBucket: Permission to list some or all of the objects in an S3 bucket. Required for importing data and exporting audit logs.GetObject: Permission to retrieve objects from an S3 bucket. Required for importing data.PutObject: Permission to add an object to an S3 bucket. Required for exporting audit logs.
- In the Resources section, select Specific.
- For the bucket, specify the ARN of the bucket you created. For example:
arn:aws:s3:::example-bucket-name - For the object, specify an object ARN as the target resource. For example:
arn:aws:s3:::example-bucket-name/* - Click Next.
- Specify the name of your policy. For example: “Pinecone-S3-Access”.
- Click Create policy.
Targeting a subdirectory (optional)#
To write audit logs to a specific subdirectory within your S3 bucket (e.g., my-bucket/pinecone-logs/), you need to configure your IAM policy differently for ListBucket vs. object-level actions:
For
ListBucket, use a Condition block withStringLiketo specify the prefix. Include both the directory path with and without the trailing wildcard:{ "Sid": "ListBucketWithPrefix", "Effect": "Allow", "Action": "s3:ListBucket", "Resource": "arn:aws:s3:::example-bucket-name", "Condition": { "StringLike": { "s3:prefix": [ "pinecone-logs/", "pinecone-logs/*" ] } } }For
PutObjectandGetObject, use the Resource specifier with the subdirectory path:{ "Sid": "ObjectActionsInSubdirectory", "Effect": "Allow", "Action": [ "s3:PutObject", "s3:GetObject" ], "Resource": "arn:aws:s3:::example-bucket-name/pinecone-logs/*" }
Complete example policy for subdirectory access:
{
"Version": "2012-10-17",
"Statement": [
{
"Sid": "ListBucketWithPrefix",
"Effect": "Allow",
"Action": "s3:ListBucket",
"Resource": "arn:aws:s3:::example-bucket-name",
"Condition": {
"StringLike": {
"s3:prefix": [
"pinecone-logs/",
"pinecone-logs/*"
]
}
}
},
{
"Sid": "ObjectActionsInSubdirectory",
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject"
],
"Resource": "arn:aws:s3:::example-bucket-name/pinecone-logs/*"
}
]
}
The key difference is that ListBucket operates on the bucket resource and uses conditions to filter by prefix, while object-level actions (PutObject, GetObject) operate directly on object resources specified in the ARN.
2. Set up access using an IAM role#
In the AWS IAM console:
In the navigation pane, click Roles.
Click Create role.
In the Trusted entity type section, select AWS account.
Select Another AWS account.
Enter the Pinecone AWS VPC account ID:
713131977538Click Next.
Select the policy you created.
Click Next.
Specify the role name. For example: “Pinecone”.
Click Create role.
Click the role you created.
On the Summary page for the role, find the ARN.
For example: arn:aws:iam::123456789012:role/PineconeAccess
- Copy the ARN.
You will need to enter the ARN into Pinecone later.
3. Add a storage integration#
This step is required for importing data. It is not required for storing audit logs.
In the Pinecone console, add an integration with Amazon S3..
- Select your project.
- Go to Manage > Storage integrations.
- Click Add integration.
- Enter a unique integration name.
- Select Amazon S3.
- Enter the ARN of the IAM role you created.
- Click Add integration.
Next steps#
- Import data from your Amazon S3 bucket into a Pinecone index.
- Configure audit logs to export logs to your Amazon S3 bucket.