A Terraform provider for managing InfluxDB resources.
This provider supports managing the following InfluxDB resources:
- Buckets (
influxdb_bucket) - Create and manage data storage buckets with retention policies - Tasks (
influxdb_task) - Create and manage scheduled Flux query tasks - Checks (
influxdb_check) - Create and manage monitoring checks
The provider will be available from the Terraform Registry. Add this to your Terraform configuration:
terraform {
required_providers {
influxdb = {
source = "xing/influxdb"
}
}
}provider "influxdb" {
url = "http://localhost:8086"
token = "your-influxdb-token"
org = "your-organization"
}resource "influxdb_bucket" "example" {
name = "my-bucket"
description = "Example bucket"
retention_seconds = 604800 # 7 days
}resource "influxdb_task" "example" {
name = "my-task"
description = "Example task"
every = "1h"
flux = <<-EOT
from(bucket: "my-bucket")
|> range(start: -1h)
|> mean()
|> to(bucket: "processed-data")
EOT
}See the examples README for detailed instructions on setting up and testing the provider locally.
# Build for current platform
make build
# Run tests
make test
# Install locally for development
make install
# Format and lint code
make fmt
make lintThis project uses GoReleaser for releases. See RELEASE.md for detailed release instructions.
Quick release:
make release-notes VERSION=v0.1.8 # Edit RELEASE_NOTES.md
git add RELEASE_NOTES.md && git commit -m "Release v0.1.8" && git tag v0.1.8
make goreleaser-release VERSION=v0.1.8Detailed documentation for each resource is available in the docs directory.
- Fork the repository
- Create a feature branch (
git checkout -b feature/amazing-feature) - Make your changes and add tests
- Run
make test fmt lintto validate changes - Commit your changes (
git commit -am 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
Follow Terraform provider best practices for development.
This project is licensed under the MIT License - see the LICENSE file for details.