From 83b66ef3dfba821bcaf8567cbba5e18fa7f5c241 Mon Sep 17 00:00:00 2001 From: Quentin Manfroi Date: Thu, 27 Sep 2018 17:26:41 +0200 Subject: [PATCH] MON-316 auto update --- cloud/azure/serverfarms/README.md | 61 ++++++++++++++ cloud/azure/serverfarms/modules.tf | 2 +- .../serverfarms/monitor-azure-serverfarms.tf | 83 ------------------- cloud/azure/serverfarms/outputs.tf | 1 - 4 files changed, 62 insertions(+), 85 deletions(-) create mode 100644 cloud/azure/serverfarms/README.md delete mode 100644 cloud/azure/serverfarms/monitor-azure-serverfarms.tf diff --git a/cloud/azure/serverfarms/README.md b/cloud/azure/serverfarms/README.md new file mode 100644 index 0000000..3c3b6c8 --- /dev/null +++ b/cloud/azure/serverfarms/README.md @@ -0,0 +1,61 @@ +# CLOUD AZURE SERVERFARMS DataDog monitors + +## How to use this module + +``` +module "datadog-monitors-cloud-azure-serverfarms" { + source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//cloud/azure/serverfarms?ref={revision}" + + environment = "${var.environment}" + message = "${module.datadog-message-alerting.alerting-message}" +} + +``` + +## Purpose + +Creates DataDog monitors with the following checks: + +- Serverfarm {{name}} CPU percentage is too high +- Serverfarm {{name}} CPU percentage is too high +- Serverfarm {{name}} is down + +## Inputs + +| Name | Description | Type | Default | Required | +|------|-------------|:----:|:-----:|:-----:| +| cpu_percentage_enabled | Flag to enable the serverfarms cpu_percentage monitor | string | `true` | no | +| cpu_percentage_extra_tags | Extra tags for Redis cpu_percentage monitor | list | `[]` | no | +| cpu_percentage_message | Custom message for serverfarm cpu_percentage monitor | string | - | yes | +| cpu_percentage_silenced | Groups to mute for serverfarm cpu_percentage monitor | map | `{}` | no | +| cpu_percentage_time_aggregator | Monitor aggregator for serverfarms cpu_percentage [available values: min, max or avg] | string | `max` | no | +| cpu_percentage_timeframe | Monitor timeframe for serverfarms cpu_percentage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| environment | Architecture environment | string | - | yes | +| evaluation_delay | Delay in seconds for the metric evaluation | string | `900` | no | +| filter_tags_custom | Tags used for custom filtering when filter_tags_use_defaults is false | string | `*` | no | +| filter_tags_use_defaults | Use default filter tags convention | string | `true` | no | +| memory_percentage_enabled | Flag to enable the serverfarms memory_percentage monitor | string | `true` | no | +| memory_percentage_extra_tags | Extra tags for Redis memory_percentage monitor | list | `[]` | no | +| memory_percentage_message | Custom message for serverfarm memory_percentage monitor | string | - | yes | +| memory_percentage_silenced | Groups to mute for serverfarm memory_percentage monitor | map | `{}` | no | +| memory_percentage_time_aggregator | Monitor aggregator for serverfarms memory_percentage [available values: min, max or avg] | string | `max` | no | +| memory_percentage_timeframe | Monitor timeframe for serverfarms memory_percentage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | +| message | Message sent when a Redis monitor is triggered | string | - | yes | +| new_host_delay | Delay in seconds before monitor new resource | string | `300` | no | +| status_enabled | Flag to enable the serverfarms status monitor | string | `true` | no | +| status_extra_tags | Extra tags for Redis status monitor | list | `[]` | no | +| status_message | Custom message for serverfarm status monitor | string | - | yes | +| status_silenced | Groups to mute for serverfarm status monitor | map | `{}` | no | +| status_time_aggregator | Monitor aggregator for serverfarms status [available values: min, max or avg] | string | `max` | no | +| status_timeframe | Monitor timeframe for serverfarms status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | string | `last_5m` | no | + +## Outputs + +| Name | Description | +|------|-------------| +| cpu_percentage_id | id for monitor cpu_percentage | +| memory_percentage_id | id for monitor memory_percentage | +| status_id | id for monitor status | + +## Related documentation + diff --git a/cloud/azure/serverfarms/modules.tf b/cloud/azure/serverfarms/modules.tf index 3817b54..d09e425 100644 --- a/cloud/azure/serverfarms/modules.tf +++ b/cloud/azure/serverfarms/modules.tf @@ -2,7 +2,7 @@ module "filter-tags" { source = "../../../common/filter-tags" environment = "${var.environment}" - resource = "redis" + resource = "serverfarms" filter_tags_use_defaults = "${var.filter_tags_use_defaults}" filter_tags_custom = "${var.filter_tags_custom}" } diff --git a/cloud/azure/serverfarms/monitor-azure-serverfarms.tf b/cloud/azure/serverfarms/monitor-azure-serverfarms.tf deleted file mode 100644 index 19663bf..0000000 --- a/cloud/azure/serverfarms/monitor-azure-serverfarms.tf +++ /dev/null @@ -1,83 +0,0 @@ -resource "datadog_monitor" "status" { - count = "${var.status_enabled ? 1 : 0}" - name = "[${var.environment} Serverfarm {{name}} is down]" - message = "${coalesce(var.status_message, var.message)}" - - query = <