From 62730596150faa98412f0e92bd419e1652eb624b Mon Sep 17 00:00:00 2001 From: Mohammad Iqbal Date: Fri, 25 Oct 2024 15:02:48 +0100 Subject: [PATCH 1/2] [PRMP-1076] Remove scale-up/scale-down alarms on pre-prod and prod --- terraform/alarm.tf | 4 ++++ terraform/pre-prod.tfvars | 2 +- terraform/prod.tfvars | 2 +- 3 files changed, 6 insertions(+), 2 deletions(-) diff --git a/terraform/alarm.tf b/terraform/alarm.tf index 7aba5a970..b15967b75 100644 --- a/terraform/alarm.tf +++ b/terraform/alarm.tf @@ -343,6 +343,8 @@ resource "aws_cloudwatch_metric_alarm" "splunk_uploader_sns_topic_error_log_alar } resource "aws_cloudwatch_metric_alarm" "scale_up" { + count = contains(["dev", "test", "perf"], var.environment) ? 1 : 0 + alarm_name = "${var.environment}-${var.component_name}-scale-up" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "1" @@ -376,6 +378,8 @@ resource "aws_cloudwatch_metric_alarm" "scale_up" { } resource "aws_cloudwatch_metric_alarm" "scale_down" { + count = contains(["dev", "test", "perf"], var.environment) ? 1 : 0 + alarm_name = "${var.environment}-${var.component_name}-scale-down" comparison_operator = "GreaterThanOrEqualToThreshold" evaluation_periods = "1" diff --git a/terraform/pre-prod.tfvars b/terraform/pre-prod.tfvars index 404a641ff..79e8d3794 100644 --- a/terraform/pre-prod.tfvars +++ b/terraform/pre-prod.tfvars @@ -3,6 +3,6 @@ environment = "pre-prod" task_cpu = 512 task_memory = 1024 -service_desired_count = "0" +service_desired_count = "1" log_level = "info" \ No newline at end of file diff --git a/terraform/prod.tfvars b/terraform/prod.tfvars index fe20d3fb8..82d1c7d84 100644 --- a/terraform/prod.tfvars +++ b/terraform/prod.tfvars @@ -3,6 +3,6 @@ environment = "prod" task_cpu = 512 task_memory = 1024 -service_desired_count = "0" +service_desired_count = "1" log_level = "info" \ No newline at end of file From 919d081f55504072237ea918bd8b696798e294db Mon Sep 17 00:00:00 2001 From: Andy Flint Date: Mon, 28 Oct 2024 15:43:21 +0000 Subject: [PATCH 2/2] [PRMP-1076] Removed perf environment from scale up & down alarms --- terraform/alarm.tf | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/terraform/alarm.tf b/terraform/alarm.tf index b15967b75..6c99dcc90 100644 --- a/terraform/alarm.tf +++ b/terraform/alarm.tf @@ -343,7 +343,7 @@ resource "aws_cloudwatch_metric_alarm" "splunk_uploader_sns_topic_error_log_alar } resource "aws_cloudwatch_metric_alarm" "scale_up" { - count = contains(["dev", "test", "perf"], var.environment) ? 1 : 0 + count = contains(["dev", "test"], var.environment) ? 1 : 0 alarm_name = "${var.environment}-${var.component_name}-scale-up" comparison_operator = "GreaterThanOrEqualToThreshold" @@ -378,7 +378,7 @@ resource "aws_cloudwatch_metric_alarm" "scale_up" { } resource "aws_cloudwatch_metric_alarm" "scale_down" { - count = contains(["dev", "test", "perf"], var.environment) ? 1 : 0 + count = contains(["dev", "test"], var.environment) ? 1 : 0 alarm_name = "${var.environment}-${var.component_name}-scale-down" comparison_operator = "GreaterThanOrEqualToThreshold"