# CLOUD AWS ECS EC2-CLUSTER DataDog monitors
## How to use this module
```hcl
module "datadog-monitors-cloud-aws-ecs-ec2-cluster" {
source = "claranet/monitors/datadog//cloud/aws/ecs/ec2-cluster"
version = "{revision}"
environment = var.environment
message = module.datadog-message-alerting.alerting-message
}
```
## Purpose
Creates DataDog monitors with the following checks:
- ECS Agent disconnected
- ECS Cluster CPU Utilization High (disabled by default)
- ECS Cluster Memory Reservation High (disabled by default)
## Requirements
| Name | Version |
|------|---------|
| [terraform](#requirement\_terraform) | >= 0.12.31 |
| [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| [filter-tags](#module\_filter-tags) | ../../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.cluster_cpu_utilization](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.cluster_memory_reservation](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ecs_agent_status](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| [agent\_status\_enabled](#input\_agent\_status\_enabled) | Flag to enable Agent Status monitor | `string` | `"true"` | no |
| [agent\_status\_extra\_tags](#input\_agent\_status\_extra\_tags) | Extra tags for Agent Status monitor | `list(string)` | `[]` | no |
| [agent\_status\_message](#input\_agent\_status\_message) | Custom message for the Agent Status monitor | `string` | `""` | no |
| [agent\_status\_no\_data\_timeframe](#input\_agent\_status\_no\_data\_timeframe) | Agent status does not respond monitor no data timeframe | `string` | `10` | no |
| [agent\_status\_threshold\_warning](#input\_agent\_status\_threshold\_warning) | Warning threshold for the Agent Status monitor | `string` | `3` | no |
| [cluster\_cpu\_utilization\_enabled](#input\_cluster\_cpu\_utilization\_enabled) | Flag to enable Cluster CPU utilization monitor | `string` | `"false"` | no |
| [cluster\_cpu\_utilization\_extra\_tags](#input\_cluster\_cpu\_utilization\_extra\_tags) | Extra tags for Cluster CPU utilization monitor | `list(string)` | `[]` | no |
| [cluster\_cpu\_utilization\_message](#input\_cluster\_cpu\_utilization\_message) | Custom message for the Cluster CPU Utilization monitor | `string` | `""` | no |
| [cluster\_cpu\_utilization\_threshold\_critical](#input\_cluster\_cpu\_utilization\_threshold\_critical) | Critical threshold for the Cluster CPU Utilization monitor | `string` | `90` | no |
| [cluster\_cpu\_utilization\_threshold\_warning](#input\_cluster\_cpu\_utilization\_threshold\_warning) | Warning threshold for the Cluster CPU Utilization monitor | `string` | `85` | no |
| [cluster\_cpu\_utilization\_time\_aggregator](#input\_cluster\_cpu\_utilization\_time\_aggregator) | Monitor aggregator for Cluster CPU Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| [cluster\_cpu\_utilization\_timeframe](#input\_cluster\_cpu\_utilization\_timeframe) | Timeframe for the Cluster CPU Utilization monitor | `string` | `"last_5m"` | no |
| [cluster\_memory\_reservation\_enabled](#input\_cluster\_memory\_reservation\_enabled) | Flag to enable Cluster memory reservation monitor | `string` | `"false"` | no |
| [cluster\_memory\_reservation\_extra\_tags](#input\_cluster\_memory\_reservation\_extra\_tags) | Extra tags for Cluster Memory Reservation monitor | `list(string)` | `[]` | no |
| [cluster\_memory\_reservation\_message](#input\_cluster\_memory\_reservation\_message) | Custom message for the Cluster Memory Reservation monitor | `string` | `""` | no |
| [cluster\_memory\_reservation\_threshold\_critical](#input\_cluster\_memory\_reservation\_threshold\_critical) | Critical threshold for the Cluster Memory Reservation monitor | `string` | `90` | no |
| [cluster\_memory\_reservation\_threshold\_warning](#input\_cluster\_memory\_reservation\_threshold\_warning) | Warning threshold for the Cluster Memory Reservation monitor | `string` | `85` | no |
| [cluster\_memory\_reservation\_time\_aggregator](#input\_cluster\_memory\_reservation\_time\_aggregator) | Monitor aggregator for Cluster Memory Reservation [available values: min, max or avg] | `string` | `"min"` | no |
| [cluster\_memory\_reservation\_timeframe](#input\_cluster\_memory\_reservation\_timeframe) | Timeframe for the Cluster Memory Reservation monitor | `string` | `"last_5m"` | no |
| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes |
| [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no |
| [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| [cluster\_cpu\_utilization\_id](#output\_cluster\_cpu\_utilization\_id) | id for monitor cluster\_cpu\_utilization |
| [cluster\_memory\_reservation\_id](#output\_cluster\_memory\_reservation\_id) | id for monitor cluster\_memory\_reservation |
| [ecs\_agent\_status\_id](#output\_ecs\_agent\_status\_id) | id for monitor ecs\_agent\_status |
## Related documentation