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↩