aboutsummaryrefslogtreecommitdiff
path: root/terraform-apply.sh
blob: 7d0725e8b944c5d53b270325966771ffefe4cb54 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/bin/sh -eu

TF_VAR_vultr_api_key="$(cat ./secrets/terraform/vultr-api-key.txt)"
export TF_VAR_vultr_api_key

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