feat: add opentofu remote bucket state storage

This commit is contained in:
Alexander Navarro 2025-01-16 12:51:07 -03:00
parent 65a98c6f57
commit 59e69ffceb
3 changed files with 24 additions and 0 deletions

2
.env.example Normal file
View file

@ -0,0 +1,2 @@
AWS_ACCESS_KEY_ID=""
AWS_SECRET_ACCESS_KEY=""

View file

@ -1,3 +1,5 @@
set dotenv-load := true
export ANSIBLE_VAULT_PASSWORD_FILE := justfile_directory() + "/.decrypt-pass.txt"
export ANSIBLE_BECOME_PASSWORD_FILE := justfile_directory() + "/.become-pass.txt"
@ -34,3 +36,7 @@ decrypt +ARGS:
[no-cd]
decrypt-store +ARGS:
uv run ansible-vault decrypt {{ ARGS }}
[no-cd]
tofu +ARGS:
tofu {{ ARGS }}

View file

@ -7,6 +7,22 @@ terraform {
version = "0.43.2"
}
}
backend "s3" {
bucket = "opentofu-state"
region = "us-east-1"
key = "lxc/terraform.tfstate"
encrypt = false
skip_credentials_validation = true
skip_region_validation = true
skip_requesting_account_id = true
skip_s3_checksum = true
endpoints = {
s3 = "https://a7638f5d66d44acc48d4b80b7c3c8a0c.r2.cloudflarestorage.com"
}
}
}
provider "proxmox" {