Skip to content

Commit b29958d

Browse files
author
lucaronca
committed
Change cpu alarm name
1 parent 56e7f5f commit b29958d

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

main.tf

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,10 @@ resource "aws_volume_attachment" "ebs_att" {
123123
}
124124

125125
resource "aws_cloudwatch_metric_alarm" "ec2-cpu" {
126-
alarm_name = "cpu-utilization"
126+
alarm_name = format(
127+
"%s-%s-cpu-utilization",
128+
lookup(var.instance_tags, "name"), lookup(var.instance_tags, "environment")
129+
)
127130
comparison_operator = "GreaterThanOrEqualToThreshold"
128131
evaluation_periods = "2"
129132
metric_name = "CPUUtilization"

0 commit comments

Comments
 (0)