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 init
to 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.
Customers who signed up for a Standard or Enterprise plan on or after August 18, 2025 cannot create pod-based indexes and cannot set the max pods for a project.
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.