vps/tf-infra/state.sh
2024-02-24 12:57:17 +01:00

15 lines
385 B
Bash
Executable file

#!/usr/bin/env bash
BUCKET="nilstrieb-states"
case "$1" in
download)
aws s3api get-object --bucket "$BUCKET" --key "terraform.tfstate" "terraform.tfstate"
;;
upload)
aws s3api put-object --bucket "$BUCKET" --key "terraform.tfstate" --body "terraform.tfstate"
;;
*)
echo "subcommand download or upload required"
exit 1
esac