Code Monkey home page Code Monkey logo

terraform-provider-pinecone's Introduction

terraform-provider-pinecone

A Terraform provider for managing resources on Pinecone. For full provider documentation, refer to the registry’s provider page

Quickstart

terraform {
  required_providers {
    pinecone = {
      source  = "thiskevinwang/pinecone"
      version = "0.1.2"
    }
  }
}

provider "pinecone" {
  apikey      = var.pinecone_api_key # optional; PINECONE_API_KEY
  environment = var.pinecone_environment # optional; PINECONE_ENVIRONMENT
}

data "pinecone_collection" "existing-collection" {
  name = "my-existing-collection"
}

resource "pinecone_index" "my-first-index" {
  name   = "index-to-be-managed"
  metric = "cosine"
  pods   = 1

  source_collection = data.pinecone_collection.existing-collection.name
  dimension         = data.pinecone_collection.existing-collection.dimension
}

Development

Check out the examples directory for various examples that can be run locally.

During local development, make sure to set a provider_override in your Terraform configuration file (~/.terraformrc) to point to the local binary.

provider_installation {
  dev_overrides {
    # Adjust this path to point to the directory where the local provider
    # binary is present. It is likely your $GOPATH/bin directory.
    "thekevinwang.com/terraform-providers/pinecone" = "/Users/kevin/go/bin"
  }

  # For all other providers, install them directly from their origin provider
  # registries as normal. If you omit this, Terraform will _only_ use
  # the dev_overrides block, and so no other providers will be available.
  direct {}
}
terraform {
  required_providers {
    pinecone = {
      source = "thekevinwang.com/terraform-providers/pinecone"
    }
  }
}

Testing

cp .env.example .env
go test -v ./...

Documenting

This project relies on ./tools/tools.go to install tfplugindocs.

export GOBIN=$PWD/bin
export PATH=$GOBIN:$PATH
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
which tfplugindocs

Run tfplugindocs to generate docs, and preview individual files at https://registry.terraform.io/tools/doc-preview

Releasing

There are a few one time steps that have been done already and will not be covered in this README. See the following footnote for more information. 1

To release a new version of the provider to the registry, a new GitHub release needs to be created. Use the following steps to proceed.

  1. Ideally you’re on main, and have a clean working tree.
  2. Ensure the commit (aka HEAD) you're about to release is tagged.
    • git tag v0.1.2
    • git push origin v0.1.2
  3. Run goreleaser: GITHUB_TOKEN=$(gh auth token) goreleaser release --clean
    • This will create a new GitHub release which should be detected by the Terraform registry shortly after.

Note

The goreleaser config requires GPG_FINGERPRINT to be set. Maybe try the following (needs to be tested)

export GPG_FINGERPRINT=$(gpg --list-keys --with-colons | awk -F: '$1 == "fpr" || $1 == "fp2" {print $10}' | head -n 1)
export GITHUB_TOKEN=$(gh auth token)
goreleaser release --clean

Appendix

Footnotes

  1. Docs on publishing: https://developer.hashicorp.com/terraform/registry/providers/publishing#publishing-to-the-registry

terraform-provider-pinecone's People

Contributors

thiskevinwang avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

admeeer

terraform-provider-pinecone's Issues

Serverless support for the terraform pinceone provider

Pinecone serverless looks tempting to me as I manage multiple client instances that don't necessarily need pods. However, the lack of support for regions is keeping me from moving all my vector-db instances to serverless.

I would like to manage all my infrastructure, including pinecone vector indexes. But, I'm a bit concerned that serverless support might take too long for the Terraform provider.

I'm a bit of a newbie to Terraform and I doubt I'll have enough time to come up with a work-around for this provider. Would appreciate any guidance. I might just stick to using the Pinecone API to manage indexes if this provider won't get updated.

Error: Resource Type Not Found when trying to use examples/resource

Using the example in examples/resource and then running terraform init then terraform plan gives me:

│ Error: Resource Type Not Found
│
│   with pinecone_index.my-first-index,
│   on main.tf line 19, in resource "pinecone_index" "my-first-index":
│   19: resource "pinecone_index" "my-first-index" {
│
│ No resource type named "pinecone_index" was found in the provider.

Is this a registry issue? I have this in main.tf, and when I run terraform init it successfully installs the binary.

...
  required_providers {
    pinecone = {
      source  = "thiskevinwang/pinecone"
    }
  }
...

Serverless Resource creation

Hello, since pinecone introduced their new serverless solution for vector database, is it possible to update this provider such that we can create serverless index with terraform?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.