iac/tofu/s3.tofu
Sergei Poljanski 2635b887c7
All checks were successful
nixos / nixos (push) Successful in 1m3s
nixos: drop the rehearsal pair and other migration leftovers
The test pair served the move to NixOS, which is done. Its overlays,
dummy secrets and sops recipients go; the rules for testing on a copy
of production stay in nixos/README.md, and git log finds the overlay
if it is needed again. Options that existed only for it (alert address,
Loki bucket, extra cert-push keys) are inlined, and comments still
pointing at Ansible or MIGRATION.md are corrected.

The tofu README now spells out the state bucket bootstrap: the bucket
is a resource in the state it holds, so a new project needs one local
apply first. The bucket gets prevent_destroy for the same reason.

Assisted-by: Claude:opus-5-5
2026-11-17 11:11:33 +04:00

72 lines
1.7 KiB
HCL

# OpenTofu state (backend in providers.tofu), replicated hel1 -> fsn1
resource "minio_s3_bucket" "state_main" {
provider = minio.hel1
bucket = "asxpio-tofu-main"
acl = "private"
# Holds the state that manages it
lifecycle {
prevent_destroy = true
}
}
resource "minio_s3_bucket" "state_repl" {
provider = minio.fsn1
bucket = "asxpio-tofu-repl"
acl = "private"
}
# Where the state lived until 2026-11-17 (named after Terraform). Kept
# until the migrated state has been used for a while, then emptied and
# removed.
moved {
from = minio_s3_bucket.terraform_main
to = minio_s3_bucket.legacy_state_main
}
moved {
from = minio_s3_bucket.terraform_repl
to = minio_s3_bucket.legacy_state_repl
}
resource "minio_s3_bucket" "legacy_state_main" {
provider = minio.hel1
bucket = "asxpio-terraform-main"
acl = "private"
}
resource "minio_s3_bucket" "legacy_state_repl" {
provider = minio.fsn1
bucket = "asxpio-terraform-repl"
acl = "private"
}
resource "minio_s3_bucket" "backups_main" {
provider = minio.hel1
bucket = "asxpio-backups-main"
acl = "private"
}
resource "minio_s3_bucket" "backups_repl" {
provider = minio.fsn1
bucket = "asxpio-backups-repl"
acl = "private"
}
# Loki's chunks (asxpio-ops, services.loki). Created by hand on
# 2026-11-14, adopted here on 2026-11-17.
import {
to = minio_s3_bucket.loki_main
id = "asxpio-loki-main"
}
resource "minio_s3_bucket" "loki_main" {
provider = minio.hel1
bucket = "asxpio-loki-main"
acl = "private"
}
resource "minio_s3_bucket" "loki_repl" {
provider = minio.fsn1
bucket = "asxpio-loki-repl"
acl = "private"
}