Skip to content

Commit d11361b

Browse files
committed
Modified alarm to use firehose metric
1 parent a2ec94b commit d11361b

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

infrastructure/modules/splunk_forwarder/outputs.tf

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,9 @@ output "firehose_kms_key_arn" {
99
description = "ARN of the KMS key used for Firehose encryption"
1010
value = aws_kms_key.firehose_splunk_cmk.arn
1111
}
12+
13+
#
14+
output "firehose_delivery_stream_name" {
15+
description = "Name of the Kinesis Firehose delivery stream for Splunk"
16+
value = aws_kinesis_firehose_delivery_stream.splunk_delivery_stream.name
17+
}

infrastructure/stacks/api-layer/cloudwatch_alarms.tf

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -495,9 +495,9 @@ resource "aws_cloudwatch_metric_alarm" "acm_expiry_alarms" {
495495
# Splunk backup S3 bucket delivery failure alarm
496496
resource "aws_cloudwatch_metric_alarm" "splunk_backup_delivery_failure" {
497497
alarm_name = "SplunkBackupS3DeliveryFailure"
498-
alarm_description = "Triggers when there is a delivery failure to the eli-splunk S3 bucket"
499-
namespace = "AWS/S3"
500-
metric_name = "DeliveryFailed"
498+
alarm_description = "Triggers when there is a delivery failure from Firehose to the Splunk backup S3 bucket"
499+
namespace = "AWS/Firehose"
500+
metric_name = "DeliveryToS3.Failed"
501501
statistic = "Sum"
502502
period = 300 # 5 minutes
503503
evaluation_periods = 1
@@ -506,16 +506,15 @@ resource "aws_cloudwatch_metric_alarm" "splunk_backup_delivery_failure" {
506506
treat_missing_data = "notBreaching"
507507

508508
dimensions = {
509-
BucketName = "eli-splunk"
510-
StorageType = "AllStorageTypes"
509+
DeliveryStreamName = module.splunk_forwarder.firehose_delivery_stream_name
511510
}
512511

513512
alarm_actions = [aws_sns_topic.cloudwatch_alarms.arn]
514513

515514
tags = {
516515
Environment = var.environment
517516
AlertType = "data-delivery"
518-
Service = "s3"
517+
Service = "firehose"
519518
Severity = "high"
520519
ManagedBy = "terraform"
521520
}

0 commit comments

Comments
 (0)