Skip to content

Commit d3df062

Browse files
committed
NRL-693 remove vars and make them defaults
1 parent 4f81e50 commit d3df062

File tree

5 files changed

+15
-68
lines changed

5 files changed

+15
-68
lines changed

terraform/account-wide-infrastructure/dev/cloudwatch.tf

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ module "lambda_errors_cloudwatch_metric_alarm_dev" {
22
source = "../modules/lambda-errors-metric-alarm"
33
name_prefix = "nhsd-nrlf--dev"
44

5-
comparison_operator = "GreaterThanOrEqualToThreshold"
6-
evaluation_periods = 1
7-
metric_name = "Errors"
8-
namespace = "AWS/Lambda"
9-
period = 60
10-
statistic = "Maximum"
11-
threshold = 1
12-
unit = "Count"
13-
alarm_description = "This metric monitors the number of Lambda errors that have occurred"
5+
evaluation_periods = 1
6+
period = 60
7+
threshold = 1
148
}
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
11
resource "aws_cloudwatch_metric_alarm" "metric_alarm" {
22
alarm_name = "${var.name_prefix}--lambda-errors-metric-alarm"
3-
alarm_description = var.alarm_description
3+
alarm_description = "This metric monitors the number of Lambda errors that have occurred"
44

55
alarm_actions = [aws_sns_topic.sns_topic.arn]
66

7-
comparison_operator = var.comparison_operator
7+
comparison_operator = "GreaterThanOrEqualToThreshold"
88
evaluation_periods = var.evaluation_periods
99
threshold = var.threshold
10-
unit = var.unit
10+
unit = "Count"
1111

12-
metric_name = var.metric_name
13-
namespace = var.namespace
12+
metric_name = "Errors"
13+
namespace = "AWS/Lambda"
1414
period = var.period
15-
statistic = var.statistic
15+
statistic = "Sum"
1616

1717
}

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

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,3 @@
1-
variable "alarm_description" {
2-
description = "The description for the alarm."
3-
type = string
4-
default = null
5-
}
6-
7-
variable "comparison_operator" {
8-
description = "The arithmetic operation to use when comparing the specified Statistic and Threshold. The specified Statistic value is used as the first operand. Either of the following is supported: GreaterThanOrEqualToThreshold, GreaterThanThreshold, LessThanThreshold, LessThanOrEqualToThreshold."
9-
type = string
10-
}
11-
121
variable "evaluation_periods" {
132
description = "The number of periods over which data is compared to the specified threshold."
143
type = number
@@ -20,36 +9,12 @@ variable "threshold" {
209
default = null
2110
}
2211

23-
variable "unit" {
24-
description = "The unit for the alarm's associated metric."
25-
type = string
26-
default = null
27-
}
28-
29-
variable "metric_name" {
30-
description = "The name for the alarm's associated metric. See docs for supported metrics."
31-
type = string
32-
default = null
33-
}
34-
35-
variable "namespace" {
36-
description = "The namespace for the alarm's associated metric. See docs for the list of namespaces. See docs for supported metrics."
37-
type = string
38-
default = null
39-
}
40-
4112
variable "period" {
4213
description = "The period in seconds over which the specified statistic is applied."
4314
type = string
4415
default = null
4516
}
4617

47-
variable "statistic" {
48-
description = "The statistic to apply to the alarm's associated metric. Either of the following is supported: SampleCount, Average, Sum, Minimum, Maximum"
49-
type = string
50-
default = null
51-
}
52-
5318
variable "name_prefix" {
5419
type = string
5520
description = "The prefix to apply to all resources in the module."

terraform/account-wide-infrastructure/prod/cloudwatch.tf

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ module "lambda_errors_cloudwatch_metric_alarm_dev" {
22
source = "../modules/lambda-errors-metric-alarm"
33
name_prefix = "nhsd-nrlf--prod"
44

5-
comparison_operator = "GreaterThanOrEqualToThreshold"
6-
evaluation_periods = 1
7-
metric_name = "Errors"
8-
namespace = "AWS/Lambda"
9-
period = 60
10-
statistic = "Maximum"
11-
threshold = 1
12-
unit = "Count"
13-
alarm_description = "This metric monitors the number of Lambda errors that have occurred"
5+
evaluation_periods = 1
6+
period = 60
7+
threshold = 1
148
}

terraform/account-wide-infrastructure/test/cloudwatch.tf

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,7 @@ module "lambda_errors_cloudwatch_metric_alarm_dev" {
22
source = "../modules/lambda-errors-metric-alarm"
33
name_prefix = "nhsd-nrlf--test"
44

5-
comparison_operator = "GreaterThanOrEqualToThreshold"
6-
evaluation_periods = 1
7-
metric_name = "Errors"
8-
namespace = "AWS/Lambda"
9-
period = 60
10-
statistic = "Maximum"
11-
threshold = 1
12-
unit = "Count"
13-
alarm_description = "This metric monitors the number of Lambda errors that have occurred"
5+
evaluation_periods = 1
6+
period = 60
7+
threshold = 1
148
}

0 commit comments

Comments
 (0)