Giter Site home page Giter Site logo

terraform-provider-influxdb-v2's Introduction

InfluxDB v2 Provider

The InfluxDB v2 provider allows Terraform to manage InfluxDB v2.

How to use

Download the provider

cd examples
mkdir -p terraform.d/plugins/lancey.fr/influx/influxdb-v2/0.3.0/linux_amd64/
cd terraform.d/plugins/lancey.fr/influx/influxdb-v2/0.3.0/linux_amd64/
wget https://github.com/lancey-energy-storage/terraform-provider-influxdb-v2/releases/download/v0.3.0/terraform-provider-influxdb-v2_v0.3.0-v0.3.0-linux-amd64.tar.gz
tar xvzf terraform-provider-influxdb-v2_v0.3.0-v0.3.0-linux-amd64.tar.gz && rm -rf terraform-provider-influxdb-v2_v0.3.0-v0.3.0-linux-amd64.tar.gz
filename=$(echo terraform-provider-influxdb-v2*)
chmod +x $filename
mv "$filename" "${filename%.*}"

Terraform 0.13.x

Add this snippet to your code:

terraform {
  required_providers {
    influxdb-v2 = {
      source = "lancey.fr/influx/influxdb-v2"
      version = "0.3.0"
    }
  }
}

Initialize the provider

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 the INFLUXDB_V2_URL environment variable. Defaults to http://localhost:8086/.

  • token (Optional) The token that gives access to the influxdb instance. May alternatively be set via the INFLUXDB_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)
  • the dedicated provider (terraform) available here

Available functionalities

Documentation is available in website/docs/. Influxdb v2 api documentation is available here.

Data sources

  • ready (status of the influxdb-v2 instance)

Resources

  • bucket

  • authorization (tokens)

Examples

Find examples in examples/. To run them:

source ./start_influxdb.sh
terraform init
terraform apply
./stop_influxdb.sh

Dev

In case you need to update the influx client, run go get github.com/influxdata/influxdb-client-go@<commit sha>.
Also don't forget to run go mod tidy from time to time to remove useless dependencies.

Test

First execute this command to check fmt requirements:

make fmt

Then execute this command to run the provider unit tests:

make test

And finally to run acceptance tests, execute these commands (requires docker and jq):

source ./scripts/setup_influxdb.sh
make testacc
make stop-influx

Build

go build -o terraform-provider-influxdb-v2

terraform-provider-influxdb-v2's People

Contributors

fredpi17 avatar mj-lancey avatar mjanv avatar mtrijasse avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.