snix/ops/hetzner-s3/snix.tf
Florian Klink a52ea3675c feat(*): initialize new Snix infrastructure
Co-Authored-By: edef <edef@edef.eu>
Co-Authored-by: Ryan Lahfa <raito@lix.systems>
Change-Id: Ica1cda177a236814de900f50a8a61d288f58f519
2025-03-17 17:15:07 +00:00

63 lines
1.4 KiB
HCL

# Hetzner S3 configuration for snix
# https://docs.hetzner.com/storage/object-storage/getting-started/creating-a-bucket-minio-terraform/
terraform {
required_providers {
minio = {
source = "aminueza/minio"
}
}
backend "s3" {
endpoints = {
s3 = "https://s3.dualstack.eu-central-1.amazonaws.com"
}
bucket = "snix-tfstate"
key = "terraform/snix-hetzner-s3"
region = "eu-central-1"
skip_credentials_validation = true
skip_metadata_api_check = true
skip_requesting_account_id = true
}
}
# Hetzner access keys, not to confuse with the state S3.
variable "access_key" {}
variable "secret_key" {
sensitive = true
}
provider "minio" {
minio_server = "fsn1.your-objectstorage.com"
minio_user = "${var.access_key}"
minio_password = "${var.secret_key}"
minio_region = "fsn1"
minio_ssl = true
}
resource "minio_s3_bucket" "mimir" {
bucket = "snix-mimir"
acl = "private"
object_locking = false
}
resource "minio_s3_bucket" "loki" {
bucket = "snix-loki"
acl = "private"
object_locking = false
}
resource "minio_s3_bucket" "tempo" {
bucket = "snix-tempo"
acl = "private"
object_locking = false
}
resource "minio_s3_bucket" "backups" {
bucket = "snix-backups"
acl = "private"
object_locking = false
}