File tree Expand file tree Collapse file tree
modules/prometheus-workspace Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -23,7 +23,7 @@ module "prometheus_workspace" {
2323 alert_resolve_timeout = var. alert_resolve_timeout
2424 alert_subject_template = var. alert_subject_template
2525 alertmanager_config_enabled = var. alertmanager_config_enabled
26- logging_group_name = var. logging_group_name
26+ logging_configuration = var. logging_configuration
2727 name = var. prometheus_workspace_name
2828 tags = var. tags
2929
Original file line number Diff line number Diff line change @@ -3,16 +3,16 @@ resource "aws_prometheus_workspace" "this" {
33 tags = var. tags
44
55 dynamic logging_configuration {
6- for_each = var. logging_group_name
6+ for_each = var. logging_configuration
77 content {
8- log_group_arn = data. aws_cloudwatch_log_group . this . arn
8+ log_group_arn = data. aws_cloudwatch_log_group . this . arn
99 }
1010 }
1111}
1212
1313data "aws_cloudwatch_log_group" "this" {
14- count = var. logging_group_name ? 1 : 0
15- name = var . logging_group_name
14+ for_each = var. logging_configuration
15+ name = each . value . name
1616}
1717
1818resource "aws_iam_role" "ingestion" {
Original file line number Diff line number Diff line change @@ -28,9 +28,9 @@ variable "alertmanager_config_enabled" {
2828 default = true
2929}
3030
31- variable "logging_group_name " {
32- description = " Name of Cloudwatch logging group for Prometheus workspace"
33- type = string
31+ variable "logging_configuration " {
32+ description = " Cloudwatch logging configuration for Prometheus workspace"
33+ type = map ( string )
3434 default = null
3535}
3636
Original file line number Diff line number Diff line change @@ -46,9 +46,9 @@ variable "alertmanager_config_enabled" {
4646 default = true
4747}
4848
49- variable "logging_group_name " {
50- description = " Name of Cloudwatch logging group for Prometheus workspace"
51- type = string
49+ variable "logging_configuration " {
50+ description = " Cloudwatch logging configuration for Prometheus workspace"
51+ type = map ( string )
5252 default = null
5353}
5454
You can’t perform that action at this time.
0 commit comments