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 @@ -18,12 +18,13 @@ module "sns_topics" {
1818module "prometheus_workspace" {
1919 source = " ./modules/prometheus-workspace"
2020
21- alert_group_by = var. alert_group_by
22- alert_message_template = var. alert_message_template
23- alert_resolve_timeout = var. alert_resolve_timeout
24- alert_subject_template = var. alert_subject_template
25- name = var. prometheus_workspace_name
26- tags = var. tags
21+ alert_group_by = var. alert_group_by
22+ alert_message_template = var. alert_message_template
23+ alert_resolve_timeout = var. alert_resolve_timeout
24+ alert_subject_template = var. alert_subject_template
25+ alertmanager_config_enabled = var. alertmanager_config_enabled
26+ name = var. prometheus_workspace_name
27+ tags = var. tags
2728
2829 sns_receivers = merge ({
2930 default = module.sns_topics.arns[" alertmanager-${ var . alert_default_severity } ${ var . sns_topic_name_suffix } " ]
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ data "aws_iam_policy_document" "ingestion_assume_role" {
5151}
5252
5353resource "aws_prometheus_alert_manager_definition" "this" {
54+ count = var. alertmanager_config_enabled ? 1 : 0
5455 definition = yamlencode (local. alert_manager_definition )
5556 workspace_id = aws_prometheus_workspace. this . id
5657}
Original file line number Diff line number Diff line change @@ -22,6 +22,12 @@ variable "alert_subject_template" {
2222 default = null
2323}
2424
25+ variable "alertmanager_config_enabled" {
26+ description = " Enable alertmanager configs for the Prometheus workspace"
27+ type = bool
28+ default = true
29+ }
30+
2531variable "name" {
2632 description = " Name for this Prometheus workspace"
2733 type = string
Original file line number Diff line number Diff line change @@ -40,6 +40,12 @@ variable "alert_default_severity" {
4040 default = " warning"
4141}
4242
43+ variable "alertmanager_config_enabled" {
44+ description = " Enable alertmanager configs for the Prometheus workspace"
45+ type = bool
46+ default = true
47+ }
48+
4349variable "grafana_role_name" {
4450 description = " Name of the IAM role created for Grafana"
4551 type = string
You can’t perform that action at this time.
0 commit comments