Skip to content

Commit 68448f5

Browse files
author
Sharp Hall
committed
Add cache name to alarm names
This makes alarm names unique when more than one elasticache instance exists with an AWS account. Otherwise, the alarm names conflict with each other.
1 parent 0d896ec commit 68448f5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

main.tf

+2-2
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ resource "aws_elasticache_subnet_group" "default" {
5656
#
5757

5858
resource "aws_cloudwatch_metric_alarm" "cpu" {
59-
alarm_name = "alarmCacheClusterCPUUtilization"
59+
alarm_name = "alarmCacheClusterCPUUtilization-${var.cache_name}"
6060
alarm_description = "Cache cluster CPU utilization"
6161
comparison_operator = "GreaterThanThreshold"
6262
evaluation_periods = "1"
@@ -74,7 +74,7 @@ resource "aws_cloudwatch_metric_alarm" "cpu" {
7474
}
7575

7676
resource "aws_cloudwatch_metric_alarm" "memory_free" {
77-
alarm_name = "alarmCacheClusterFreeableMemory"
77+
alarm_name = "alarmCacheClusterFreeableMemory-${var.cache_name}"
7878
alarm_description = "Cache cluster freeable memory"
7979
comparison_operator = "LessThanThreshold"
8080
evaluation_periods = "1"

0 commit comments

Comments
 (0)