Skip to content

Commit 6ede5aa

Browse files
committed
update terraform
1 parent 18d551d commit 6ede5aa

File tree

1 file changed

+15
-30
lines changed

1 file changed

+15
-30
lines changed

terraform/modules/alarms/main.tf

Lines changed: 15 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,9 @@ resource "aws_cloudwatch_metric_alarm" "app_dlq_messages_alarm" {
1111
evaluation_periods = 1
1212
comparison_operator = "GreaterThanThreshold"
1313
threshold = 0
14-
dimensions = [
15-
{
16-
Name = "QueueName"
17-
Value = "${var.resource_prefix}-sqs-dlq"
18-
}
19-
]
14+
dimensions = {
15+
QueueName = "${var.resource_prefix}-sqs-dlq"
16+
}
2017
alarm_actions = [
2118
var.priority_sns_arn
2219
]
@@ -35,12 +32,9 @@ resource "aws_cloudwatch_metric_alarm" "app_latency_alarm" {
3532
alarm_actions = [
3633
var.standard_sns_arn
3734
]
38-
dimensions = [
39-
{
40-
Name = "FunctionName"
41-
Value = "${var.resource_prefix}-lambda"
42-
}
43-
]
35+
dimensions = {
36+
FunctionName = "${var.resource_prefix}-lambda"
37+
}
4438
}
4539

4640
resource "aws_cloudwatch_metric_alarm" "app_no_requests_alarm" {
@@ -56,12 +50,9 @@ resource "aws_cloudwatch_metric_alarm" "app_no_requests_alarm" {
5650
alarm_actions = [
5751
var.priority_sns_arn
5852
]
59-
dimensions = [
60-
{
61-
Name = "FunctionName"
62-
Value = "${var.resource_prefix}-lambda"
63-
}
64-
]
53+
dimensions = {
54+
FunctionName = "${var.resource_prefix}-lambda"
55+
}
6556
}
6657

6758
resource "aws_cloudwatch_metric_alarm" "app_invocation_error_alarm" {
@@ -77,12 +68,9 @@ resource "aws_cloudwatch_metric_alarm" "app_invocation_error_alarm" {
7768
alarm_actions = [
7869
var.priority_sns_arn
7970
]
80-
dimensions = [
81-
{
82-
Name = "FunctionName"
83-
Value = "${var.resource_prefix}-lambda"
84-
}
85-
]
71+
dimensions = {
72+
FunctionName = "${var.resource_prefix}-lambda"
73+
}
8674
}
8775

8876
resource "aws_cloudwatch_metric_alarm" "app5xx_error_alarm" {
@@ -98,10 +86,7 @@ resource "aws_cloudwatch_metric_alarm" "app5xx_error_alarm" {
9886
alarm_actions = [
9987
var.priority_sns_arn
10088
]
101-
dimensions = [
102-
{
103-
Name = "DistributionId"
104-
Value = var.main_cloudfront_distribution_id
105-
}
106-
]
89+
dimensions = {
90+
DistributionId = var.main_cloudfront_distribution_id
91+
}
10792
}

0 commit comments

Comments
 (0)