The InfluxDB v2 provider allows Terraform to manage InfluxDB v2.
Add this snippet to your code:
terraform {
required_providers {
influxdb-v2 = {
source = "hasanhakkaev/influxdb-v2"
version = "0.4.4"
}
}
}
provider "influxdb-v2" {
url = "http://influxdb.example.com:8086"
token = "influxdbToken"
}
The provider configuration block accepts the following arguments:
-
url
(Optional) The root URL of a InfluxDB V2 server. May alternatively be set via theINFLUXDB_V2_URL
environment variable. Defaults tohttp://localhost:8086/
. -
token
(Optional) The token that gives access to the influxdb instance. May alternatively be set via theINFLUXDB_V2_TOKEN
environment variable.
A token can be acquired by executing the onboarding process, which is possible using:
- influx GUI, API or command line (manually)
Documentation is available in website/docs/. Influxdb v2 api documentation is available here.
- ready (status of the influxdb-v2 instance)
- organization (get an organization by name)
- bucket
- authorization (tokens)
- organization
Find examples in examples/
. To run them:
TaskFile (https://taskfile.dev/)
Precommit framework (https://pre-commit.com/)
Docker (https://www.docker.com/)
Go 1.16^ (https://golang.org/doc/install)
Terraform 0.13^ (https://www.terraform.io/downloads.html)
InfluxDB 2.0^ (https://docs.influxdata.com/influxdb/v2.0/install/)
# Run Task init to download dependencies
task init
First execute this command to lint and format the code:
task lint
To run acceptance tests, execute these commands (requires docker
and jq
):
task start-influx
task test
task stop-influx
task build