-
Notifications
You must be signed in to change notification settings - Fork 0
Home
Thulasiraj Komminar edited this page Aug 21, 2024
·
2 revisions
terraform {
required_providers {
influxdb = {
source = "komminarlabs/influxdb3"
version = "1.0.1"
}
}
}
provider "influxdb3" {
account_id = "*******"
cluster_id = "*******"
token = "*******"
url = "https://console.influxdata.com/api/v0"
}
resource "influxdb3_database" "signals" {
name = "signals"
retention_period = 604800
partition_template = [
{
type = "tag"
value = "line"
},
{
type = "tag"
value = "station"
},
{
type = "time"
value = "%Y-%m-%d"
},
{
type = "bucket"
value = jsonencode({
"tagName" : "temperature",
"numberOfBuckets" : 10
})
},
]
}
resource "influxdb3_token" "signals_rw" {
description = "Read & Write access to signals database"
permissions = [{
action = "read"
resource = influxdb3_database.signals.name
},
{
action = "write"
resource = influxdb3_database.signals.name
}]
}
data "influxdb3_database" "signals" {
name = "signals"
}
output "signals_bucket" {
value = data.influxdb3_database.signals
}