The Terraform provider for Timescale.
- Terraform >= 1.0
Check provider documentation
- Go >= v1.24
- Clone the repository
- Enter the repository directory
- Run
make
to fmt/lint/install/generate:
make
docs
folder content is automatically generated. Please do not modify these files manually.
Update ./templates/index.md
and just run make
:
make
data-sources
and resources
doc files are generated from the actual provider go code (Schema definitions, descriptions, etc.).
By default, Terraform cli will search providers in the official registry (registry.terraform.io). The following steps will tell Terraform to look for this specific provider in the local computer. Remember to remove this configuration when finished.
Change the
$HOME/go/bin
variable to be the location of yourGOBIN
if necessary.When using the local provider, is not necessary to run
terraform init
.
To use the local provider, create a ~/.terraformrc
file with the following content:
provider_installation {
dev_overrides {
"registry.terraform.io/providers/timescale" = "$HOME/go/bin"
}
direct {}
}
From now on, terraform plan
and terraform apply
will interact with the locally installed provider.
Remember to run make
again whenever the provider code is changed.
[WARNING] Acceptance tests create real resources.
Run make
to install the last version of the provider.
Set all the required environment variables to allow the tests to run:
export TF_VAR_ts_project_id=<project_id>
export TF_VAR_ts_access_key=<access_key>
export TF_VAR_ts_secret_key=<secret_key>
export PEER_ACCOUNT_ID=<peer_account_id>
export PEER_REGION=<peer_region>
export PEER_VPC_ID=<peer_vpc_id>
export PEER_TGW_ID=<peer_tgw_id>
export TIMESCALE_DEV_URL=<api_url> # Optional: to use different environment
Use make testacc
to run the full acceptance tests suite. This can take up to 20 minutes as several services are created.
Please do not abort the execution to prevent dangling resources.
make testacc
Acceptance tests usually destroy all created assets, but failures or execution abortions can leave dangling resources.
We use sweepers to cleanup all possible dangling resources before running the acceptance tests.
make sweep