From 57190b9c34767ab1301e5dfcbcc2252efc285ca8 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Tue, 23 Apr 2019 13:50:02 +0200 Subject: [PATCH] MON-360 fix enabled feature --- caas/kubernetes/ark/monitors-ark.tf | 2 +- .../ingress/vts/monitors-ingress.tf | 4 +- cloud/aws/alb/monitors-alb.tf | 12 ++--- cloud/aws/apigateway/monitors-api.tf | 6 +-- .../common/monitors-elasticache.tf | 12 ++--- .../memcached/monitors-memcached.tf | 4 +- cloud/aws/elasticache/redis/monitors-redis.tf | 8 ++-- .../elasticsearch/monitors-elasticsearch.tf | 6 +-- cloud/aws/elb/monitors-elb.tf | 12 ++--- .../monitors-kinesis-firehose.tf | 2 +- .../aurora/mysql/monitors-rds-aurora-mysql.tf | 2 +- .../monitors-rds-aurora-postgresql.tf | 2 +- cloud/aws/rds/common/monitors-rds-common.tf | 6 +-- cloud/aws/vpn/monitors-vpn.tf | 2 +- .../monitors-azure-apimanagement.tf | 10 ++--- .../app-services/monitors-app_services.tf | 10 ++--- .../azure-search/monitors-azure-search.tf | 4 +- cloud/azure/cosmosdb/monitors-cosmosdb.tf | 8 ++-- .../datalakestore/monitors-datalakestore.tf | 2 +- cloud/azure/eventgrid/monitors-eventgrid.tf | 6 +-- cloud/azure/eventhub/monitors-eventhub.tf | 6 +-- cloud/azure/functions/monitors-functions.tf | 6 +-- cloud/azure/iothubs/monitors-iothubs.tf | 28 ++++++------ cloud/azure/keyvault/monitors-keyvault.tf | 6 +-- .../load-balancer/monitors-load-balancer.tf | 2 +- cloud/azure/mysql/monitors-mysql.tf | 8 ++-- .../azure/postgresql/monitors-postegresql.tf | 10 ++--- cloud/azure/redis/monitors-azure-redis.tf | 8 ++-- .../serverfarms/monitors-azure-serverfarms.tf | 6 +-- .../azure/servicebus/monitors-service-bus.tf | 8 ++-- .../monitors-sql-database-basics.tf | 10 ++--- cloud/azure/storage/monitors-azure-storage.tf | 18 ++++---- .../monitors-stream-analytics.tf | 10 ++--- .../monitors-virtual-machine.tf | 6 +-- cloud/gcp/big-query/monitors-big-query.tf | 18 ++++---- .../common/monitors-cloud-sql-common.tf | 12 ++--- .../mysql/monitors-cloudsql-mysql.tf | 2 +- .../gcp/gce/instance/monitors-gce-instance.tf | 6 +-- cloud/gcp/lb/monitors-lb.tf | 10 ++--- cloud/gcp/pubsub/monitors-pubsub.tf | 4 +- .../elasticsearch/monitors-elasticsearch.tf | 44 +++++++++---------- database/mongodb/monitors-mongo.tf | 8 ++-- database/mysql/monitors-mysql.tf | 16 +++---- database/postgresql/monitors-postgresql.tf | 6 +-- database/redis/monitors-redis.tf | 20 ++++----- middleware/apache/monitors-apache.tf | 2 +- middleware/nginx/monitors-nginx.tf | 4 +- middleware/php-fpm/monitors-fpm.tf | 4 +- system/generic/monitors-system.tf | 12 ++--- system/unreachable/monitors-unreachable.tf | 2 +- 50 files changed, 211 insertions(+), 211 deletions(-) diff --git a/caas/kubernetes/ark/monitors-ark.tf b/caas/kubernetes/ark/monitors-ark.tf index c69d74f..f7ca08b 100644 --- a/caas/kubernetes/ark/monitors-ark.tf +++ b/caas/kubernetes/ark/monitors-ark.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "ark_schedules_monitor" { - count = "${var.ark_schedules_enabled ? 1 : 0}" + count = "${var.ark_schedules_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Ark backup failed" type = "metric alert" message = "${coalesce(var.ark_schedules_monitor_message, var.message)}" diff --git a/caas/kubernetes/ingress/vts/monitors-ingress.tf b/caas/kubernetes/ingress/vts/monitors-ingress.tf index 812e3a8..b70f2d7 100644 --- a/caas/kubernetes/ingress/vts/monitors-ingress.tf +++ b/caas/kubernetes/ingress/vts/monitors-ingress.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "nginx_ingress_too_many_5xx" { - count = "${var.ingress_5xx_enabled ? 1 : 0}" + count = "${var.ingress_5xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Nginx Ingress 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.ingress_5xx_message, var.message)}" @@ -33,7 +33,7 @@ resource "datadog_monitor" "nginx_ingress_too_many_5xx" { } resource "datadog_monitor" "nginx_ingress_too_many_4xx" { - count = "${var.ingress_4xx_enabled ? 1 : 0}" + count = "${var.ingress_4xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Nginx Ingress 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.ingress_4xx_message, var.message)}" diff --git a/cloud/aws/alb/monitors-alb.tf b/cloud/aws/alb/monitors-alb.tf index 8f936f1..8241ffd 100644 --- a/cloud/aws/alb/monitors-alb.tf +++ b/cloud/aws/alb/monitors-alb.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "ALB_no_healthy_instances" { - count = "${var.alb_no_healthy_instances_enabled ? 1 : 0}" + count = "${var.alb_no_healthy_instances_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ALB healthy instances {{#is_alert}}is at 0{{/is_alert}}{{#is_warning}}is at {{value}}%{{/is_warning}}" type = "metric alert" message = "${coalesce(var.alb_no_healthy_instances_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "ALB_no_healthy_instances" { } resource "datadog_monitor" "ALB_latency" { - count = "${var.latency_enabled ? 1 : 0}" + count = "${var.latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ALB latency {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" type = "metric alert" message = "${coalesce(var.latency_message, var.message)}" @@ -63,7 +63,7 @@ resource "datadog_monitor" "ALB_latency" { } resource "datadog_monitor" "ALB_httpcode_5xx" { - count = "${var.httpcode_alb_5xx_enabled ? 1 : 0}" + count = "${var.httpcode_alb_5xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ALB HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_alb_5xx_message, var.message)}" @@ -95,7 +95,7 @@ resource "datadog_monitor" "ALB_httpcode_5xx" { } resource "datadog_monitor" "ALB_httpcode_4xx" { - count = "${var.httpcode_alb_4xx_enabled ? 1 : 0}" + count = "${var.httpcode_alb_4xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ALB HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_alb_4xx_message, var.message)}" @@ -127,7 +127,7 @@ resource "datadog_monitor" "ALB_httpcode_4xx" { } resource "datadog_monitor" "ALB_httpcode_target_5xx" { - count = "${var.httpcode_target_5xx_enabled ? 1 : 0}" + count = "${var.httpcode_target_5xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ALB target HTTP code 5xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_target_5xx_message, var.message)}" @@ -159,7 +159,7 @@ resource "datadog_monitor" "ALB_httpcode_target_5xx" { } resource "datadog_monitor" "ALB_httpcode_target_4xx" { - count = "${var.httpcode_target_4xx_enabled ? 1 : 0}" + count = "${var.httpcode_target_4xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ALB target HTTP code 4xx {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.httpcode_target_4xx_message, var.message)}" diff --git a/cloud/aws/apigateway/monitors-api.tf b/cloud/aws/apigateway/monitors-api.tf index c3c5218..cb6a9cc 100644 --- a/cloud/aws/apigateway/monitors-api.tf +++ b/cloud/aws/apigateway/monitors-api.tf @@ -1,6 +1,6 @@ # Monitoring Api Gateway latency resource "datadog_monitor" "API_Gateway_latency" { - count = "${var.latency_enabled ? 1 : 0}" + count = "${var.latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Gateway latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" type = "metric alert" message = "${coalesce(var.latency_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "API_Gateway_latency" { # Monitoring API Gateway 5xx errors percent resource "datadog_monitor" "API_http_5xx_errors_count" { - count = "${var.http_5xx_requests_enabled ? 1 : 0}" + count = "${var.http_5xx_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Gateway HTTP 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_5xx_requests_message, var.message)}" @@ -65,7 +65,7 @@ resource "datadog_monitor" "API_http_5xx_errors_count" { # Monitoring API Gateway 4xx errors percent resource "datadog_monitor" "API_http_4xx_errors_count" { - count = "${var.http_4xx_requests_enabled ? 1 : 0}" + count = "${var.http_4xx_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Gateway HTTP 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_4xx_requests_message, var.message)}" diff --git a/cloud/aws/elasticache/common/monitors-elasticache.tf b/cloud/aws/elasticache/common/monitors-elasticache.tf index e7c76c3..40e4e9d 100644 --- a/cloud/aws/elasticache/common/monitors-elasticache.tf +++ b/cloud/aws/elasticache/common/monitors-elasticache.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "elasticache_eviction" { - count = "${var.eviction_enabled ? 1 : 0}" + count = "${var.eviction_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache eviction {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}" message = "${coalesce(var.eviction_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "elasticache_eviction" { } resource "datadog_monitor" "elasticache_max_connection" { - count = "${var.max_connection_enabled ? 1 : 0}" + count = "${var.max_connection_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache max connections reached {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.max_connection_message, var.message)}" @@ -60,7 +60,7 @@ resource "datadog_monitor" "elasticache_max_connection" { } resource "datadog_monitor" "elasticache_no_connection" { - count = "${var.no_connection_enabled ? 1 : 0}" + count = "${var.no_connection_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache connections {{#is_alert}}{{{comparator}}} {{threshold}} {{/is_alert}}" message = "${coalesce(var.no_connection_message, var.message)}" @@ -88,7 +88,7 @@ resource "datadog_monitor" "elasticache_no_connection" { } resource "datadog_monitor" "elasticache_swap" { - count = "${var.swap_enabled ? 1 : 0}" + count = "${var.swap_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache swap {{#is_alert}}{{{comparator}}} {{threshold}}MB ({{value}}MB){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}MB ({{value}}MB){{/is_warning}}" message = "${coalesce(var.swap_message, var.message)}" @@ -121,7 +121,7 @@ resource "datadog_monitor" "elasticache_swap" { } resource "datadog_monitor" "elasticache_free_memory" { - count = "${var.free_memory_enabled ? 1 : 0}" + count = "${var.free_memory_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache free memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_memory_message, var.message)}" @@ -154,7 +154,7 @@ resource "datadog_monitor" "elasticache_free_memory" { } resource "datadog_monitor" "elasticache_eviction_growing" { - count = "${var.eviction_growing_enabled ? 1 : 0}" + count = "${var.eviction_growing_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache evictions is growing {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.eviction_growing_message, var.message)}" diff --git a/cloud/aws/elasticache/memcached/monitors-memcached.tf b/cloud/aws/elasticache/memcached/monitors-memcached.tf index 6ff12c2..ec95b24 100644 --- a/cloud/aws/elasticache/memcached/monitors-memcached.tf +++ b/cloud/aws/elasticache/memcached/monitors-memcached.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "memcached_get_hits" { - count = "${var.get_hits_enabled ? 1 : 0}" + count = "${var.get_hits_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache memcached cache hit ratio {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.get_hits_message, var.message)}" @@ -34,7 +34,7 @@ resource "datadog_monitor" "memcached_get_hits" { } resource "datadog_monitor" "memcached_cpu_high" { - count = "${var.cpu_high_enabled ? 1 : 0}" + count = "${var.cpu_high_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache memcached CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_high_message, var.message)}" diff --git a/cloud/aws/elasticache/redis/monitors-redis.tf b/cloud/aws/elasticache/redis/monitors-redis.tf index 7d37361..b87055d 100644 --- a/cloud/aws/elasticache/redis/monitors-redis.tf +++ b/cloud/aws/elasticache/redis/monitors-redis.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "redis_cache_hits" { - count = "${var.cache_hits_enabled ? 1 : 0}" + count = "${var.cache_hits_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache redis cache hit ratio {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cache_hits_message, var.message)}" @@ -34,7 +34,7 @@ resource "datadog_monitor" "redis_cache_hits" { } resource "datadog_monitor" "redis_cpu_high" { - count = "${var.cpu_high_enabled ? 1 : 0}" + count = "${var.cpu_high_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache redis CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_high_message, var.message)}" @@ -62,7 +62,7 @@ resource "datadog_monitor" "redis_cpu_high" { } resource "datadog_monitor" "redis_replication_lag" { - count = "${var.replication_lag_enabled ? 1 : 0}" + count = "${var.replication_lag_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache redis 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)}" @@ -95,7 +95,7 @@ resource "datadog_monitor" "redis_replication_lag" { } resource "datadog_monitor" "redis_commands" { - count = "${var.commands_enabled ? 1 : 0}" + count = "${var.commands_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticache redis is receiving no commands" message = "${coalesce(var.commands_message, var.message)}" diff --git a/cloud/aws/elasticsearch/monitors-elasticsearch.tf b/cloud/aws/elasticsearch/monitors-elasticsearch.tf index 84f24eb..f0f3e8a 100644 --- a/cloud/aws/elasticsearch/monitors-elasticsearch.tf +++ b/cloud/aws/elasticsearch/monitors-elasticsearch.tf @@ -4,7 +4,7 @@ - If aws.es.cluster_statusyellow is 1 --> 1 < query value (=1.1) < 2 : warning Workaround : in the query, we add "0.1" to the result and we use the comparator ">=". No alert was triggered without that. */ resource "datadog_monitor" "es_cluster_status" { - count = "${var.es_cluster_status_enabled ? 1 : 0}" + count = "${var.es_cluster_status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch cluster status is not green" message = "${coalesce(var.es_cluster_status_message, var.message)}" @@ -39,7 +39,7 @@ EOF ### Elasticsearch cluster free storage space monitor ### resource "datadog_monitor" "es_free_space_low" { - count = "${var.diskspace_enabled ? 1 : 0}" + count = "${var.diskspace_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch cluster free storage space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" @@ -74,7 +74,7 @@ EOF ### Elasticsearch cluster CPU monitor ### resource "datadog_monitor" "es_cpu_90_15min" { - count = "${var.cpu_enabled ? 1 : 0}" + count = "${var.cpu_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch cluster CPU high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index 4888fbc..c8fdbb5 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { - count = "${var.elb_no_healthy_instance_enabled ? 1 : 0}" + count = "${var.elb_no_healthy_instance_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ELB healthy instances {{#is_alert}}is at 0{{/is_alert}}{{#is_warning}}is at {{value}}%{{/is_warning}}" message = "${coalesce(var.elb_no_healthy_instance_message, var.message)}" @@ -34,7 +34,7 @@ resource "datadog_monitor" "ELB_no_healthy_instances" { } resource "datadog_monitor" "ELB_too_much_4xx" { - count = "${var.elb_4xx_enabled ? 1 : 0}" + count = "${var.elb_4xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ELB 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_4xx_message, var.message)}" @@ -68,7 +68,7 @@ resource "datadog_monitor" "ELB_too_much_4xx" { } resource "datadog_monitor" "ELB_too_much_5xx" { - count = "${var.elb_5xx_enabled ? 1 : 0}" + count = "${var.elb_5xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ELB 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_5xx_message, var.message)}" @@ -102,7 +102,7 @@ resource "datadog_monitor" "ELB_too_much_5xx" { } resource "datadog_monitor" "ELB_too_much_4xx_backend" { - count = "${var.elb_backend_4xx_enabled ? 1 : 0}" + count = "${var.elb_backend_4xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ELB backend 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_backend_4xx_message, var.message)}" @@ -136,7 +136,7 @@ resource "datadog_monitor" "ELB_too_much_4xx_backend" { } resource "datadog_monitor" "ELB_too_much_5xx_backend" { - count = "${var.elb_backend_5xx_enabled ? 1 : 0}" + count = "${var.elb_backend_5xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ELB backend 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.elb_backend_5xx_message, var.message)}" @@ -170,7 +170,7 @@ resource "datadog_monitor" "ELB_too_much_5xx_backend" { } resource "datadog_monitor" "ELB_backend_latency" { - count = "${var.elb_backend_latency_enabled ? 1 : 0}" + count = "${var.elb_backend_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ELB latency too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.elb_backend_latency_message, var.message)}" diff --git a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf index 4ddc01a..f23b7ca 100644 --- a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf +++ b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf @@ -1,6 +1,6 @@ ### Kinesis Firehose Incoming records ### resource "datadog_monitor" "firehose_incoming_records" { - count = "${var.incoming_records_enabled ? 1 : 0}" + count = "${var.incoming_records_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Kinesis Firehose No incoming records" message = "${coalesce(var.incoming_records_message, var.message)}" diff --git a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf index 8fc062f..c4ea2db 100644 --- a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf +++ b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf @@ -1,6 +1,6 @@ ### RDS Aurora Mysql Replica Lag monitor ### resource "datadog_monitor" "rds_aurora_mysql_replica_lag" { - count = "${var.aurora_replicalag_enabled ? 1 : 0}" + count = "${var.aurora_replicalag_enabled == "true" ? 1 : 0}" name = "[${var.environment}] RDS Aurora Mysql replica lag {{#is_alert}}{{{comparator}}} {{threshold}} ms ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ms ({{value}}%){{/is_warning}}" message = "${coalesce(var.aurora_replicalag_message, var.message)}" diff --git a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf index 0c03a33..14c8271 100644 --- a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf +++ b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf @@ -1,6 +1,6 @@ ### RDS Aurora Postgresql Replica Lag monitor ### resource "datadog_monitor" "rds_aurora_postgresql_replica_lag" { - count = "${var.aurora_replicalag_enabled ? 1 : 0}" + count = "${var.aurora_replicalag_enabled == "true" ? 1 : 0}" name = "[${var.environment}] RDS Aurora PostgreSQL replica lag {{#is_alert}}{{{comparator}}} {{threshold}} ms ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ms ({{value}}%){{/is_warning}}" message = "${coalesce(var.aurora_replicalag_message, var.message)}" diff --git a/cloud/aws/rds/common/monitors-rds-common.tf b/cloud/aws/rds/common/monitors-rds-common.tf index fdf5105..10a4d7b 100644 --- a/cloud/aws/rds/common/monitors-rds-common.tf +++ b/cloud/aws/rds/common/monitors-rds-common.tf @@ -1,6 +1,6 @@ ### RDS instance CPU monitor ### resource "datadog_monitor" "rds_cpu_90_15min" { - count = "${var.cpu_enabled ? 1 : 0}" + count = "${var.cpu_enabled == "true" ? 1 : 0}" name = "[${var.environment}] RDS instance CPU high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" @@ -33,7 +33,7 @@ EOF ### RDS instance free space monitor ### resource "datadog_monitor" "rds_free_space_low" { - count = "${var.diskspace_enabled ? 1 : 0}" + count = "${var.diskspace_enabled == "true" ? 1 : 0}" name = "[${var.environment}] RDS instance free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" @@ -67,7 +67,7 @@ EOF ### RDS Replica Lag monitor ### resource "datadog_monitor" "rds_replica_lag" { - count = "${var.replicalag_enabled ? 1 : 0}" + count = "${var.replicalag_enabled == "true" ? 1 : 0}" name = "[${var.environment}] RDS replica lag {{#is_alert}}{{{comparator}}} {{threshold}} ms ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ms ({{value}}%){{/is_warning}}" message = "${coalesce(var.replicalag_message, var.message)}" diff --git a/cloud/aws/vpn/monitors-vpn.tf b/cloud/aws/vpn/monitors-vpn.tf index 2ceade7..a2c3afc 100644 --- a/cloud/aws/vpn/monitors-vpn.tf +++ b/cloud/aws/vpn/monitors-vpn.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "VPN_status" { - count = "${var.vpn_status_enabled ? 1 : 0}" + count = "${var.vpn_status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] VPN tunnel down" message = "${coalesce(var.vpn_status_message, var.message)}" diff --git a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf index bc3b63a..85a8aeb 100644 --- a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf +++ b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "apimgt_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Management is down" message = "${coalesce(var.status_message, var.message)}" @@ -29,7 +29,7 @@ resource "datadog_monitor" "apimgt_status" { } resource "datadog_monitor" "apimgt_failed_requests" { - count = "${var.failed_requests_enabled ? 1 : 0}" + count = "${var.failed_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Management too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_requests_message, var.message)}" @@ -62,7 +62,7 @@ resource "datadog_monitor" "apimgt_failed_requests" { } resource "datadog_monitor" "apimgt_other_requests" { - count = "${var.other_requests_enabled ? 1 : 0}" + count = "${var.other_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Management too many other requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.other_requests_message, var.message)}" @@ -95,7 +95,7 @@ resource "datadog_monitor" "apimgt_other_requests" { } resource "datadog_monitor" "apimgt_unauthorized_requests" { - count = "${var.unauthorized_requests_enabled ? 1 : 0}" + count = "${var.unauthorized_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Management too many unauthorized requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.unauthorized_requests_message, var.message)}" @@ -128,7 +128,7 @@ resource "datadog_monitor" "apimgt_unauthorized_requests" { } resource "datadog_monitor" "apimgt_successful_requests" { - count = "${var.successful_requests_enabled ? 1 : 0}" + count = "${var.successful_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] API Management successful requests rate too low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.successful_requests_message, var.message)}" diff --git a/cloud/azure/app-services/monitors-app_services.tf b/cloud/azure/app-services/monitors-app_services.tf index 557b006..ed9aef6 100644 --- a/cloud/azure/app-services/monitors-app_services.tf +++ b/cloud/azure/app-services/monitors-app_services.tf @@ -1,6 +1,6 @@ # Monitoring App Services response time resource "datadog_monitor" "appservices_response_time" { - count = "${var.response_time_enabled ? 1 : 0}" + count = "${var.response_time_enabled == "true" ? 1 : 0}" name = "[${var.environment}] App Services response time too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" type = "metric alert" message = "${coalesce(var.response_time_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "appservices_response_time" { # Monitoring App Services memory usage resource "datadog_monitor" "appservices_memory_usage_count" { - count = "${var.memory_usage_enabled ? 1 : 0}" + count = "${var.memory_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] App Services memory usage {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = "${coalesce(var.memory_usage_message, var.message)}" @@ -64,7 +64,7 @@ resource "datadog_monitor" "appservices_memory_usage_count" { # Monitoring App Services 5xx errors percent resource "datadog_monitor" "appservices_http_5xx_errors_count" { - count = "${var.http_5xx_requests_enabled ? 1 : 0}" + count = "${var.http_5xx_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] App Services HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_5xx_requests_message, var.message)}" @@ -97,7 +97,7 @@ resource "datadog_monitor" "appservices_http_5xx_errors_count" { # Monitoring App Services 4xx errors percent resource "datadog_monitor" "appservices_http_4xx_errors_count" { - count = "${var.http_4xx_requests_enabled ? 1 : 0}" + count = "${var.http_4xx_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] App Services HTTP 4xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_4xx_requests_message, var.message)}" @@ -130,7 +130,7 @@ resource "datadog_monitor" "appservices_http_4xx_errors_count" { # Monitoring App Services HTTP 2xx & 3xx status pages percent resource "datadog_monitor" "appservices_http_success_status_rate" { - count = "${var.http_successful_requests_enabled ? 1 : 0}" + count = "${var.http_successful_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] App Services HTTP successful responses too low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_successful_requests_message, var.message)}" diff --git a/cloud/azure/azure-search/monitors-azure-search.tf b/cloud/azure/azure-search/monitors-azure-search.tf index abc5a91..638ab64 100644 --- a/cloud/azure/azure-search/monitors-azure-search.tf +++ b/cloud/azure/azure-search/monitors-azure-search.tf @@ -1,6 +1,6 @@ # Monitoring Azure Search latency resource "datadog_monitor" "azure_search_latency" { - count = "${var.latency_enabled ? 1 : 0}" + count = "${var.latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Search latency too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" type = "metric alert" message = "${coalesce(var.latency_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "azure_search_latency" { # Monitoring Azure Search throttled queries resource "datadog_monitor" "azure_search_throttled_queries_rate" { - count = "${var.throttled_queries_rate_enabled ? 1 : 0}" + count = "${var.throttled_queries_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Search throttled queries rate is too high {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" type = "metric alert" message = "${coalesce(var.throttled_queries_rate_message, var.message)}" diff --git a/cloud/azure/cosmosdb/monitors-cosmosdb.tf b/cloud/azure/cosmosdb/monitors-cosmosdb.tf index 75078c6..4e30f78 100644 --- a/cloud/azure/cosmosdb/monitors-cosmosdb.tf +++ b/cloud/azure/cosmosdb/monitors-cosmosdb.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "cosmos_db_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Cosmos DB is down" message = "${coalesce(var.status_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "cosmos_db_status" { } resource "datadog_monitor" "cosmos_db_4xx_requests" { - count = "${var.cosmos_db_4xx_requests_enabled ? 1 : 0}" + count = "${var.cosmos_db_4xx_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Cosmos DB 4xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cosmos_db_4xx_requests_message, var.message)}" @@ -77,7 +77,7 @@ resource "datadog_monitor" "cosmos_db_4xx_requests" { } resource "datadog_monitor" "cosmos_db_5xx_requests" { - count = "${var.cosmos_db_5xx_requests_enabled ? 1 : 0}" + count = "${var.cosmos_db_5xx_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Cosmos DB 5xx requests rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cosmos_db_5xx_requests_message, var.message)}" @@ -113,7 +113,7 @@ resource "datadog_monitor" "cosmos_db_5xx_requests" { } resource "datadog_monitor" "cosmos_db_scaling" { - count = "${var.cosmos_db_scaling_enabled ? 1 : 0}" + count = "${var.cosmos_db_scaling_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Cosmos DB max scaling reached for collection {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cosmos_db_scaling_message, var.message)}" diff --git a/cloud/azure/datalakestore/monitors-datalakestore.tf b/cloud/azure/datalakestore/monitors-datalakestore.tf index db5f78f..8620fb1 100644 --- a/cloud/azure/datalakestore/monitors-datalakestore.tf +++ b/cloud/azure/datalakestore/monitors-datalakestore.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "datalakestore_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Datalake Store is down" message = "${coalesce(var.status_message, var.message)}" diff --git a/cloud/azure/eventgrid/monitors-eventgrid.tf b/cloud/azure/eventgrid/monitors-eventgrid.tf index 6e96599..764bb8c 100644 --- a/cloud/azure/eventgrid/monitors-eventgrid.tf +++ b/cloud/azure/eventgrid/monitors-eventgrid.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "eventgrid_no_successful_message" { - count = "${var.no_successful_message_rate_enabled ? 1 : 0}" + count = "${var.no_successful_message_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Event Grid no successful message {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.no_successful_message_rate_message, var.message)}" @@ -27,7 +27,7 @@ resource "datadog_monitor" "eventgrid_no_successful_message" { } resource "datadog_monitor" "eventgrid_failed_messages" { - count = "${var.failed_messages_rate_enabled ? 1 : 0}" + count = "${var.failed_messages_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Event Grid too many failed messages {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_messages_rate_message, var.message)}" @@ -64,7 +64,7 @@ resource "datadog_monitor" "eventgrid_failed_messages" { } resource "datadog_monitor" "eventgrid_unmatched_events" { - count = "${var.unmatched_events_rate_enabled ? 1 : 0}" + count = "${var.unmatched_events_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Event Grid too many unmatched events {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.unmatched_events_rate_message, var.message)}" diff --git a/cloud/azure/eventhub/monitors-eventhub.tf b/cloud/azure/eventhub/monitors-eventhub.tf index 2d2ba87..12d83ea 100644 --- a/cloud/azure/eventhub/monitors-eventhub.tf +++ b/cloud/azure/eventhub/monitors-eventhub.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "eventhub_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Event Hub is down" message = "${coalesce(var.status_message, var.message)}" @@ -27,7 +27,7 @@ resource "datadog_monitor" "eventhub_status" { } resource "datadog_monitor" "eventhub_failed_requests" { - count = "${var.failed_requests_rate_enabled ? 1 : 0}" + count = "${var.failed_requests_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Event Hub too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_requests_rate_message, var.message)}" @@ -61,7 +61,7 @@ resource "datadog_monitor" "eventhub_failed_requests" { } resource "datadog_monitor" "eventhub_errors" { - count = "${var.errors_rate_enabled ? 1 : 0}" + count = "${var.errors_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Event Hub too many errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.errors_rate_message, var.message)}" diff --git a/cloud/azure/functions/monitors-functions.tf b/cloud/azure/functions/monitors-functions.tf index 3084815..995aa58 100644 --- a/cloud/azure/functions/monitors-functions.tf +++ b/cloud/azure/functions/monitors-functions.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "function_http_5xx_errors_rate" { - count = "${var.http_5xx_errors_rate_enabled ? 1 : 0}" + count = "${var.http_5xx_errors_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Function App HTTP 5xx errors too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" type = "metric alert" message = "${coalesce(var.http_5xx_errors_rate_message, var.message)}" @@ -31,7 +31,7 @@ resource "datadog_monitor" "function_http_5xx_errors_rate" { } resource "datadog_monitor" "function_high_connections_count" { - count = "${var.high_connections_count_enabled ? 1 : 0}" + count = "${var.high_connections_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Function App connections count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = "${coalesce(var.high_connections_count_message, var.message)}" @@ -62,7 +62,7 @@ resource "datadog_monitor" "function_high_connections_count" { } resource "datadog_monitor" "function_high_threads_count" { - count = "${var.high_threads_count_enabled ? 1 : 0}" + count = "${var.high_threads_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Function App threads count too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" type = "metric alert" message = "${coalesce(var.high_threads_count_message, var.message)}" diff --git a/cloud/azure/iothubs/monitors-iothubs.tf b/cloud/azure/iothubs/monitors-iothubs.tf index c5332e9..ba85e1c 100644 --- a/cloud/azure/iothubs/monitors-iothubs.tf +++ b/cloud/azure/iothubs/monitors-iothubs.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "too_many_jobs_failed" { - count = "${var.failed_jobs_rate_enabled ? 1 : 0}" + count = "${var.failed_jobs_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_jobs_rate_message, var.message)}" @@ -35,7 +35,7 @@ resource "datadog_monitor" "too_many_jobs_failed" { } resource "datadog_monitor" "too_many_list_jobs_failed" { - count = "${var.failed_listjobs_rate_enabled ? 1 : 0}" + count = "${var.failed_listjobs_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many list_jobs failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_listjobs_rate_message, var.message)}" @@ -71,7 +71,7 @@ resource "datadog_monitor" "too_many_list_jobs_failed" { } resource "datadog_monitor" "too_many_query_jobs_failed" { - count = "${var.failed_queryjobs_rate_enabled ? 1 : 0}" + count = "${var.failed_queryjobs_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many query_jobs failed {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_queryjobs_rate_message, var.message)}" @@ -107,7 +107,7 @@ resource "datadog_monitor" "too_many_query_jobs_failed" { } resource "datadog_monitor" "status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub is down" message = "${coalesce(var.status_message, var.message)}" @@ -135,7 +135,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "total_devices" { - count = "${var.total_devices_enabled ? 1 : 0}" + count = "${var.total_devices_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Total devices is wrong {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.total_devices_message, var.message)}" @@ -163,7 +163,7 @@ resource "datadog_monitor" "total_devices" { } resource "datadog_monitor" "too_many_c2d_methods_failed" { - count = "${var.failed_c2d_methods_rate_enabled ? 1 : 0}" + count = "${var.failed_c2d_methods_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many c2d methods failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_methods_rate_message, var.message)}" @@ -199,7 +199,7 @@ resource "datadog_monitor" "too_many_c2d_methods_failed" { } resource "datadog_monitor" "too_many_c2d_twin_read_failed" { - count = "${var.failed_c2d_twin_read_rate_enabled ? 1 : 0}" + count = "${var.failed_c2d_twin_read_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many c2d twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_read_rate_message, var.message)}" @@ -235,7 +235,7 @@ resource "datadog_monitor" "too_many_c2d_twin_read_failed" { } resource "datadog_monitor" "too_many_c2d_twin_update_failed" { - count = "${var.failed_c2d_twin_update_rate_enabled ? 1 : 0}" + count = "${var.failed_c2d_twin_update_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many c2d twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_c2d_twin_update_rate_message, var.message)}" @@ -271,7 +271,7 @@ resource "datadog_monitor" "too_many_c2d_twin_update_failed" { } resource "datadog_monitor" "too_many_d2c_twin_read_failed" { - count = "${var.failed_d2c_twin_read_rate_enabled ? 1 : 0}" + count = "${var.failed_d2c_twin_read_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c twin read failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_read_rate_message, var.message)}" @@ -307,7 +307,7 @@ resource "datadog_monitor" "too_many_d2c_twin_read_failed" { } resource "datadog_monitor" "too_many_d2c_twin_update_failed" { - count = "${var.failed_d2c_twin_update_rate_enabled ? 1 : 0}" + count = "${var.failed_d2c_twin_update_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c twin update failure {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_d2c_twin_update_rate_message, var.message)}" @@ -343,7 +343,7 @@ resource "datadog_monitor" "too_many_d2c_twin_update_failed" { } resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { - count = "${var.dropped_d2c_telemetry_egress_enabled ? 1 : 0}" + count = "${var.dropped_d2c_telemetry_egress_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry egress dropped {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.dropped_d2c_telemetry_egress_message, var.message)}" @@ -381,7 +381,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { } resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { - count = "${var.orphaned_d2c_telemetry_egress_enabled ? 1 : 0}" + count = "${var.orphaned_d2c_telemetry_egress_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry egress orphaned {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.orphaned_d2c_telemetry_egress_message, var.message)}" @@ -419,7 +419,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { } resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { - count = "${var.invalid_d2c_telemetry_egress_enabled ? 1 : 0}" + count = "${var.invalid_d2c_telemetry_egress_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry egress invalid {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.invalid_d2c_telemetry_egress_message, var.message)}" @@ -457,7 +457,7 @@ resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { } resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { - count = "${var.too_many_d2c_telemetry_ingress_nosent_enabled ? 1 : 0}" + count = "${var.too_many_d2c_telemetry_ingress_nosent_enabled == "true" ? 1 : 0}" name = "[${var.environment}] IOT Hub Too many d2c telemetry ingress not sent {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.too_many_d2c_telemetry_ingress_nosent_message, var.message)}" diff --git a/cloud/azure/keyvault/monitors-keyvault.tf b/cloud/azure/keyvault/monitors-keyvault.tf index 74263e6..984edb8 100644 --- a/cloud/azure/keyvault/monitors-keyvault.tf +++ b/cloud/azure/keyvault/monitors-keyvault.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "keyvault_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Key Vault is down" message = "${coalesce(var.status_message, var.message)}" @@ -28,7 +28,7 @@ resource "datadog_monitor" "keyvault_status" { } resource "datadog_monitor" "keyvault_api_result" { - count = "${var.api_result_enabled ? 1 : 0}" + count = "${var.api_result_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Key Vault API result rate is low {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.status_message, var.message)}" @@ -65,7 +65,7 @@ resource "datadog_monitor" "keyvault_api_result" { } resource "datadog_monitor" "keyvault_api_latency" { - count = "${var.api_latency_enabled ? 1 : 0}" + count = "${var.api_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Key Vault API latency is high {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.status_message, var.message)}" diff --git a/cloud/azure/load-balancer/monitors-load-balancer.tf b/cloud/azure/load-balancer/monitors-load-balancer.tf index 2a69b90..8852925 100644 --- a/cloud/azure/load-balancer/monitors-load-balancer.tf +++ b/cloud/azure/load-balancer/monitors-load-balancer.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "loadbalancer_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Load Balancer is unreachable" message = "${coalesce(var.status_message, var.message)}" diff --git a/cloud/azure/mysql/monitors-mysql.tf b/cloud/azure/mysql/monitors-mysql.tf index df54014..b95206e 100644 --- a/cloud/azure/mysql/monitors-mysql.tf +++ b/cloud/azure/mysql/monitors-mysql.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "mysql_cpu_usage" { - count = "${var.cpu_usage_enabled ? 1 : 0}" + count = "${var.cpu_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Server CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_usage_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "mysql_cpu_usage" { } resource "datadog_monitor" "mysql_free_storage" { - count = "${var.free_storage_enabled ? 1 : 0}" + count = "${var.free_storage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_storage_message, var.message)}" @@ -65,7 +65,7 @@ resource "datadog_monitor" "mysql_free_storage" { } resource "datadog_monitor" "mysql_io_consumption" { - count = "${var.io_consumption_enabled ? 1 : 0}" + count = "${var.io_consumption_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Server IO consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.io_consumption_message, var.message)}" @@ -98,7 +98,7 @@ resource "datadog_monitor" "mysql_io_consumption" { } resource "datadog_monitor" "mysql_memory_usage" { - count = "${var.memory_usage_enabled ? 1 : 0}" + count = "${var.memory_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.memory_usage_message, var.message)}" diff --git a/cloud/azure/postgresql/monitors-postegresql.tf b/cloud/azure/postgresql/monitors-postegresql.tf index b4251a9..d92f42d 100644 --- a/cloud/azure/postgresql/monitors-postegresql.tf +++ b/cloud/azure/postgresql/monitors-postegresql.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "postgresql_cpu_usage" { - count = "${var.cpu_usage_enabled ? 1 : 0}" + count = "${var.cpu_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Postgresql Server CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_usage_message, var.message)}" @@ -32,7 +32,7 @@ resource "datadog_monitor" "postgresql_cpu_usage" { } resource "datadog_monitor" "postgresql_no_connection" { - count = "${var.no_connection_enabled ? 1 : 0}" + count = "${var.no_connection_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Postgresql Server has no connection" message = "${coalesce(var.no_connection_message, var.message)}" @@ -60,7 +60,7 @@ resource "datadog_monitor" "postgresql_no_connection" { } resource "datadog_monitor" "postgresql_free_storage" { - count = "${var.free_storage_enabled ? 1 : 0}" + count = "${var.free_storage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Postgresql Server storage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.free_storage_message, var.message)}" @@ -93,7 +93,7 @@ resource "datadog_monitor" "postgresql_free_storage" { } resource "datadog_monitor" "postgresql_io_consumption" { - count = "${var.io_consumption_enabled ? 1 : 0}" + count = "${var.io_consumption_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Postgresql Server IO consumption {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.io_consumption_message, var.message)}" @@ -126,7 +126,7 @@ resource "datadog_monitor" "postgresql_io_consumption" { } resource "datadog_monitor" "postgresql_memory_usage" { - count = "${var.memory_usage_enabled ? 1 : 0}" + count = "${var.memory_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Postgresql Server memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.memory_usage_message, var.message)}" diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index 36e7db9..3709b54 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis {{name}} is down" message = "${coalesce(var.status_message, var.message)}" @@ -27,7 +27,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "evictedkeys" { - count = "${var.evictedkeys_limit_enabled ? 1 : 0}" + count = "${var.evictedkeys_limit_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis too many evictedkeys {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.evictedkeys_limit_message, var.message)}" @@ -60,7 +60,7 @@ EOF } resource "datadog_monitor" "percent_processor_time" { - count = "${var.percent_processor_time_enabled ? 1 : 0}" + count = "${var.percent_processor_time_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis processor time too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.percent_processor_time_message, var.message)}" @@ -93,7 +93,7 @@ EOF } resource "datadog_monitor" "server_load" { - count = "${var.server_load_rate_enabled ? 1 : 0}" + count = "${var.server_load_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis server load too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_load_rate_message, var.message)}" diff --git a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf index 41cbf29..2df06ab 100644 --- a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf +++ b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Serverfarm is down" message = "${coalesce(var.status_message, var.message)}" @@ -27,7 +27,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "cpu_percentage" { - count = "${var.cpu_percentage_enabled ? 1 : 0}" + count = "${var.cpu_percentage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Serverfarm CPU percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_percentage_message, var.message)}" @@ -60,7 +60,7 @@ resource "datadog_monitor" "cpu_percentage" { } resource "datadog_monitor" "memory_percentage" { - count = "${var.memory_percentage_enabled ? 1 : 0}" + count = "${var.memory_percentage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Serverfarm memory percentage is too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.memory_percentage_message, var.message)}" diff --git a/cloud/azure/servicebus/monitors-service-bus.tf b/cloud/azure/servicebus/monitors-service-bus.tf index ee3e1e6..e205ee6 100644 --- a/cloud/azure/servicebus/monitors-service-bus.tf +++ b/cloud/azure/servicebus/monitors-service-bus.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "servicebus_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Service Bus is down" message = "${coalesce(var.status_message, var.message)}" @@ -28,7 +28,7 @@ EOF } resource "datadog_monitor" "service_bus_no_active_connections" { - count = "${var.no_active_connections_enabled ? 1 : 0}" + count = "${var.no_active_connections_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Service Bus has no active connection" message = "${coalesce(var.no_active_connections_message, var.message)}" @@ -57,7 +57,7 @@ resource "datadog_monitor" "service_bus_no_active_connections" { } resource "datadog_monitor" "service_bus_user_errors" { - count = "${var.user_errors_enabled ? 1 : 0}" + count = "${var.user_errors_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Service Bus user errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.user_errors_message, var.message)}" @@ -92,7 +92,7 @@ resource "datadog_monitor" "service_bus_user_errors" { } resource "datadog_monitor" "service_bus_server_errors" { - count = "${var.server_errors_enabled ? 1 : 0}" + count = "${var.server_errors_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Service Bus server errors rate is high {{#is_alert}}{{comparator}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{comparator}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_errors_message, var.message)}" diff --git a/cloud/azure/sql-database/monitors-sql-database-basics.tf b/cloud/azure/sql-database/monitors-sql-database-basics.tf index 44e6021..3160e5f 100644 --- a/cloud/azure/sql-database/monitors-sql-database-basics.tf +++ b/cloud/azure/sql-database/monitors-sql-database-basics.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] SQL Database is down" message = "${coalesce(var.status_message, var.message)}" @@ -27,7 +27,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "sql-database_cpu_90_15min" { - count = "${var.cpu_enabled ? 1 : 0}" + count = "${var.cpu_enabled == "true" ? 1 : 0}" name = "[${var.environment}] SQL Database CPU too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" @@ -59,7 +59,7 @@ resource "datadog_monitor" "sql-database_cpu_90_15min" { } resource "datadog_monitor" "sql-database_free_space_low" { - count = "${var.diskspace_enabled ? 1 : 0}" + count = "${var.diskspace_enabled == "true" ? 1 : 0}" name = "[${var.environment}] SQL Database low free space {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.diskspace_message, var.message)}" @@ -92,7 +92,7 @@ resource "datadog_monitor" "sql-database_free_space_low" { } resource "datadog_monitor" "sql-database_dtu_consumption_high" { - count = "${var.dtu_enabled ? 1 : 0}" + count = "${var.dtu_enabled == "true" ? 1 : 0}" name = "[${var.environment}] SQL Database DTU Consumption too high {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.dtu_message, var.message)}" @@ -125,7 +125,7 @@ resource "datadog_monitor" "sql-database_dtu_consumption_high" { } resource "datadog_monitor" "sql-database_deadlocks_count" { - count = "${var.deadlock_enabled ? 1 : 0}" + count = "${var.deadlock_enabled == "true" ? 1 : 0}" name = "[${var.environment}] SQL Database Deadlocks too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.deadlock_message, var.message)}" diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 0244849..0c1e022 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "availability" { - count = "${var.availability_enabled ? 1 : 0}" + count = "${var.availability_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage is down" message = "${coalesce(var.availability_message, var.message)}" @@ -31,7 +31,7 @@ EOF } resource "datadog_monitor" "successful_requests" { - count = "${var.successful_requests_enabled ? 1 : 0}" + count = "${var.successful_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too few successful requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.successful_requests_message, var.message)}" @@ -63,7 +63,7 @@ EOF } resource "datadog_monitor" "latency" { - count = "${var.latency_enabled ? 1 : 0}" + count = "${var.latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too high end to end latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.latency_message, var.message)}" @@ -95,7 +95,7 @@ EOF } resource "datadog_monitor" "timeout_error_requests" { - count = "${var.timeout_error_requests_enabled ? 1 : 0}" + count = "${var.timeout_error_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too many timeout errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.timeout_error_requests_message, var.message)}" @@ -127,7 +127,7 @@ EOF } resource "datadog_monitor" "network_error_requests" { - count = "${var.network_error_requests_enabled ? 1 : 0}" + count = "${var.network_error_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too many network errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.network_error_requests_message, var.message)}" @@ -159,7 +159,7 @@ EOF } resource "datadog_monitor" "throttling_error_requests" { - count = "${var.throttling_error_requests_enabled ? 1 : 0}" + count = "${var.throttling_error_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too many throttling errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.throttling_error_requests_message, var.message)}" @@ -191,7 +191,7 @@ EOF } resource "datadog_monitor" "server_other_error_requests" { - count = "${var.server_other_error_requests_enabled ? 1 : 0}" + count = "${var.server_other_error_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too many server_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.server_other_error_requests_message, var.message)}" @@ -223,7 +223,7 @@ EOF } resource "datadog_monitor" "client_other_error_requests" { - count = "${var.client_other_error_requests_enabled ? 1 : 0}" + count = "${var.client_other_error_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too many client_other errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.client_other_error_requests_message, var.message)}" @@ -255,7 +255,7 @@ EOF } resource "datadog_monitor" "authorization_error_requests" { - count = "${var.authorization_error_requests_enabled ? 1 : 0}" + count = "${var.authorization_error_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Azure Storage too many authorization errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.authorization_error_requests_message, var.message)}" diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index 8ea92a7..549094e 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Stream Analytics is down" message = "${coalesce(var.status_message, var.message)}" @@ -27,7 +27,7 @@ resource "datadog_monitor" "status" { } resource "datadog_monitor" "su_utilization" { - count = "${var.su_utilization_enabled ? 1 : 0}" + count = "${var.su_utilization_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Stream Analytics streaming units utilization too high {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.su_utilization_message, var.message)}" @@ -60,7 +60,7 @@ resource "datadog_monitor" "su_utilization" { } resource "datadog_monitor" "failed_function_requests" { - count = "${var.failed_function_requests_enabled ? 1 : 0}" + count = "${var.failed_function_requests_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Stream Analytics too many failed requests {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.failed_function_requests_message, var.message)}" @@ -94,7 +94,7 @@ resource "datadog_monitor" "failed_function_requests" { } resource "datadog_monitor" "conversion_errors" { - count = "${var.conversion_errors_enabled ? 1 : 0}" + count = "${var.conversion_errors_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Stream Analytics too many conversion errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.conversion_errors_message, var.message)}" @@ -127,7 +127,7 @@ resource "datadog_monitor" "conversion_errors" { } resource "datadog_monitor" "runtime_errors" { - count = "${var.runtime_errors_enabled ? 1 : 0}" + count = "${var.runtime_errors_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Stream Analytics too many runtime errors {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.runtime_errors_message, var.message)}" diff --git a/cloud/azure/virtual-machine/monitors-virtual-machine.tf b/cloud/azure/virtual-machine/monitors-virtual-machine.tf index 6b6a3a3..29cba32 100644 --- a/cloud/azure/virtual-machine/monitors-virtual-machine.tf +++ b/cloud/azure/virtual-machine/monitors-virtual-machine.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "virtualmachine_status" { - count = "${var.status_enabled ? 1 : 0}" + count = "${var.status_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Virtual Machine is unreachable" message = "${coalesce(var.status_message, var.message)}" @@ -28,7 +28,7 @@ resource "datadog_monitor" "virtualmachine_status" { } resource "datadog_monitor" "virtualmachine_cpu_usage" { - count = "${var.cpu_usage_enabled ? 1 : 0}" + count = "${var.cpu_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Virtual Machine CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_usage_message, var.message)}" @@ -61,7 +61,7 @@ resource "datadog_monitor" "virtualmachine_cpu_usage" { } resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" { - count = "${var.cpu_remaining_rate_enabled ? 1 : 0}" + count = "${var.cpu_remaining_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Virtual Machine credit CPU {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_remaining_rate_message, var.message)}" diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index 91d92be..4c7c75d 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -2,7 +2,7 @@ # Concurrent queries # resource "datadog_monitor" "concurrent_queries" { - count = "${var.concurrent_queries_enabled ? 1 : 0}" + count = "${var.concurrent_queries_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Concurrent Queries {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.concurrent_queries_message, var.message)}" @@ -38,7 +38,7 @@ EOF # Execution Time # resource "datadog_monitor" "execution_time" { - count = "${var.execution_time_enabled ? 1 : 0}" + count = "${var.execution_time_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Execution Time {{#is_alert}}{{{comparator}}} {{threshold}}s ({{value}}s){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}s ({{value}}s){{/is_warning}}" message = "${coalesce(var.execution_time_message, var.message)}" @@ -74,7 +74,7 @@ EOF # Scanned Bytes # resource "datadog_monitor" "scanned_bytes" { - count = "${var.scanned_bytes_enabled ? 1 : 0}" + count = "${var.scanned_bytes_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Scanned Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.scanned_bytes_message, var.message)}" @@ -110,7 +110,7 @@ EOF # Scanned Bytes Billed # resource "datadog_monitor" "scanned_bytes_billed" { - count = "${var.scanned_bytes_billed_enabled ? 1 : 0}" + count = "${var.scanned_bytes_billed_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Scanned Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.scanned_bytes_billed_message, var.message)}" @@ -146,7 +146,7 @@ EOF # Available Slots # resource "datadog_monitor" "available_slots" { - count = "${var.available_slots_enabled ? 1 : 0}" + count = "${var.available_slots_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Available Slots {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.available_slots_message, var.message)}" @@ -182,7 +182,7 @@ EOF # Stored Bytes # resource "datadog_monitor" "stored_bytes" { - count = "${var.stored_bytes_enabled ? 1 : 0}" + count = "${var.stored_bytes_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Stored Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B ({{value}}B){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B ({{value}}B){{/is_warning}}" message = "${coalesce(var.stored_bytes_message, var.message)}" @@ -218,7 +218,7 @@ EOF # Table Count # resource "datadog_monitor" "table_count" { - count = "${var.table_count_enabled ? 1 : 0}" + count = "${var.table_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Table Count {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.table_count_message, var.message)}" @@ -254,7 +254,7 @@ EOF # Uploaded Bytes # resource "datadog_monitor" "uploaded_bytes" { - count = "${var.uploaded_bytes_enabled ? 1 : 0}" + count = "${var.uploaded_bytes_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Uploaded Bytes {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.uploaded_bytes_message, var.message)}" @@ -290,7 +290,7 @@ EOF # Uploaded Bytes Billed # resource "datadog_monitor" "uploaded_bytes_billed" { - count = "${var.uploaded_bytes_billed_enabled ? 1 : 0}" + count = "${var.uploaded_bytes_billed_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP Big Query Uploaded Bytes Billed {{#is_alert}}{{{comparator}}} {{threshold}}B/mn ({{value}}B/mn){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}B/mn ({{value}}B/mn){{/is_warning}}" message = "${coalesce(var.uploaded_bytes_billed_message, var.message)}" diff --git a/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf b/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf index 541b67c..2b37bc2 100644 --- a/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf +++ b/cloud/gcp/cloud-sql/common/monitors-cloud-sql-common.tf @@ -2,7 +2,7 @@ # CPU Utilization # resource "datadog_monitor" "cpu_utilization" { - count = "${var.cpu_utilization_enabled ? 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)}" @@ -40,7 +40,7 @@ EOF # Disk Utilization # resource "datadog_monitor" "disk_utilization" { - count = "${var.disk_utilization_enabled ? 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)}" @@ -78,7 +78,7 @@ EOF # Disk Utilization Forecast # resource "datadog_monitor" "disk_utilization_forecast" { - count = "${var.disk_utilization_forecast_enabled ? 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)}" @@ -122,7 +122,7 @@ EOF # Memory Utilization # resource "datadog_monitor" "memory_utilization" { - count = "${var.memory_utilization_enabled ? 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)}" @@ -160,7 +160,7 @@ EOF # Memory Utilization Forecast # resource "datadog_monitor" "memory_utilization_forecast" { - count = "${var.memory_utilization_forecast_enabled ? 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)}" @@ -204,7 +204,7 @@ EOF # Failover Unavailable # resource "datadog_monitor" "failover_unavailable" { - count = "${var.failover_unavailable_enabled ? 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)}" diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index b8891b5..e2110fd 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -2,7 +2,7 @@ # Replication Lag # resource "datadog_monitor" "replication_lag" { - count = "${var.replication_lag_enabled ? 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)}" diff --git a/cloud/gcp/gce/instance/monitors-gce-instance.tf b/cloud/gcp/gce/instance/monitors-gce-instance.tf index 9b4ccc1..fed557a 100644 --- a/cloud/gcp/gce/instance/monitors-gce-instance.tf +++ b/cloud/gcp/gce/instance/monitors-gce-instance.tf @@ -2,7 +2,7 @@ # CPU Utilization # resource "datadog_monitor" "cpu_utilization" { - count = "${var.cpu_utilization_enabled ? 1 : 0}" + count = "${var.cpu_utilization_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Compute Engine instance 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)}" @@ -39,7 +39,7 @@ EOF # Disk Throttled Bps # resource "datadog_monitor" "disk_throttled_bps" { - count = "${var.disk_throttled_bps_enabled ? 1 : 0}" + count = "${var.disk_throttled_bps_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Compute Engine instance Disk Throttled Bps {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_throttled_bps_message, var.message)}" @@ -82,7 +82,7 @@ EOF # Disk Throttled OPS # resource "datadog_monitor" "disk_throttled_ops" { - count = "${var.disk_throttled_ops_enabled ? 1 : 0}" + count = "${var.disk_throttled_ops_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Compute Engine instance Disk Throttled OPS {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_throttled_ops_message, var.message)}" diff --git a/cloud/gcp/lb/monitors-lb.tf b/cloud/gcp/lb/monitors-lb.tf index ebeb84e..0422812 100644 --- a/cloud/gcp/lb/monitors-lb.tf +++ b/cloud/gcp/lb/monitors-lb.tf @@ -2,7 +2,7 @@ # 4XX Errors # resource "datadog_monitor" "error_rate_4xx" { - count = "${var.error_rate_4xx_enabled ? 1 : 0}" + count = "${var.error_rate_4xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP LB 4xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.error_rate_4xx_message, var.message)}" @@ -40,7 +40,7 @@ EOF # 5XX Errors # resource "datadog_monitor" "error_rate_5xx" { - count = "${var.error_rate_5xx_enabled ? 1 : 0}" + count = "${var.error_rate_5xx_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP LB 5xx errors {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.error_rate_5xx_message, var.message)}" @@ -78,7 +78,7 @@ EOF # Backend Latency for service # resource "datadog_monitor" "backend_latency_service" { - count = "${var.backend_latency_service_enabled ? 1 : 0}" + count = "${var.backend_latency_service_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP LB service backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.backend_latency_service_message, var.message)}" @@ -115,7 +115,7 @@ EOF # Backend Latency for bucket # resource "datadog_monitor" "backend_latency_bucket" { - count = "${var.backend_latency_bucket_enabled ? 1 : 0}" + count = "${var.backend_latency_bucket_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP LB bucket backend latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.backend_latency_bucket_message, var.message)}" @@ -152,7 +152,7 @@ EOF # Request Count # resource "datadog_monitor" "request_count" { - count = "${var.request_count_enabled ? 1 : 0}" + count = "${var.request_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP LB Requests count increased abruptly {{#is_alert}}{{value}}%{{/is_alert}}{{#is_warning}}{{value}}%{{/is_warning}}" message = "${coalesce(var.request_count_message, var.message)}" diff --git a/cloud/gcp/pubsub/monitors-pubsub.tf b/cloud/gcp/pubsub/monitors-pubsub.tf index 5ce6ea3..a364670 100644 --- a/cloud/gcp/pubsub/monitors-pubsub.tf +++ b/cloud/gcp/pubsub/monitors-pubsub.tf @@ -2,7 +2,7 @@ # Sending Operations Count # resource "datadog_monitor" "sending_operations_count" { - count = "${var.sending_operations_count_enabled ? 1 : 0}" + count = "${var.sending_operations_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP pubsub sending messages operations {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.sending_operations_count_message, var.message)}" @@ -38,7 +38,7 @@ EOF # Unavailable Sending Operations Count # resource "datadog_monitor" "unavailable_sending_operations_count" { - count = "${var.unavailable_sending_operations_count_enabled ? 1 : 0}" + count = "${var.unavailable_sending_operations_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] GCP pubsub sending messages with result unavailable {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.unavailable_sending_operations_count_message, var.message)}" diff --git a/database/elasticsearch/monitors-elasticsearch.tf b/database/elasticsearch/monitors-elasticsearch.tf index 947d44e..ecb599f 100644 --- a/database/elasticsearch/monitors-elasticsearch.tf +++ b/database/elasticsearch/monitors-elasticsearch.tf @@ -2,7 +2,7 @@ # Service Check # resource "datadog_monitor" "not_responding" { - count = "${var.not_responding_enabled ? 1 : 0}" + count = "${var.not_responding_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch does not respond" message = "${coalesce(var.not_responding_message, var.message)}" @@ -45,7 +45,7 @@ EOL # Cluster Status Not Green # resource "datadog_monitor" "cluster_status_not_green" { - count = "${var.cluster_status_not_green_enabled ? 1 : 0}" + count = "${var.cluster_status_not_green_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster status not green" message = "${coalesce(var.cluster_status_not_green_message, var.message)}" @@ -88,7 +88,7 @@ EOF # Cluster Initializing Shards # resource "datadog_monitor" "cluster_initializing_shards" { - count = "${var.cluster_initializing_shards_enabled ? 1 : 0}" + count = "${var.cluster_initializing_shards_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster is initializing shards" message = "${coalesce(var.cluster_initializing_shards_message, var.message)}" @@ -130,7 +130,7 @@ EOF # Cluster Relocating Shards # resource "datadog_monitor" "cluster_relocating_shards" { - count = "${var.cluster_relocating_shards_enabled ? 1 : 0}" + count = "${var.cluster_relocating_shards_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster is relocating shards" message = "${coalesce(var.cluster_relocating_shards_message, var.message)}" @@ -172,7 +172,7 @@ EOF # Cluster Unassigned Shards # resource "datadog_monitor" "cluster_unassigned_shards" { - count = "${var.cluster_unassigned_shards_enabled ? 1 : 0}" + count = "${var.cluster_unassigned_shards_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch Cluster has unassigned shards" message = "${coalesce(var.cluster_unassigned_shards_message, var.message)}" @@ -214,7 +214,7 @@ EOF # Free Space in nodes # resource "datadog_monitor" "node_free_space" { - count = "${var.node_free_space_enabled ? 1 : 0}" + count = "${var.node_free_space_enabled == "true" ? 1 : 0}" name = "[${var.environment}] ElasticSearch free space < 10%" message = "${coalesce(var.node_free_space_message, var.message)}" @@ -259,7 +259,7 @@ EOF # JVM Heap Memory Usage # resource "datadog_monitor" "jvm_heap_memory_usage" { - count = "${var.jvm_heap_memory_usage_enabled ? 1 : 0}" + count = "${var.jvm_heap_memory_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch JVM HEAP memory usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.jvm_heap_memory_usage_message, var.message)}" @@ -301,7 +301,7 @@ EOF # JVM Memory Young Usage # resource "datadog_monitor" "jvm_memory_young_usage" { - count = "${var.jvm_memory_young_usage_enabled ? 1 : 0}" + count = "${var.jvm_memory_young_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch JVM memory Young usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.jvm_memory_young_usage_message, var.message)}" @@ -343,7 +343,7 @@ EOF # JVM Memory Old Usage # resource "datadog_monitor" "jvm_memory_old_usage" { - count = "${var.jvm_memory_old_usage_enabled ? 1 : 0}" + count = "${var.jvm_memory_old_usage_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch JVM memory Old usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.jvm_memory_old_usage_message, var.message)}" @@ -385,7 +385,7 @@ EOF # JVM Garbace Collector Old Collection Latency # resource "datadog_monitor" "jvm_gc_old_collection_latency" { - count = "${var.jvm_gc_old_collection_latency_enabled ? 1 : 0}" + count = "${var.jvm_gc_old_collection_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch average Old-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.jvm_gc_old_collection_latency_message, var.message)}" @@ -427,7 +427,7 @@ EOF # JVM Garbace Collector Young Collection Latency # resource "datadog_monitor" "jvm_gc_young_collection_latency" { - count = "${var.jvm_gc_young_collection_latency_enabled ? 1 : 0}" + count = "${var.jvm_gc_young_collection_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch average Young-generation garbage collections latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.jvm_gc_young_collection_latency_message, var.message)}" @@ -469,7 +469,7 @@ EOF # Indexing Latency # resource "datadog_monitor" "indexing_latency" { - count = "${var.indexing_latency_enabled ? 1 : 0}" + count = "${var.indexing_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch average indexing time by document {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.indexing_latency_message, var.message)}" @@ -512,7 +512,7 @@ EOF # Flush Latency # resource "datadog_monitor" "flush_latency" { - count = "${var.flush_latency_enabled ? 1 : 0}" + count = "${var.flush_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch average index flushing to disk latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.flush_latency_message, var.message)}" @@ -555,7 +555,7 @@ EOF # Open HTTP Connections Anomaly # resource "datadog_monitor" "http_connections_anomaly" { - count = "${var.http_connections_anomaly_enabled ? 1 : 0}" + count = "${var.http_connections_anomaly_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch number of current open HTTP connections anomaly detected" message = "${coalesce(var.http_connections_anomaly_message, var.message)}" @@ -605,7 +605,7 @@ EOF # Query Latency # resource "datadog_monitor" "search_query_latency" { - count = "${var.search_query_latency_enabled ? 1 : 0}" + count = "${var.search_query_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch average search query latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.search_query_latency_message, var.message)}" @@ -648,7 +648,7 @@ EOF # Fetch Latency # resource "datadog_monitor" "fetch_latency" { - count = "${var.fetch_latency_enabled ? 1 : 0}" + count = "${var.fetch_latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch average search fetch latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}ms){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}ms){{/is_warning}}" message = "${coalesce(var.fetch_latency_message, var.message)}" @@ -691,7 +691,7 @@ EOF # Search Query Change # resource "datadog_monitor" "search_query_change" { - count = "${var.search_query_change_enabled ? 1 : 0}" + count = "${var.search_query_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of currently active queries" message = "${coalesce(var.search_query_change_message, var.message)}" @@ -733,7 +733,7 @@ EOF # Fetch Change # resource "datadog_monitor" "fetch_change" { - count = "${var.fetch_change_enabled ? 1 : 0}" + count = "${var.fetch_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of search fetches currently running" message = "${coalesce(var.fetch_change_message, var.message)}" @@ -775,7 +775,7 @@ EOF # Field Data Evictions # resource "datadog_monitor" "field_data_evictions_change" { - count = "${var.field_data_evictions_change_enabled ? 1 : 0}" + count = "${var.field_data_evictions_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the total number of evictions from the fielddata cache" message = "${coalesce(var.field_data_evictions_change_message, var.message)}" @@ -818,7 +818,7 @@ EOF # Query Cache Evictions # resource "datadog_monitor" "query_cache_evictions_change" { - count = "${var.query_cache_evictions_change_enabled ? 1 : 0}" + count = "${var.query_cache_evictions_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of query cache evictions" message = "${coalesce(var.query_cache_evictions_change_message, var.message)}" @@ -861,7 +861,7 @@ EOF # Request Cache Evictions # resource "datadog_monitor" "request_cache_evictions_change" { - count = "${var.request_cache_evictions_change_enabled ? 1 : 0}" + count = "${var.request_cache_evictions_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the number of request cache evictions" message = "${coalesce(var.request_cache_evictions_change_message, var.message)}" @@ -904,7 +904,7 @@ EOF # Task Time in Queue # resource "datadog_monitor" "task_time_in_queue_change" { - count = "${var.task_time_in_queue_change_enabled ? 1 : 0}" + count = "${var.task_time_in_queue_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Elasticsearch change alert on the average time spent by tasks in the queue" message = "${coalesce(var.task_time_in_queue_change_message, var.message)}" diff --git a/database/mongodb/monitors-mongo.tf b/database/mongodb/monitors-mongo.tf index 9d897f0..992a042 100644 --- a/database/mongodb/monitors-mongo.tf +++ b/database/mongodb/monitors-mongo.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "mongodb_primary" { - count = "${var.mongodb_primary_enabled ? 1 : 0}" + count = "${var.mongodb_primary_enabled == "true" ? 1 : 0}" name = "[${var.environment}] MongoDB primary state" message = "${coalesce(var.mongodb_primary_message, var.message)}" @@ -25,7 +25,7 @@ resource "datadog_monitor" "mongodb_primary" { } resource "datadog_monitor" "mongodb_secondary" { - count = "${var.mongodb_secondary_enabled ? 1 : 0}" + count = "${var.mongodb_secondary_enabled == "true" ? 1 : 0}" name = "[${var.environment}] MongoDB secondary missing" message = "${coalesce(var.mongodb_secondary_message, var.message)}" @@ -58,7 +58,7 @@ resource "datadog_monitor" "mongodb_secondary" { } resource "datadog_monitor" "mongodb_server_count" { - count = "${var.mongodb_server_count_enabled ? 1 : 0}" + count = "${var.mongodb_server_count_enabled == "true" ? 1 : 0}" name = "[${var.environment}] MongoDB too much servers or wrong monitoring config" message = "${coalesce(var.mongodb_server_count_message, var.message)}" @@ -90,7 +90,7 @@ resource "datadog_monitor" "mongodb_server_count" { } resource "datadog_monitor" "mongodb_replication" { - count = "${var.mongodb_replication_enabled ? 1 : 0}" + count = "${var.mongodb_replication_enabled == "true" ? 1 : 0}" name = "[${var.environment}] MongoDB replication lag" message = "${coalesce(var.mongodb_replication_message, var.message)}" diff --git a/database/mysql/monitors-mysql.tf b/database/mysql/monitors-mysql.tf index 1e8f5d0..acbe571 100644 --- a/database/mysql/monitors-mysql.tf +++ b/database/mysql/monitors-mysql.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "mysql_availability" { - count = "${var.mysql_availability_enabled ? 1 : 0}" + count = "${var.mysql_availability_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql server does not respond" message = "${coalesce(var.mysql_availability_message, var.message)}" @@ -30,7 +30,7 @@ resource "datadog_monitor" "mysql_availability" { } resource "datadog_monitor" "mysql_connection" { - count = "${var.mysql_connection_enabled ? 1 : 0}" + count = "${var.mysql_connection_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Connections limit {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_connection_message, var.message)}" type = "metric alert" @@ -62,7 +62,7 @@ resource "datadog_monitor" "mysql_connection" { } resource "datadog_monitor" "mysql_aborted" { - count = "${var.mysql_aborted_enabled ? 1 : 0}" + count = "${var.mysql_aborted_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Aborted connects {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_aborted_message, var.message)}" type = "metric alert" @@ -94,7 +94,7 @@ resource "datadog_monitor" "mysql_aborted" { } resource "datadog_monitor" "mysql_slow" { - count = "${var.mysql_slow_enabled ? 1 : 0}" + count = "${var.mysql_slow_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Slow queries {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mysql_slow_message, var.message)}" type = "metric alert" @@ -126,7 +126,7 @@ resource "datadog_monitor" "mysql_slow" { } resource "datadog_monitor" "mysql_pool_efficiency" { - count = "${var.mysql_pool_efficiency_enabled ? 1 : 0}" + count = "${var.mysql_pool_efficiency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Innodb buffer pool efficiency {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.mysql_pool_efficiency_message, var.message)}" type = "metric alert" @@ -158,7 +158,7 @@ resource "datadog_monitor" "mysql_pool_efficiency" { } resource "datadog_monitor" "mysql_pool_utilization" { - count = "${var.mysql_pool_utilization_enabled ? 1 : 0}" + count = "${var.mysql_pool_utilization_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql Innodb buffer pool utilization {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.mysql_pool_utilization_message, var.message)}" type = "metric alert" @@ -191,7 +191,7 @@ resource "datadog_monitor" "mysql_pool_utilization" { } resource "datadog_monitor" "mysql_threads_anomaly" { - count = "${var.mysql_threads_enabled ? 1 : 0}" + count = "${var.mysql_threads_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql threads changed abnormally" message = "${coalesce(var.mysql_threads_message, var.message)}" type = "metric alert" @@ -231,7 +231,7 @@ resource "datadog_monitor" "mysql_threads_anomaly" { } resource "datadog_monitor" "mysql_questions_anomaly" { - count = "${var.mysql_questions_enabled ? 1 : 0}" + count = "${var.mysql_questions_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Mysql queries changed abnormally" message = "${coalesce(var.mysql_questions_message, var.message)}" type = "metric alert" diff --git a/database/postgresql/monitors-postgresql.tf b/database/postgresql/monitors-postgresql.tf index a7f61ab..f18b7a8 100644 --- a/database/postgresql/monitors-postgresql.tf +++ b/database/postgresql/monitors-postgresql.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "postgresql_availability" { - count = "${var.postgresql_availability_enabled ? 1 : 0}" + count = "${var.postgresql_availability_enabled == "true" ? 1 : 0}" name = "[${var.environment}] PostgreSQL server does not respond" message = "${coalesce(var.postgresql_availability_message, var.message)}" @@ -30,7 +30,7 @@ resource "datadog_monitor" "postgresql_availability" { } resource "datadog_monitor" "postgresql_connection_too_high" { - count = "${var.postgresql_connection_enabled ? 1 : 0}" + count = "${var.postgresql_connection_enabled == "true" ? 1 : 0}" name = "[${var.environment}] PostgreSQL Connections {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.postgresql_connection_message, var.message)}" type = "metric alert" @@ -61,7 +61,7 @@ resource "datadog_monitor" "postgresql_connection_too_high" { } resource "datadog_monitor" "postgresql_too_many_locks" { - count = "${var.postgresql_lock_enabled ? 1 : 0}" + count = "${var.postgresql_lock_enabled == "true" ? 1 : 0}" name = "[${var.environment}] PostgreSQL too many locks {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.postgresql_lock_message, var.message)}" type = "metric alert" diff --git a/database/redis/monitors-redis.tf b/database/redis/monitors-redis.tf index 5a4d87a..e948467 100644 --- a/database/redis/monitors-redis.tf +++ b/database/redis/monitors-redis.tf @@ -2,7 +2,7 @@ # Service Check # resource "datadog_monitor" "not_responding" { - count = "${var.not_responding_enabled ? 1 : 0}" + count = "${var.not_responding_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis does not respond" message = "${coalesce(var.not_responding_message, var.message)}" @@ -34,7 +34,7 @@ resource "datadog_monitor" "not_responding" { } resource "datadog_monitor" "evicted_keys" { - count = "${var.evictedkeys_change_enabled ? 1 : 0}" + count = "${var.evictedkeys_change_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis evicted keys {{#is_alert}}{{{comparator}}} {{threshold}}% (+{{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% (+{{value}}%){{/is_warning}}" message = "${coalesce(var.evictedkeys_change_message, var.message)}" @@ -67,7 +67,7 @@ EOL } resource "datadog_monitor" "expirations" { - count = "${var.expirations_rate_enabled ? 1 : 0}" + count = "${var.expirations_rate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis expired keys {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.expirations_rate_message, var.message)}" @@ -100,7 +100,7 @@ EOL } resource "datadog_monitor" "blocked_clients" { - count = "${var.blocked_clients_enabled ? 1 : 0}" + count = "${var.blocked_clients_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis blocked clients {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.blocked_clients_message, var.message)}" @@ -134,7 +134,7 @@ EOL } resource "datadog_monitor" "keyspace_full" { - count = "${var.keyspace_enabled ? 1 : 0}" + count = "${var.keyspace_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis keyspace seems full (no changes since ${var.keyspace_timeframe})" message = "${coalesce(var.keyspace_message, var.message)}" @@ -167,7 +167,7 @@ EOL } resource "datadog_monitor" "memory_used" { - count = "${var.mem_used_enabled ? 1 : 0}" + count = "${var.mem_used_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis memory used {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mem_used_message, var.message)}" @@ -201,7 +201,7 @@ EOL } resource "datadog_monitor" "memory_frag" { - count = "${var.mem_frag_enabled ? 1 : 0}" + count = "${var.mem_frag_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis memory fragmented {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.mem_frag_message, var.message)}" @@ -234,7 +234,7 @@ EOL } resource "datadog_monitor" "rejected_connections" { - count = "${var.rejected_con_enabled ? 1 : 0}" + count = "${var.rejected_con_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis rejected connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.rejected_con_message, var.message)}" @@ -267,7 +267,7 @@ EOL } resource "datadog_monitor" "latency" { - count = "${var.latency_enabled ? 1 : 0}" + count = "${var.latency_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis latency {{#is_alert}}{{{comparator}}} {{threshold}}ms ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}ms ({{value}}){{/is_warning}}" message = "${coalesce(var.latency_message, var.message)}" @@ -300,7 +300,7 @@ EOL } resource "datadog_monitor" "hitrate" { - count = "${var.hitrate_enabled ? 1 : 0}" + count = "${var.hitrate_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Redis hitrate {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.hitrate_message, var.message)}" diff --git a/middleware/apache/monitors-apache.tf b/middleware/apache/monitors-apache.tf index 1404dea..ada61a6 100644 --- a/middleware/apache/monitors-apache.tf +++ b/middleware/apache/monitors-apache.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "datadog_apache_process" { - count = "${var.apache_connect_enabled ? 1 : 0}" + count = "${var.apache_connect_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Apache vhost status does not respond" message = "${coalesce(var.apache_connect_message, var.message)}" diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index 441c975..0b37b74 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "datadog_nginx_process" { - count = "${var.nginx_connect_enabled ? 1 : 0}" + count = "${var.nginx_connect_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Nginx vhost status does not respond" message = "${coalesce(var.nginx_connect_message, var.message)}" @@ -30,7 +30,7 @@ resource "datadog_monitor" "datadog_nginx_process" { } resource "datadog_monitor" "datadog_nginx_dropped_connections" { - count = "${var.nginx_dropped_enabled ? 1 : 0}" + count = "${var.nginx_dropped_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Nginx dropped connections {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.nginx_dropped_message, var.message)}" diff --git a/middleware/php-fpm/monitors-fpm.tf b/middleware/php-fpm/monitors-fpm.tf index 8e314c5..f23845c 100644 --- a/middleware/php-fpm/monitors-fpm.tf +++ b/middleware/php-fpm/monitors-fpm.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "php_fpm_connect" { - count = "${var.php_fpm_connect_enabled ? 1 : 0}" + count = "${var.php_fpm_connect_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Php-fpm ping url does not respond" message = "${coalesce(var.php_fpm_connect_message, var.message)}" @@ -30,7 +30,7 @@ resource "datadog_monitor" "php_fpm_connect" { } resource "datadog_monitor" "php_fpm_connect_idle" { - count = "${var.php_fpm_busy_enabled ? 1 : 0}" + count = "${var.php_fpm_busy_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Php-fpm busy worker {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.php_fpm_busy_message, var.message)}" diff --git a/system/generic/monitors-system.tf b/system/generic/monitors-system.tf index 9a15c14..ab528f4 100644 --- a/system/generic/monitors-system.tf +++ b/system/generic/monitors-system.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "cpu" { - count = "${var.cpu_enabled ? 1 : 0}" + count = "${var.cpu_enabled == "true" ? 1 : 0}" name = "[${var.environment}] CPU usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.cpu_message, var.message)}" @@ -31,7 +31,7 @@ resource "datadog_monitor" "cpu" { } resource "datadog_monitor" "load" { - count = "${var.load_enabled ? 1 : 0}" + count = "${var.load_enabled == "true" ? 1 : 0}" name = "[${var.environment}] CPU load 5 ratio {{#is_alert}}{{{comparator}}} {{threshold}} ({{value}}){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}} ({{value}}){{/is_warning}}" message = "${coalesce(var.load_message, var.message)}" @@ -63,7 +63,7 @@ resource "datadog_monitor" "load" { } resource "datadog_monitor" "disk_space" { - count = "${var.disk_space_enabled ? 1 : 0}" + count = "${var.disk_space_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Disk space usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_space_message, var.message)}" @@ -95,7 +95,7 @@ resource "datadog_monitor" "disk_space" { } resource "datadog_monitor" "disk_space_forecast" { - count = "${var.disk_space_forecast_enabled ? 1 : 0}" + count = "${var.disk_space_forecast_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Disk Space usage could reach {{#is_alert}}{{threshold}}%{{/is_alert}} in a near future" message = "${coalesce(var.disk_space_forecast_message, var.message)}" @@ -135,7 +135,7 @@ resource "datadog_monitor" "disk_space_forecast" { } resource "datadog_monitor" "disk_inodes" { - count = "${var.disk_inodes_enabled ? 1 : 0}" + count = "${var.disk_inodes_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Disk inodes usage {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${coalesce(var.disk_inodes_message, var.message)}" @@ -167,7 +167,7 @@ resource "datadog_monitor" "disk_inodes" { } resource "datadog_monitor" "memory" { - count = "${var.memory_enabled ? 1 : 0}" + count = "${var.memory_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Usable Memory {{#is_alert}}{{{comparator}}} {{threshold}}% ({{value}}%){{/is_alert}}{{#is_warning}}{{{comparator}}} {{warn_threshold}}% ({{value}}%){{/is_warning}}" message = "${var.memory_message}" diff --git a/system/unreachable/monitors-unreachable.tf b/system/unreachable/monitors-unreachable.tf index 9f1699a..8621c00 100644 --- a/system/unreachable/monitors-unreachable.tf +++ b/system/unreachable/monitors-unreachable.tf @@ -1,5 +1,5 @@ resource "datadog_monitor" "host_unreachable" { - count = "${var.unreachable_enabled ? 1 : 0}" + count = "${var.unreachable_enabled == "true" ? 1 : 0}" name = "[${var.environment}] Host unreachable" message = "${coalesce(var.unreachable_message, var.message)}"