MON-224 Fix count value to allow not creating the monitors

This commit is contained in:
Rafael Romero Carmona 2018-07-30 13:02:23 +02:00 committed by Quentin Manfroi
parent 3535f294a5
commit e09b68134d
2 changed files with 10 additions and 10 deletions

View File

@ -15,7 +15,7 @@ data "template_file" "filter" {
# CPU Utilization
#
resource "datadog_monitor" "cpu_utilization" {
count = "${var.cpu_utilization_enabled} == true ? 1 : 0 "
count = "${var.cpu_utilization_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL CPU utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.cpu_utilization_message, var.message)}"
@ -62,7 +62,7 @@ EOF
# Disk Utilization
#
resource "datadog_monitor" "disk_utilization" {
count = "${var.disk_utilization_enabled} == true ? 1 : 0 "
count = "${var.disk_utilization_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL Disk utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.disk_utilization_message, var.message)}"
@ -109,7 +109,7 @@ EOF
# Disk Utilization Forecast
#
resource "datadog_monitor" "disk_utilization_forecast" {
count = "${var.disk_utilization_forecast_enabled} == true ? 1 : 0 "
count = "${var.disk_utilization_forecast_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL Disk utilization could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future"
message = "${coalesce(var.disk_utilization_forecast_message, var.message)}"
@ -161,7 +161,7 @@ EOF
# Memory Utilization
#
resource "datadog_monitor" "memory_utilization" {
count = "${var.memory_utilization_enabled} == true ? 1 : 0 "
count = "${var.memory_utilization_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL Memory Utilization {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.memory_utilization_message, var.message)}"
@ -208,7 +208,7 @@ EOF
# Memory Utilization Forecast
#
resource "datadog_monitor" "memory_utilization_forecast" {
count = "${var.memory_utilization_forecast_enabled} == true ? 1 : 0 "
count = "${var.memory_utilization_forecast_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL Memory Utilization could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future"
message = "${coalesce(var.memory_utilization_forecast_message, var.message)}"
@ -260,7 +260,7 @@ EOF
# Failover Unavailable
#
resource "datadog_monitor" "failover_unavailable" {
count = "${var.failover_unavailable_enabled} == true ? 1 : 0 "
count = "${var.failover_unavailable_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL Failover Unavailable"
message = "${coalesce(var.failover_unavailable_message, var.message)}"

View File

@ -15,7 +15,7 @@ data "template_file" "filter" {
# MySQL Network Connections
#
resource "datadog_monitor" "network_connections" {
count = "${var.network_connections_enabled} == true ? 1 : 0 "
count = "${var.network_connections_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL MySQL Network Connections (hard limit: ${var.network_connections_hard_limit}) {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}"
message = "${coalesce(var.network_connections_message, var.message)}"
@ -62,7 +62,7 @@ EOF
# Replication Lag
#
resource "datadog_monitor" "replication_lag" {
count = "${var.replication_lag_enabled} == true ? 1 : 0 "
count = "${var.replication_lag_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL MySQL Replication Lag {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}"
message = "${coalesce(var.replication_lag_message, var.message)}"
@ -110,7 +110,7 @@ EOF
# Queries Anomaly
#
resource "datadog_monitor" "queries_changing_anomaly" {
count = "${var.queries_changing_anomaly_enabled} == true ? 1 : 0 "
count = "${var.queries_changing_anomaly_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL MySQL Queries Count changed abnormally"
message = "${coalesce(var.queries_changing_anomaly_message, var.message)}"
@ -166,7 +166,7 @@ EOF
# Questions Anomaly
#
resource "datadog_monitor" "questions_changing_anomaly" {
count = "${var.questions_changing_anomaly_enabled} == true ? 1 : 0 "
count = "${var.questions_changing_anomaly_enabled == "true" ? 1 : 0 }"
name = "[${var.environment}] Cloud SQL MySQL Questions Count changed abnormally"
message = "${coalesce(var.questions_changing_anomaly_message, var.message)}"