Skip to content

Commit

Permalink
configuration for additional stats
Browse files Browse the repository at this point in the history
  • Loading branch information
ryantanjunming committed Jul 24, 2023
1 parent 6310a55 commit 95eb1eb
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 2 deletions.
16 changes: 14 additions & 2 deletions modules/firehose/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -594,8 +594,20 @@ resource "aws_cloudwatch_metric_stream" "cloudwatch_metric_stream" {
dynamic "include_filter" {
for_each = var.include_metric_stream_filter
content {
namespace = include_filter.value["namespace"]
metric_names = include_filter.value["metric_names"]
namespace = include_filter.value.namespace
metric_names = include_filter.value.metric_names
}
}

dynamic "statistics_configuration" {
for_each = var.metric_statistics_configurations
content {
additional_statistics = statistics_configuration.value.additional_statistics

include_metric {
metric_name = statistics_configuration.value.metric_name
namespace = statistics_configuration.value.namespace
}
}
}
}
10 changes: 10 additions & 0 deletions modules/firehose/variables.tf
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,16 @@ variable "include_metric_stream_filter" {
default = []
}

variable "metric_statistics_configurations" {
description = "For each entry, specify one or more metrics (metric_name and namespace) and the list of additional statistics to stream for those metrics. Each configuration of metric name and namespace can have a list of additional_statistics included into the AWS CloudWatch Metric Stream."
type = list(object({
additional_statistics = list(string)
metric_name = string
namespace = string
}))
default = []
}

variable "enable_cloudwatch_metricstream" {
description = "Should be true if you want to create a new Cloud Watch metric stream and attach it to Firehose"
type = bool
Expand Down

0 comments on commit 95eb1eb

Please sign in to comment.