Skip to content

Commit

Permalink
fix: Give unique alarm_name to avoid collision when default and gunic…
Browse files Browse the repository at this point in the history
…orn both create the same alarm name. (#61)
  • Loading branch information
codyfletcher authored Jan 24, 2023
1 parent 31fc6a3 commit 3a61b6a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions modules/internal/autoscaling/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ resource "aws_appautoscaling_policy" "down" {

# CloudWatch alarm that triggers the autoscaling up policy
resource "aws_cloudwatch_metric_alarm" "service_cpu_high" {
alarm_name = "${terraform.workspace}_cpu_utilization_high"
alarm_name = "${var.service_name}_cpu_utilization_high"
comparison_operator = "GreaterThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
Expand All @@ -69,7 +69,7 @@ resource "aws_cloudwatch_metric_alarm" "service_cpu_high" {

# CloudWatch alarm that triggers the autoscaling down policy
resource "aws_cloudwatch_metric_alarm" "service_cpu_low" {
alarm_name = "${terraform.workspace}_cpu_utilization_low"
alarm_name = "${var.service_name}_cpu_utilization_low"
comparison_operator = "LessThanOrEqualToThreshold"
evaluation_periods = "2"
metric_name = "CPUUtilization"
Expand Down

0 comments on commit 3a61b6a

Please sign in to comment.