Skip to content

Commit 0a0f7bc

Browse files
committed
NRL-693 remove useless vars
1 parent 536ba64 commit 0a0f7bc

File tree

2 files changed

+5
-115
lines changed

2 files changed

+5
-115
lines changed
Lines changed: 5 additions & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -1,55 +1,17 @@
11
resource "aws_cloudwatch_metric_alarm" "metric_alarm" {
22
alarm_name = "${var.name_prefix}--lambda-errors-metric_alarm"
33
alarm_description = var.alarm_description
4-
actions_enabled = var.actions_enabled
54

6-
alarm_actions = [aws_sns_topic.sns_topic.arn]
7-
ok_actions = var.ok_actions
8-
insufficient_data_actions = var.insufficient_data_actions
5+
alarm_actions = [aws_sns_topic.sns_topic.arn]
96

107
comparison_operator = var.comparison_operator
118
evaluation_periods = var.evaluation_periods
129
threshold = var.threshold
1310
unit = var.unit
1411

15-
datapoints_to_alarm = var.datapoints_to_alarm
16-
treat_missing_data = var.treat_missing_data
17-
evaluate_low_sample_count_percentiles = var.evaluate_low_sample_count_percentiles
12+
metric_name = var.metric_name
13+
namespace = var.namespace
14+
period = var.period
15+
statistic = var.statistic
1816

19-
# conflicts with metric_query
20-
metric_name = var.metric_name
21-
namespace = var.namespace
22-
period = var.period
23-
statistic = var.statistic
24-
extended_statistic = var.extended_statistic
25-
26-
dimensions = var.dimensions
27-
28-
# conflicts with metric_name
29-
dynamic "metric_query" {
30-
for_each = var.metric_query
31-
content {
32-
id = lookup(metric_query.value, "id")
33-
account_id = lookup(metric_query.value, "account_id", null)
34-
label = lookup(metric_query.value, "label", null)
35-
return_data = lookup(metric_query.value, "return_data", null)
36-
expression = lookup(metric_query.value, "expression", null)
37-
period = lookup(metric_query.value, "period", null)
38-
39-
dynamic "metric" {
40-
for_each = lookup(metric_query.value, "metric", [])
41-
content {
42-
metric_name = lookup(metric.value, "metric_name")
43-
namespace = lookup(metric.value, "namespace")
44-
period = lookup(metric.value, "period")
45-
stat = lookup(metric.value, "stat")
46-
unit = lookup(metric.value, "unit", null)
47-
dimensions = lookup(metric.value, "dimensions", null)
48-
}
49-
}
50-
}
51-
}
52-
threshold_metric_id = var.threshold_metric_id
53-
54-
tags = var.tags
5517
}

terraform/account-wide-infrastructure/modules/lambda-errors-metric-alarm/vars.tf

Lines changed: 0 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,6 @@ variable "threshold" {
2020
default = null
2121
}
2222

23-
variable "threshold_metric_id" {
24-
description = "If this is an alarm based on an anomaly detection model, make this value match the ID of the ANOMALY_DETECTION_BAND function."
25-
type = string
26-
default = null
27-
}
28-
2923
variable "unit" {
3024
description = "The unit for the alarm's associated metric."
3125
type = string
@@ -56,72 +50,6 @@ variable "statistic" {
5650
default = null
5751
}
5852

59-
variable "actions_enabled" {
60-
description = "Indicates whether or not actions should be executed during any changes to the alarm's state. Defaults to true."
61-
type = bool
62-
default = true
63-
}
64-
65-
variable "datapoints_to_alarm" {
66-
description = "The number of datapoints that must be breaching to trigger the alarm."
67-
type = number
68-
default = null
69-
}
70-
71-
variable "dimensions" {
72-
description = "The dimensions for the alarm's associated metric."
73-
type = any
74-
default = null
75-
}
76-
77-
variable "alarm_actions" {
78-
description = "The list of actions to execute when this alarm transitions into an ALARM state from any other state. Each action is specified as an Amazon Resource Name (ARN)."
79-
type = list(string)
80-
default = null
81-
}
82-
83-
variable "insufficient_data_actions" {
84-
description = "The list of actions to execute when this alarm transitions into an INSUFFICIENT_DATA state from any other state. Each action is specified as an Amazon Resource Name (ARN)."
85-
type = list(string)
86-
default = null
87-
}
88-
89-
variable "ok_actions" {
90-
description = "The list of actions to execute when this alarm transitions into an OK state from any other state. Each action is specified as an Amazon Resource Name (ARN)."
91-
type = list(string)
92-
default = null
93-
}
94-
95-
variable "extended_statistic" {
96-
description = "The percentile statistic for the metric associated with the alarm. Specify a value between p0.0 and p100."
97-
type = string
98-
default = null
99-
}
100-
101-
variable "treat_missing_data" {
102-
description = "Sets how this alarm is to handle missing data points. The following values are supported: missing, ignore, breaching and notBreaching."
103-
type = string
104-
default = "missing"
105-
}
106-
107-
variable "evaluate_low_sample_count_percentiles" {
108-
description = "Used only for alarms based on percentiles. If you specify ignore, the alarm state will not change during periods with too few data points to be statistically significant. If you specify evaluate or omit this parameter, the alarm will always be evaluated and possibly change state no matter how many data points are available. The following values are supported: ignore, and evaluate."
109-
type = string
110-
default = null
111-
}
112-
113-
variable "metric_query" {
114-
description = "Enables you to create an alarm based on a metric math expression. You may specify at most 20."
115-
type = any
116-
default = []
117-
}
118-
119-
variable "tags" {
120-
description = "A mapping of tags to assign to all resources"
121-
type = map(string)
122-
default = {}
123-
}
124-
12553
variable "name_prefix" {
12654
type = string
12755
description = "The prefix to apply to all resources in the module."

0 commit comments

Comments
 (0)