feat: migrated lan terraform infra to minio backend

main
Ricard Illa 2023-07-03 11:36:57 +02:00
parent e62c81897e
commit 54b9c5935a
2 changed files with 13 additions and 13 deletions

View File

@ -1,18 +1,11 @@
pg_user := "terraform"
# pg_host := "pg.monotremata.xyz"
pg_host := "narwhal"
pg_db := "terraform_lan"
pg_port := "5432"
passwd := `pass pg.monotremata.xyz/terraform`
# todo: I'll use this once string interpolation gets implenented in Just https://github.com/casey/just/issues/11
# conn_str := f"postgres://{{pg_user}}:{{passwd}}@{{pg_host}}:{{pg_port}}/{{pg_db}}"
export TF_VAR_hetzner_token := `pass hetzner.com/tokens/suricata`
export TF_VAR_pg_passwd := `pass pg.monotremata.xyz/terraform`
minio_access_key := `pass minio.monotremata.xyz/terraform/access_key`
minio_secret_key := `pass minio.monotremata.xyz/terraform/secret_key`
init:
terraform init -backend-config="conn_str=postgres://{{pg_user}}:{{passwd}}@{{pg_host}}:{{pg_port}}/{{pg_db}}"
terraform init -backend-config="access_key={{minio_access_key}}" -backend-config="secret_key={{minio_secret_key}}"
plan *ARGS:
terraform plan {{ARGS}}

View File

@ -1,6 +1,13 @@
terraform {
backend "pg" {}
required_providers {
backend "s3" {
endpoint = "https://minio.monotremata.xyz"
bucket = "terraform"
key = "terraform.state"
region = "main"
force_path_style = true
skip_credentials_validation = true
skip_metadata_api_check = true
skip_region_validation = true
}
}