#!/usr/bin/env bash
# Bootstrap AWS infrastructure with Terraform
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/../.." && pwd)"
TF_DIR="$ROOT/deploy/terraform/aws"

cd "$TF_DIR"

if [[ ! -f terraform.tfvars ]]; then
  echo "Copy terraform.tfvars.example → terraform.tfvars and fill secrets"
  exit 1
fi

terraform init
terraform plan -out=tfplan
echo "Review plan above. Run: terraform apply tfplan"
