From f8a93abca5d4632424ca93e885921f2eca1f1ba6 Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Thu, 21 Nov 2024 16:15:55 -0800 Subject: [PATCH 1/2] Make _hibernate() exit early if `make validate` fails --- environment | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/environment b/environment index 845164554b..220c0bde8f 100644 --- a/environment +++ b/environment @@ -332,7 +332,7 @@ _hibernate() { if test -z "$azul_terraform_component"; then make -C lambdas && { cd terraform && - make validate + make validate && terraform destroy -target aws_elasticsearch_domain.index && { cd gitlab && _select "$AZUL_DEPLOYMENT_STAGE.gitlab" && From 06c0960e1125433e0961b882db6a9c157976af62 Mon Sep 17 00:00:00 2001 From: Daniel Sotirhos Date: Tue, 12 Nov 2024 15:44:10 -0800 Subject: [PATCH 2/2] Fix: CloudWatch alarms left triggered after _hibernate function is used (#6702) --- environment | 20 +++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/environment b/environment index 220c0bde8f..4b2eb68134 100644 --- a/environment +++ b/environment @@ -332,20 +332,34 @@ _hibernate() { if test -z "$azul_terraform_component"; then make -C lambdas && { cd terraform && - make validate && - terraform destroy -target aws_elasticsearch_domain.index && { + make validate && { + terraform destroy \ + -target aws_cloudwatch_metric_alarm.indexercachehealth \ + -target aws_cloudwatch_metric_alarm.servicecachehealth \ + -target aws_elasticsearch_domain.index + } && { + cd shared && + _select "$AZUL_DEPLOYMENT_STAGE.shared" && + make validate && + terraform destroy \ + -target aws_cloudwatch_metric_alarm.clamscan \ + -target aws_cloudwatch_metric_alarm.freshclam + } && { cd gitlab && _select "$AZUL_DEPLOYMENT_STAGE.gitlab" && make validate && terraform destroy \ + -target aws_cloudwatch_metric_alarm.gitlab_cpu_use \ + -target aws_cloudwatch_metric_alarm.gitlab_data_disk_use \ + -target aws_cloudwatch_metric_alarm.gitlab_root_disk_use \ -target aws_ec2_client_vpn_endpoint.gitlab \ -target aws_instance.gitlab \ -target aws_nat_gateway.gitlab_0 \ -target aws_nat_gateway.gitlab_1 \ -target aws_lb.gitlab_nlb \ -target aws_lb.gitlab_alb - } } + } else echo "Must have main component selected" return 1