Terraform is an infrastructure as code tool that lets you create, update, and version infrastructure by defining resources in configuration files. This allows for a repeated workflow for provisioning and managing your infrastructure. This page describes how to use the Terraform Provider for Pinecone to manage Pinecone indexes, collections, API keys, and projects.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.
Requirements
Ensure you have the following:- Terraform >= v1.4.6
- Go >= v1.23.7
- A Pinecone API key for managing indexes and collections
- A Pinecone service account for managing API keys and projects
Install the provider
-
Configuring the Pinecone provider in your Terraform configuration file:
-
Run
terraform initto install the provider from the Terraform registry. Alternatively, you can download the latest binary for your target platfrom the GitHub repository.
Authenticate
For managing indexes and collections, you authenticate with a Pinecone API key. For managing API keys and projects, you authenticate with Pinecone service account credentials (client ID and client secret).-
Set environment variables for authentication:
-
Append the following to your Terraform configuration file:
You can also set the API key and/or service account credential as input variables.
Manage resources
The Terraform Provider for Pinecone allows Terraform to manage indexes, collections, API keys, and projects.Indexes
Thepinecone_index resource lets you create, update, and delete indexes.
You can update only the index deletion protection, tags, and integrated inference embedding settings of an index.
Collections
Thepinecone_collection resource lets you create and delete collections for pod-based indexes.
API keys
Thepinecone_api_key resource lets you create, update, and delete API keys.
You can update only the name and roles of an API key.
Projects
Thepinecone_project resource lets you create, update, and delete projects.
Limitations
The Terraform Provider for Pinecone does not support the following resources:See also
- Documentation can be found on the Terraform Registry.
- See the GitHub respository for additional usage examples.
- For support requests, create an issue in the GitHub repository.