From 231b371e5f23eb25fc5e72ec1a229e8f04824589 Mon Sep 17 00:00:00 2001 From: Kevin Wang Date: Sat, 7 Oct 2023 21:26:37 -0400 Subject: [PATCH] chore: README --- README.md | 57 ++++++++++++++++++++++++++++++++++++++++++++++++++++--- 1 file changed, 54 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index a14f751..9231cb1 100644 --- a/README.md +++ b/README.md @@ -1,17 +1,68 @@ # terraform-provider-pinecone -## Development +A Terraform provider for managing resources on [Pinecone](https://pinecone.io/). For full provider documentation, refer to the [registry’s provider page](https://registry.terraform.io/providers/thiskevinwang/pinecone/latest/docs) + +## Quickstart ```hcl terraform { required_providers { pinecone = { - source ="thekevinwang.com/terraform-providers/pinecone" + source = "thiskevinwang/pinecone" + version = "0.1.2" } } } -provider "pinecone" {} +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](./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. + +```hcl +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 {} +} +``` + +```hcl +terraform { + required_providers { + pinecone = { + source = "thekevinwang.com/terraform-providers/pinecone" + } + } +} ``` ## Testing