aboutsummaryrefslogtreecommitdiff
path: root/terraform-apply.sh
blob: 8179b96690d8d78e95f7256638f0bc9f4ecfe9c7 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env nix-shell
#!nix-shell -i bash
# shellcheck shell=bash
set -Eeuo pipefail
cd "$(dirname "${BASH_SOURCE[0]}")"

rm -rf .terraform/
terraform init
PLAN_FILE="./secrets/terraform/plan-files/$(date -Iseconds).tfplan"
terraform plan -out="${PLAN_FILE}"
# shellcheck disable=2162
read -p "Is the above Terraform plan acceptable? Press CTRL+c to cancel."
terraform apply "${PLAN_FILE}"