#!/usr/bin/env bash

set -euo pipefail

# NOTE: This program will dump everything to stdout. It is intended to be used with
# with a redirect or pipe.
PGPASSWORD=$(vault read -field=value secret/hwsi_run-2/production-us-west-1/postgres_password) \
    pg_dump \
    --host=internal-postgres.cp4rxnpmuhoe.us-west-1.rds.amazonaws.com \
    --username=hwsi_run-2 \
    --format tar \
    hwsi_run-2
