-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdestroy.sh
More file actions
executable file
·46 lines (38 loc) · 1.46 KB
/
destroy.sh
File metadata and controls
executable file
·46 lines (38 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
#!/bin/bash
# ============================================
# Teable Azure AKS - Cleanup Script
# ============================================
set -e
RED='\033[0;31m'
YELLOW='\033[1;33m'
GREEN='\033[0;32m'
NC='\033[0m'
echo -e "${RED}"
echo "╔════════════════════════════════════════════════════════════╗"
echo "║ ║"
echo "║ ⚠️ Teable Azure AKS - Cleanup ║"
echo "║ ║"
echo "╚════════════════════════════════════════════════════════════╝"
echo -e "${NC}"
echo -e "${YELLOW}This will destroy ALL resources created by Terraform:${NC}"
echo " • AKS Cluster"
echo " • PostgreSQL Database"
echo " • Redis Cache"
echo " • All data stored in these services"
echo ""
echo -e "${RED}This action is IRREVERSIBLE!${NC}"
echo ""
read -p "Type 'destroy' to confirm: " -r
echo
if [[ $REPLY != "destroy" ]]; then
echo "Aborted."
exit 0
fi
# Get script directory
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
cd "$SCRIPT_DIR"
echo ""
echo "Destroying resources..."
terraform destroy -auto-approve
echo ""
echo -e "${GREEN}✓ All resources destroyed${NC}"