ผู้ให้บริการ Terraform สำหรับการจัดการทรัพยากรใน Pinecone สำหรับเอกสารผู้ให้บริการเต็มรูปแบบโปรดดูหน้าผู้ให้บริการรีจิสทรี
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
}ตรวจสอบไดเรกทอรีตัวอย่างสำหรับตัวอย่างต่าง ๆ ที่สามารถทำงานได้ในท้องถิ่น
ในระหว่างการพัฒนาในท้องถิ่นตรวจสอบให้แน่ใจว่าได้ตั้ง provider_override ในไฟล์การกำหนดค่า Terraform ของคุณ ( ~/.terraformrc ) เพื่อชี้ไปที่ไบนารีท้องถิ่น
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
มีสองสามขั้นตอนที่ทำไปแล้วและจะไม่ครอบคลุมใน readme นี้ ดูเชิงอรรถต่อไปนี้สำหรับข้อมูลเพิ่มเติม 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/providers/publishing#publishing-to-the-registry ↩