feat: added minio bucket with terraform state

main
Ricard Illa 2023-07-04 15:31:18 +02:00
parent a5ff541a05
commit d9ffa00b03
3 changed files with 26 additions and 5 deletions

View File

@ -1,4 +1,3 @@
# 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`
export TF_VAR_minio_root_user := "rilla" export TF_VAR_minio_root_user := "rilla"
export TF_VAR_minio_root_password := `pass minio.monotremata.xyz/rilla` export TF_VAR_minio_root_password := `pass minio.monotremata.xyz/rilla`
@ -7,13 +6,14 @@ export LINODE_TOKEN := `pass linode.com/token`
export VULTR_API_KEY := `pass vultr.com/api_key` export VULTR_API_KEY := `pass vultr.com/api_key`
export HETZNER_DNS_API_TOKEN := `pass hetzner.com/tokens/terraform` export HETZNER_DNS_API_TOKEN := `pass hetzner.com/tokens/terraform`
minio_access_key := `pass minio.monotremata.xyz/terraform/access_key` export MINIO_ENDPOINT := "minio.monotremata.xyz:443"
minio_secret_key := `pass minio.monotremata.xyz/terraform/secret_key` export MINIO_USER := `pass minio.monotremata.xyz/terraform/access_key`
export MINIO_PASSWORD := `pass minio.monotremata.xyz/terraform/secret_key`
init: init:
terraform init \ terraform init \
-backend-config="access_key={{minio_access_key}}" \ -backend-config="access_key=$(pass minio.monotremata.xyz/terraform/access_key)" \
-backend-config="secret_key={{minio_secret_key}}" -backend-config="secret_key=$(pass minio.monotremata.xyz/terraform/secret_key)"
plan *ARGS: plan *ARGS:
terraform plan {{ARGS}} terraform plan {{ARGS}}

View File

@ -79,3 +79,7 @@ module "minio" {
minio_console_url = "minio-console.monotremata.xyz" minio_console_url = "minio-console.monotremata.xyz"
minio_host_path = "/mnt/k3s_volumes/minio" minio_host_path = "/mnt/k3s_volumes/minio"
} }
module "minio_buckets" {
source = "./modules/minio_buckets"
}

View File

@ -0,0 +1,17 @@
terraform {
required_providers {
minio = {
source = "aminueza/minio"
version = ">= 1.15.2"
}
}
}
provider "minio" {
minio_ssl = true
}
resource "minio_s3_bucket" "state_terraform_s3" {
bucket = "terraform"
acl = "private"
}