This feature is in public preview and available only on Standard and Enterprise plans.
Before you begin
Ensure you have the following:1. Create a service account and key
Pinecone will use a service account to access your GCS bucket.- Create a service account for your Pinecone integration.
- Create a service account key. Select JSON as the key type. The key will be downloaded to your computer. You’ll use this key when adding a storage integration in Pinecone.
2. Grant access to the bucket
Add your service account as a principal to the bucket.- For the principal, use your service account email address.
- For the role, select one that matches how you use the integration:
- Importing data: Storage Object Viewer or another role that can list and read objects in the bucket.
- Exporting audit logs: Storage Object User or another role that can list, create, and delete objects in the bucket. Each time Pinecone checks write access, it writes a test file and then deletes it. Storage Object Viewer can’t write audit logs.
3. Add a storage integration
This step is required for importing data. It’s not required for exporting audit logs. Instead, enter your service account key when you configure audit logs.
Use the console
In the Pinecone console, add an integration with Google Cloud Storage:- Select your project.
- Go to Manage > Storage integrations.
- Click Add integration.
- Enter a unique integration name.
- Select Google Cloud Storage.
- Open the JSON key file for your service account.
- Copy the contents of the key file and paste them into the Service account key JSON field.
- Click Add integration.
Use the API
This endpoint requires
X-Pinecone-Api-Version: unstable. Unstable endpoints can change without notice.gcp_service_account.key_json field. The following example uses jq to safely JSON-encode the key file before sending it:
curl
service-account-key.json with the path to the JSON key file you created, and my-gcs-integration with a unique name for the integration.
The response includes the integration’s id, which you need to import data, and a status of Validated or Invalid. If the service account key is invalid, the request still succeeds and the integration is created with a status of Invalid, so check the status before you import.
Next steps
- Import data from your GCS bucket into your Pinecone index.
- Configure audit logs to export logs to your GCS bucket.