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,6 +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
2627 name = var. prometheus_workspace_name
2728 tags = var. tags
2829
Original file line number Diff line number Diff line change 11resource "aws_prometheus_workspace" "this" {
22 alias = var. name
33 tags = var. tags
4+
5+ dynamic logging_configuration {
6+ for_each = var. logging_group_name
7+ content {
8+ log_group_arn = data. aws_cloudwatch_log_group . this . arn
9+ }
10+ }
11+ }
12+
13+ data "aws_cloudwatch_log_group" "this" {
14+ count = var. logging_group_name ? 1 : 0
15+ name = var. logging_group_name
416}
517
618resource "aws_iam_role" "ingestion" {
Original file line number Diff line number Diff line change @@ -28,6 +28,11 @@ 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
34+ }
35+
3136variable "name" {
3237 description = " Name for this Prometheus workspace"
3338 type = string
Original file line number Diff line number Diff line change @@ -46,6 +46,11 @@ 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
52+ }
53+
4954variable "grafana_role_name" {
5055 description = " Name of the IAM role created for Grafana"
5156 type = string
You can’t perform that action at this time.
0 commit comments