From 68be61c22703d56a10e654702d15407231385b65 Mon Sep 17 00:00:00 2001 From: Alex Schofield Date: Mon, 19 Aug 2024 20:51:30 +0100 Subject: feat: ask user if they want to destroy new infrastructure --- scripts/deploy.sh | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/deploy.sh b/scripts/deploy.sh index d7d18ff..e56088e 100755 --- a/scripts/deploy.sh +++ b/scripts/deploy.sh @@ -28,7 +28,21 @@ select yn in "Yes" "No"; do esac done - terraform apply -auto-approve + terraform apply + + echo "Would you like to destroy the newly-created infrastructure?" + select destroy_2 in "Yes" "No"; do + case $destroy_2 in + Yes) + terraform destroy + break + ;; + No) + echo "Skipping final destroy... Infrastructure will remain." + break + ;; + esac + done break ;; -- cgit v1.2.3