diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2023-10-25 13:10:25 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2023-10-25 13:10:25 +0200 |
commit | 00528d745695ffab8b25879f6ba5d795f5423b9f (patch) | |
tree | c2fb4d2aff29d07fd49103c671bce00b56e90b3c /terraform/influxdb/influxdb.tf | |
parent | c73a53806b95d2d2908b67611a709afc8c980c2e (diff) | |
download | infra-00528d745695ffab8b25879f6ba5d795f5423b9f.tar.gz infra-00528d745695ffab8b25879f6ba5d795f5423b9f.tar.bz2 infra-00528d745695ffab8b25879f6ba5d795f5423b9f.tar.xz infra-00528d745695ffab8b25879f6ba5d795f5423b9f.zip |
influxdb
Diffstat (limited to 'terraform/influxdb/influxdb.tf')
-rw-r--r-- | terraform/influxdb/influxdb.tf | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/terraform/influxdb/influxdb.tf b/terraform/influxdb/influxdb.tf new file mode 100644 index 0000000..63ba0ff --- /dev/null +++ b/terraform/influxdb/influxdb.tf @@ -0,0 +1,44 @@ +resource "docker_image" "influxdb" { + name = "influxdb:2.7.3" +} + +resource "docker_volume" "influxdb" { + name = "influxdb" +} + +resource "docker_container" "influxdb" { + image = docker_image.influxdb.image_id + name = "influxdb" + privileged = false + must_run = true + + networks_advanced { + name = data.docker_network.traefik.name + } + + command = [ + "--reporting-disabled", + ] + + dynamic "labels" { + for_each = [ + { label = "traefik.enable", value = "true" }, + { label = "traefik.docker.network", value = data.docker_network.traefik.name }, + { label = "traefik.http.routers.influxdb.rule", value = "Host(`influxdb.vpn.trygvis.io`)" }, + { label = "traefik.http.routers.influxdb.entrypoints", value = "websecure" }, + { label = "traefik.http.routers.influxdb.tls.certresolver", value = "linode" }, + ] + content { + label = labels.value["label"] + value = labels.value["value"] + } + } + + env = [ + ] + + volumes { + volume_name = docker_volume.influxdb.name + container_path = "/var/lib/influxdb2" + } +} |