feat: migrated lan terraform infra to minio backend
parent
e62c81897e
commit
54b9c5935a
15
lan/justfile
15
lan/justfile
|
@ -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_hetzner_token := `pass hetzner.com/tokens/suricata`
|
||||||
export TF_VAR_pg_passwd := `pass pg.monotremata.xyz/terraform`
|
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:
|
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:
|
plan *ARGS:
|
||||||
terraform plan {{ARGS}}
|
terraform plan {{ARGS}}
|
||||||
|
|
11
lan/main.tf
11
lan/main.tf
|
@ -1,6 +1,13 @@
|
||||||
terraform {
|
terraform {
|
||||||
backend "pg" {}
|
backend "s3" {
|
||||||
required_providers {
|
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
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue