terraform provider pinecone
v0.1.2
用於管理Pinecone資源的Terraform提供商。有關完整的提供商文檔,請參閱註冊表的提供商頁面
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
}查看示例目錄,以獲取可以在本地運行的各種示例。
在本地開發過程中,請確保在Terraform配置文件( ~/.terraformrc )中設置provider_override ,以指向本地二進製文件。
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 "
}
}
} cp .env.example .env
go test -v ./... 該項目依靠./tools/tools.go安裝tfplugindocs 。
export GOBIN=$PWD/bin
export PATH=$GOBIN:$PATH
go install github.com/hashicorp/terraform-plugin-docs/cmd/tfplugindocs
which tfplugindocs運行tfplugindocs生成文檔,並在https://registry.terraform.io/tools/doc-preview上預覽單個文件
已經完成了幾個時間步驟,並且在此讀書中不會涵蓋。有關更多信息,請參見以下腳註。 1
要將提供商的新版本發佈到註冊表中,需要創建一個新的GitHub版本。使用以下步驟進行。
main狀態,並有一棵乾淨的工作樹。git tag v0.1.2git push origin v0.1.2goreleaser : GITHUB_TOKEN=$(gh auth token) goreleaser release --clean筆記
Goreleaser配置需要設置GPG_FINGERPRINT 。也許嘗試以下(需要進行測試)
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出版的文檔:https://developer.hashicorp.com/terraform/registry/registry/providers/publishing#publishing-publishth-to-to-to-te-regristion↩