Skip to content

Commit cd6d3e6

Browse files
CCM-14044 Fixing eventpub anom alarms config var names
1 parent 86c55f6 commit cd6d3e6

4 files changed

Lines changed: 14 additions & 14 deletions

File tree

infrastructure/terraform/modules/eventpub/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,16 +18,16 @@
1818
| <a name="input_control_plane_bus_arn"></a> [control\_plane\_bus\_arn](#input\_control\_plane\_bus\_arn) | Data plane event bus arn | `string` | n/a | yes |
1919
| <a name="input_data_plane_bus_arn"></a> [data\_plane\_bus\_arn](#input\_data\_plane\_bus\_arn) | Data plane event bus arn | `string` | n/a | yes |
2020
| <a name="input_default_tags"></a> [default\_tags](#input\_default\_tags) | Default tag map for application to all taggable resources in the module | `map(string)` | `{}` | no |
21+
| <a name="input_enable_event_anomaly_detection"></a> [enable\_event\_anomaly\_detection](#input\_enable\_event\_anomaly\_detection) | Enable CloudWatch anomaly detection alarm for SNS message publishing. Detects abnormal drops or spikes in event publishing volume. | `bool` | `true` | no |
2122
| <a name="input_enable_event_cache"></a> [enable\_event\_cache](#input\_enable\_event\_cache) | Enable caching of events to an S3 bucket | `bool` | `false` | no |
22-
| <a name="input_enable_event_publishing_anomaly_detection"></a> [enable\_event\_publishing\_anomaly\_detection](#input\_enable\_event\_publishing\_anomaly\_detection) | Enable CloudWatch anomaly detection alarm for SNS message publishing. Detects abnormal drops or spikes in event publishing volume. | `bool` | `true` | no |
2323
| <a name="input_enable_firehose_raw_message_delivery"></a> [enable\_firehose\_raw\_message\_delivery](#input\_enable\_firehose\_raw\_message\_delivery) | Enables raw message delivery on firehose subscription | `bool` | `false` | no |
2424
| <a name="input_enable_sns_delivery_logging"></a> [enable\_sns\_delivery\_logging](#input\_enable\_sns\_delivery\_logging) | Enable SNS Delivery Failure Notifications | `bool` | `false` | no |
2525
| <a name="input_environment"></a> [environment](#input\_environment) | The name of the terraformscaffold environment the module is called for | `string` | n/a | yes |
26+
| <a name="input_event_anomaly_band_width"></a> [event\_anomaly\_band\_width](#input\_event\_anomaly\_band\_width) | The width of the anomaly detection band. Higher values (e.g. 4-6) reduce sensitivity and noise, lower values (e.g. 2-3) increase sensitivity. Recommended: 2-4. | `number` | `5` | no |
27+
| <a name="input_event_anomaly_evaluation_periods"></a> [event\_anomaly\_evaluation\_periods](#input\_event\_anomaly\_evaluation\_periods) | Number of evaluation periods for the anomaly alarm. Each period is defined by event\_anomaly\_period. | `number` | `3` | no |
28+
| <a name="input_event_anomaly_period"></a> [event\_anomaly\_period](#input\_event\_anomaly\_period) | The period in seconds over which the specified statistic is applied for anomaly detection. Minimum 300 seconds (5 minutes). Recommended: 300-600. | `number` | `300` | no |
2629
| <a name="input_event_cache_buffer_interval"></a> [event\_cache\_buffer\_interval](#input\_event\_cache\_buffer\_interval) | The buffer interval for data firehose | `number` | `500` | no |
2730
| <a name="input_event_cache_expiry_days"></a> [event\_cache\_expiry\_days](#input\_event\_cache\_expiry\_days) | s3 archiving expiry in days | `number` | `30` | no |
28-
| <a name="input_event_publishing_anomaly_band_width"></a> [event\_publishing\_anomaly\_band\_width](#input\_event\_publishing\_anomaly\_band\_width) | The width of the anomaly detection band. Higher values (e.g. 4-6) reduce sensitivity and noise, lower values (e.g. 2-3) increase sensitivity. Recommended: 2-4. | `number` | `5` | no |
29-
| <a name="input_event_publishing_anomaly_evaluation_periods"></a> [event\_publishing\_anomaly\_evaluation\_periods](#input\_event\_publishing\_anomaly\_evaluation\_periods) | Number of evaluation periods for the publishing anomaly alarm. Each period is defined by event\_publishing\_anomaly\_period. | `number` | `3` | no |
30-
| <a name="input_event_publishing_anomaly_period"></a> [event\_publishing\_anomaly\_period](#input\_event\_publishing\_anomaly\_period) | The period in seconds over which the specified statistic is applied for anomaly detection. Minimum 300 seconds (5 minutes). Recommended: 300-600. | `number` | `300` | no |
3131
| <a name="input_force_destroy"></a> [force\_destroy](#input\_force\_destroy) | When enabled will force destroy event-cache S3 bucket | `bool` | `false` | no |
3232
| <a name="input_group"></a> [group](#input\_group) | The name of the tfscaffold group | `string` | `null` | no |
3333
| <a name="input_iam_permissions_boundary_arn"></a> [iam\_permissions\_boundary\_arn](#input\_iam\_permissions\_boundary\_arn) | The ARN of the permissions boundary to use for the IAM role | `string` | `null` | no |

infrastructure/terraform/modules/eventpub/cloudwatch_metric_alarm_publishing_anomaly.tf

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
resource "aws_cloudwatch_metric_alarm" "publishing_anomaly" {
2-
count = var.enable_event_publishing_anomaly_detection ? 1 : 0
2+
count = var.enable_event_anomaly_detection ? 1 : 0
33

44
alarm_name = "${local.csi}-sns-publishing-anomaly"
55
alarm_description = "RELIABILITY: Anomaly detection alarm for abnormal SNS message publishing patterns. Detects unexpected drops or spikes in event publishing volume that may indicate service degradation or misconfiguration."
66
comparison_operator = "LessThanLowerOrGreaterThanUpperThreshold"
7-
evaluation_periods = var.event_publishing_anomaly_evaluation_periods # Number of evaluation periods for the publishing anomaly alarm.
7+
evaluation_periods = var.event_anomaly_evaluation_periods # Number of evaluation periods for the publishing anomaly alarm.
88
threshold_metric_id = "ad1"
99
treat_missing_data = "notBreaching"
1010
actions_enabled = true
@@ -24,7 +24,7 @@ resource "aws_cloudwatch_metric_alarm" "publishing_anomaly" {
2424
metric {
2525
metric_name = "NumberOfMessagesPublished"
2626
namespace = "AWS/SNS"
27-
period = var.event_publishing_anomaly_period # The period in seconds over which the specified statistic is applied for anomaly detection.
27+
period = var.event_anomaly_period # The period in seconds over which the specified statistic is applied for anomaly detection.
2828
stat = "Sum"
2929

3030
dimensions = {
@@ -35,7 +35,7 @@ resource "aws_cloudwatch_metric_alarm" "publishing_anomaly" {
3535

3636
metric_query {
3737
id = "ad1"
38-
expression = "ANOMALY_DETECTION_BAND(m1, ${var.event_publishing_anomaly_band_width})" # The width of the anomaly detection band. Higher values (e.g. 4-6) reduce sensitivity and noise, lower values (e.g. 2-3) increase sensitivity.
38+
expression = "ANOMALY_DETECTION_BAND(m1, ${var.event_anomaly_band_width})" # The width of the anomaly detection band. Higher values (e.g. 4-6) reduce sensitivity and noise, lower values (e.g. 2-3) increase sensitivity.
3939
label = "NumberOfMessagesPublished (expected)"
4040
return_data = true
4141
}

infrastructure/terraform/modules/eventpub/outputs.tf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ output "s3_bucket_event_cache" {
1616

1717
output "publishing_anomaly_alarm" {
1818
description = "CloudWatch anomaly detection alarm details for SNS publishing"
19-
value = var.enable_event_publishing_anomaly_detection ? {
19+
value = var.enable_event_anomaly_detection ? {
2020
arn = aws_cloudwatch_metric_alarm.publishing_anomaly[0].arn
2121
name = aws_cloudwatch_metric_alarm.publishing_anomaly[0].alarm_name
2222
} : null

infrastructure/terraform/modules/eventpub/variables.tf

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -130,25 +130,25 @@ variable "additional_policies_for_event_cache_bucket" {
130130
default = []
131131
}
132132

133-
variable "enable_event_publishing_anomaly_detection" {
133+
variable "enable_event_anomaly_detection" {
134134
type = bool
135135
description = "Enable CloudWatch anomaly detection alarm for SNS message publishing. Detects abnormal drops or spikes in event publishing volume."
136136
default = true
137137
}
138138

139-
variable "event_publishing_anomaly_evaluation_periods" {
139+
variable "event_anomaly_evaluation_periods" {
140140
type = number
141-
description = "Number of evaluation periods for the publishing anomaly alarm. Each period is defined by event_publishing_anomaly_period."
141+
description = "Number of evaluation periods for the anomaly alarm. Each period is defined by event_anomaly_period."
142142
default = 3
143143
}
144144

145-
variable "event_publishing_anomaly_period" {
145+
variable "event_anomaly_period" {
146146
type = number
147147
description = "The period in seconds over which the specified statistic is applied for anomaly detection. Minimum 300 seconds (5 minutes). Recommended: 300-600."
148148
default = 300
149149
}
150150

151-
variable "event_publishing_anomaly_band_width" {
151+
variable "event_anomaly_band_width" {
152152
type = number
153153
description = "The width of the anomaly detection band. Higher values (e.g. 4-6) reduce sensitivity and noise, lower values (e.g. 2-3) increase sensitivity. Recommended: 2-4."
154154
default = 5

0 commit comments

Comments
 (0)