The Terraform Provider for PGVecto.rs Cloud allows Terraform to manage PGVecto.rs Cloud resources. To learn more or you have found a security issue in The Terraform Provider, please Contact Us.
Note
PGVecto.rs is a Postgres extension that enables scalable vector search, allowing you to build powerful similarity-based applications on top of your Postgres database.
If you're building the provider, follow the instructions to install it as a plugin. After placing it into your plugins directory, run terraform init
to initialize the provider.
Your PGVecto.rs Cloud API Key is required to use the Terraform Provider. You can obtain an API Key by signing up for an account at PGVecto.rs Cloud.
provider "pgvecto-rs-cloud" {
api_key = "<your_api_key>"
}
Remember, your API Key should be a protected secret. See how to protect sensitive input variables when setting your API Key this way.
See PGVecto.rs Cloud Terraform Integration Overview for more information.
Clone the repository
$ git clone git@github.com:<your_org>/terraform-provider-pgvecto-rs-cloud.git
Enter the repository directory
$ cd terraform-provider-pgvecto-rs-cloud
Build the provider using the Go install
command, the install directory depends on the GOPATH environment variable.
go install .
This provider uses Go modules. Please see the Go documentation for the most up to date information about using Go modules.
To add a new dependency github.com/author/dependency
to your Terraform provider:
go get github.com/author/dependency
go mod tidy
Then commit the changes to go.mod
and go.sum
.
If you wish to work on the provider, you'll first need Go installed on your machine (see Requirements above).
To compile the provider, run go install
. This will build the provider and put the provider binary in the $GOPATH/bin
directory.
To generate or update documentation, run go generate
.
In order to run the full suite of Acceptance tests, run make testacc
.
Note: Acceptance tests create real resources, and often cost money to run.
PGVECTORS_CLOUD_API_KEY=pgrs-xxxxxxxxxxxx PGVECTORS_CLOUD_API_URL=https://cloud.pgvecto.rs/api/v1 make testacc
# test restore from backup
PGVECTORS_CLOUD_API_KEY=pgrs-xxxxxxxxxxxx PGVECTORS_CLOUD_API_URL=https://cloud.pgvecto.rs/api/v1 BACKUP_ID=b29f3124-0796-43a5-b565-68e684dcb07b make testacc
# test pitr
PGVECTORS_CLOUD_API_KEY=pgrs-xxxxxxxxxxxx PGVECTORS_CLOUD_API_URL=https://cloud.pgvecto.rs/api/v1 CLUSTER_ID=7d06b73d-807f-4b4f-a397-1c1eac768333 TARGET_TIME=2024-09-11T00:00:00+08:00 make testacc