#!/usr/bin/env bash
# "strict" mode for bash.
# See http://redsymbol.net/articles/unofficial-bash-strict-mode/
set -euo pipefail
IFS=$'\n\t'

environment="${1:-production}"
terraform init
set +e
terraform workspace new "$environment"
set -e
terraform workspace select "$environment"
terraform apply -auto-approve=false
