#!/bin/bash
MINIO_ACCESS_KEY=$(vault kv get -mount="management" -field="access_key" "minio")
MINIO_SECRET_KEY=$(vault kv get -mount="management" -field="secret_key" "minio")

cat << EOF > backend.tfvars
access_key = "${MINIO_ACCESS_KEY}"
secret_key = "${MINIO_SECRET_KEY}"
bucket     = "${BUCKET}"
key        = "terraform.tfstate"
region     = "eu-central-1"
EOF
