Files
OpenTofuPlayground/k8s/backend.tf
Lutz Finsterle 3bf5960302
Some checks failed
Deploy / Update K8s Apps / Detect changed K8s tfvars (push) Failing after 13s
Deploy / Update Apps / Detect changed tfvars files (push) Failing after 13s
Test / Static Analysis (push) Failing after 11s
Test / Unit Tests — Docker Stack (push) Has been skipped
Test / Unit Tests — K8s Stack (push) Has been skipped
Deploy / Update K8s Apps / Deploy ${{ matrix.tfvars }} (push) Has been skipped
Deploy / Update K8s Apps / Destroy ${{ matrix.tfvars }} (push) Has been skipped
Deploy / Update Apps / Deploy ${{ matrix.tfvars }} (push) Has been skipped
Deploy / Update Apps / Destroy ${{ matrix.tfvars }} (push) Has been skipped
Test / Integration Test — K8s (k3d) (push) Has been skipped
Initial Commit
2026-03-06 19:17:15 +01:00

31 lines
1.5 KiB
HCL

# ─── State Backend ────────────────────────────────────────────────────────────
#
# Mirrors the Docker stack backend configuration — same SeaweedFS store,
# separate state keys under apps-k8s/.
#
# OPTION A — SeaweedFS S3 API (recommended)
# ─────────────────────────────────────────────────────────────────────────────
# Initialise with:
# cd k8s/
# tofu init \
# -backend-config="bucket=tofu-state" \
# -backend-config="key=apps-k8s/${APP_NAME}.tfstate" \
# -backend-config="endpoint=http://seaweedfs.example.com:8333" \
# -backend-config="region=us-east-1" \
# -backend-config="force_path_style=true"
#
# Credentials via environment variables on the CI runner:
# AWS_ACCESS_KEY_ID = <seaweedfs-access-key>
# AWS_SECRET_ACCESS_KEY = <seaweedfs-secret-key>
#
# Uncomment to enable:
#
# terraform {
# backend "s3" {}
# }
# OPTION B — Local backend (default, for local development)
# ─────────────────────────────────────────────────────────────────────────────
# State stored at k8s/terraform.tfstate.d/<workspace>/terraform.tfstate
# Add k8s/**/.terraform and k8s/terraform.tfstate* to .gitignore.