Skip to main content
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.

Requirements

Ensure you have the following:

Install the provider

  1. Configuring the Pinecone provider in your Terraform configuration file:
  2. 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).
  1. Set environment variables for authentication:
  2. 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

The pinecone_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

The pinecone_collection resource lets you create and delete collections for pod-based indexes.

API keys

The pinecone_api_key resource lets you create, update, and delete API keys.
You can update only the name and roles of an API key.

Projects

The pinecone_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