Compare commits

...

10 Commits

Author SHA1 Message Date
553f03285a
Initial commit with README and module files
Some checks failed
Monitors / pre_job (push) Successful in 14s
Monitors / check (push) Failing after 1m30s
2025-11-01 10:43:48 +01:00
Quentin Manfroi
518c7ed71b
always run CI 2021-06-25 18:07:36 +02:00
Quentin Manfroi
85d063c021
prepare v4.0.1 2021-06-25 18:06:24 +02:00
Quentin Manfroi
7432d41602
add minimal ci for github (#9) 2021-06-25 18:04:04 +02:00
Quentin Manfroi
89102fbb1f
fix closing resources for azure storage monitors (#7) 2021-06-25 11:33:40 +02:00
David Drugeon-Hamon
c3f050f9dc
fix: Syntax error on Zookeeper and Solr monitors (#6) 2021-06-25 11:21:00 +02:00
Quentin Manfroi
42a5abf707
define code owners (#5) 2021-06-23 17:11:07 +02:00
Quentin Manfroi
b8119aef2b
support for datadog provider v3 (#3)
Co-authored-by: Patrick Decat <pdecat@gmail.com>
2021-06-22 14:47:02 +02:00
Quentin Manfroi
06cea640c2 Merge branch 'Add_K8S_cluster_name_pod_monitors' into 'master'
MN-589 "Add_K8S cluster name pod monitors"

See merge request claranet/projects/monitoring/datadog/terraform/monitors!183
2021-02-18 15:34:45 +00:00
Matthieu Bourgain
048bd802e7 MN-589 "Add_K8S cluster name pod monitors" 2021-02-18 16:34:45 +01:00
494 changed files with 5758 additions and 5358 deletions

1
.github/CODEOWNERS vendored Executable file
View File

@ -0,0 +1 @@
* @jphilaine @pygillier @Aohzan @NSenaud

58
.github/workflows/main.yml vendored Executable file
View File

@ -0,0 +1,58 @@
# This is a basic workflow to help you get started with Actions
name: Monitors
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on: [push, pull_request]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
pre_job:
# continue-on-error: true # Uncomment once integration is finished
runs-on: ubuntu-latest
# Map a step output to a job output
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
name: Skip Duplicate Actions
uses: fkirc/skip-duplicate-actions@v3.4.0
with:
concurrent_skipping: 'same_content'
do_not_skip: '["pull_request", "workflow_dispatch", "schedule"]'
check:
# The type of runner that the job will run on
needs: pre_job
if: ${{ needs.pre_job.outputs.should_skip != 'true' }}
#runs-on: hashicorp/terraform:full
runs-on: ubuntu-latest
container:
image: "claranet/terraform-ci:1.0.1"
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- name: Checkout
uses: actions/checkout@v2
with:
submodules: recursive
- name: Setup Terraform
uses: hashicorp/setup-terraform@v1
with:
terraform_version: 1.0.1
terraform_wrapper: false
- name: Run auto update
run: ./scripts/auto_update.sh
- name: Check git diff
run: ./scripts/auto_update.sh
- name: Run auto update
run: ./scripts/auto_update.sh
- name: Check for changes
run: git diff --exit-code

2
.gitignore vendored Normal file → Executable file
View File

@ -1,3 +1,5 @@
.terraform
terraform.tfvars
/.env.sh
.idea
**/.terraform.lock.hcl

View File

@ -1,44 +0,0 @@
image: alpine:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
stages:
- test
- build
- deploy
auto_update:
image: claranet/terraform-ci:0.13.1
stage: test
script:
- ./scripts/auto_update.sh
- git status
- git diff --exit-code
tags:
- ops4ops-claranet
deploy_terraform:
stage: deploy
script:
- apk update
- apk add --no-cache curl
- "curl -X POST -F token=${TEMPLATES_GITLAB_TOKEN} -F ref=${TEMPLATES_GITLAB_BRANCH:-master} -F \"variables[SCENARIO]=test\" ${CI_API_V4_URL}/projects/${TEMPLATES_GITLAB_ID}/trigger/pipeline"
only:
- master
tags:
- ops4ops-claranet
build_template:
stage: build
script:
- apk update
- apk add --no-cache curl
- "curl -X POST -F token=${TEMPLATES_GITLAB_TOKEN} -F ref=${TEMPLATES_GITLAB_BRANCH:-master} -F \"variables[SCENARIO]=build\" -F \"variables[TAG]=$CI_COMMIT_TAG\" ${CI_API_V4_URL}/projects/${TEMPLATES_GITLAB_ID}/trigger/pipeline"
only:
- tags
except:
- branches
tags:
- ops4ops-claranet

0
.gitmodules vendored Normal file → Executable file
View File

0
.terraform-version Normal file → Executable file
View File

4
CHANGELOG.md Normal file → Executable file
View File

@ -1,3 +1,7 @@
# v4+
See [Github releases](https://github.com/claranet/terraform-datadog-monitors/releases) for versions `>= v4.0.0`.
# v3.6.0 (January 27, 2021)
## Improvement

0
CONTRIBUTING.md Normal file → Executable file
View File

0
LICENSE Normal file → Executable file
View File

0
NOTICE Normal file → Executable file
View File

484
README.md Normal file → Executable file
View File

@ -1,239 +1,335 @@
# DataDog Monitors
[![Changelog](https://img.shields.io/badge/changelog-release-green.svg)](CHANGELOG.md) [![Notice](https://img.shields.io/badge/notice-copyright-yellow.svg)](NOTICE) [![Apache V2 License](http://img.shields.io/badge/license-Apache%20V2-blue.svg)](LICENSE) [![ ](https://git.fr.clara.net/claranet/pt-monitoring/projects/datadog/terraform/monitors/badges/master/pipeline.svg)](https://git.fr.clara.net/claranet/pt-monitoring/projects/datadog/terraform/monitors/commits/master)
# Terraform Datadog Old Monitors Module
This repository aims to provide a base of generic and pre configured monitors for [Datadog](https://www.datadoghq.com/) templated thanks to [Terraform](https://www.terraform.io/) and the [Datadog Provider](https://github.com/terraform-providers/terraform-provider-datadog).
## Overview
## Important notes
This is a comprehensive, enterprise-ready monitoring module repository (based on Claranet's Datadog monitors repository) with pre-configured monitors for various infrastructure components including middleware, databases, cloud services, and container platforms.
* This repository provide multiple Terraform modules which could be imported, you must choose the one(s) you need.
* Each of these modules contains the most commons monitors, but they probably do not fulfill all your needs.
* You still can create some specific DataDog monitors after importing a module, it's even advisable to complete your needs.
* You will find a complete `README.md` on each module, explaining how to use it and its specificities if there.
* The `alerting-message` module could be used to easily generate a templating message to re-use and could be used multiple times to suit different use cases.
* Some monitors are disabled by default because not generic or "plug and play" enough, if you use them you will need to tweak them or in some cases disabled another one which could "duplicate" the check.
## Features
## Getting started
- **Enterprise Monitoring Templates**: Production-ready monitor configurations
- **Multi-Platform Support**: AWS, Azure, GCP cloud providers
- **Component Coverage**: Middleware, databases, containers, networking
- **Flexible Configuration**: Extensive customization options
- **Best Practices**: Based on industry standards and real-world deployments
### Terraform
## Structure
Here is the minimum version required to use these modules of integrations.
This module contains multiple sub-modules organized by component type:
```
terraform {
required_version = ">= 0.12.26"
terraform-datadog-old-monitors/
├── middleware/ # Nginx, Kong, Apache, PHP-FPM
├── database/ # PostgreSQL, MySQL, Redis, MongoDB, etc.
├── system/ # Generic system and unreachable monitors
├── network/ # HTTP, DNS, TLS monitoring
├── cloud/ # AWS, Azure, GCP specific monitors
│ ├── aws/ # ECS, RDS, Lambda, ALB, etc.
│ ├── azure/ # App Services, Functions, SQL, etc.
│ └── gcp/ # Compute, Cloud SQL, Pub/Sub, etc.
├── caas/ # Docker, Kubernetes monitoring
└── common/ # Shared alerting and filtering modules
```
## Requirements
| Name | Version |
|------|---------|
| terraform | >= 0.12 |
| datadog | >= 2.0 |
## Usage
### Basic Monitor Configuration
```hcl
module "nginx_monitor" {
source = "./terraform-datadog-old-monitors/middleware/nginx"
environment = "production"
message = "Nginx issue detected @slack-channel"
evaluation_delay = 15
new_host_delay = 300
# Enable/disable specific monitors
nginx_connect_enabled = "true"
nginx_dropped_enabled = "true"
# Customize thresholds
nginx_dropped_connections_critical = 5
nginx_dropped_connections_warning = 3
}
```
Note: terraform 0.12.26+ is required as it the first version compatible with, but ignoring, the `source` argument for provider requirements introduced in terraform 0.13.0.
### AWS RDS Monitoring
### DataDog provider
```hcl
module "rds_monitor" {
source = "./terraform-datadog-old-monitors/cloud/aws/rds/common"
Here is the last tester terraform provider version for datadog but next versions should work too.
```
provider "datadog" {
version = "2.6.0" # last tested working version
api_key = var.datadog_api_key
app_key = var.datadog_app_key
environment = "production"
message = "RDS alert @pagerduty"
# CPU monitoring
cpu_enabled = "true"
cpu_critical = 90
cpu_warning = 75
# Disk monitoring
disk_space_enabled = "true"
disk_space_critical = 90
disk_space_warning = 80
}
```
Both of the `datadog_api_key` and `datadog_app_key` are unique to the each datadog account. You can define them in `terraform.tfvars` file:
### Kubernetes Monitoring
```
datadog_api_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
datadog_app_key = "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
```hcl
module "k8s_pod_monitor" {
source = "./terraform-datadog-old-monitors/caas/kubernetes/pod"
environment = "production"
message = "Kubernetes pod issue @slack-ops"
pod_crash_enabled = "true"
pod_not_running_enabled = "true"
container_restart_enabled = "true"
}
```
### Variables
## Common Variables
Some variables need to be declared.
Most sub-modules share these common variables:
```
variable "environment" {
type = string
default = "dev"
}
| Name | Description | Type | Default |
|------|-------------|------|---------|
| `environment` | Architecture environment | `string` | Required |
| `message` | Alert message with notification channels | `string` | Required |
| `evaluation_delay` | Metric evaluation delay (seconds) | `number` | `15` |
| `new_host_delay` | Delay before monitoring new resources | `number` | `300` |
| `prefix_slug` | Prefix for monitor names | `string` | `""` |
| `notify_no_data` | Alert on no data | `bool` | `true` |
| `filter_tags_use_defaults` | Use default filter convention | `bool` | `true` |
| `filter_tags_custom` | Custom filter tags | `string` | `""` |
variable "datadog_api_key" {
type = string
}
## Available Monitor Types
variable "datadog_app_key" {
type = string
}
### Middleware Monitors
```
- **Nginx**: Connection, dropped connections, workers
- **Apache**: Server status, connections
- **Kong**: API gateway health and performance
- **PHP-FPM**: Pool status, slow requests
### Modules declaration example
### Database Monitors
A quick example of alerting message module declaration:
- **PostgreSQL**: Connections, replication lag, locks
- **MySQL**: Connections, slow queries, replication
- **Redis**: Memory, connections, evictions
- **MongoDB**: Connections, replication lag, operations
- **Elasticsearch**: Cluster health, JVM heap
- **SQL Server**: Connections, locks, performance
```
locals {
oncall_24x7 = "@pagerduty-MyPagerService_NBH"
oncall_office_hours = "@pagerduty-MyPagerService_BH"
}
### Cloud Services
module "datadog-message-alerting" {
source = "claranet/monitors/datadog//common/alerting-message"
version = "{revision}"
#### AWS
- RDS (Aurora PostgreSQL, Aurora MySQL, common)
- EC2 / ECS (Fargate, EC2 cluster)
- Lambda
- ALB / ELB / NLB
- ElastiCache (Redis, Memcached)
- SQS
- API Gateway
- Elasticsearch
message_alert = local.oncall_24x7
message_warning = local.oncall_office_hours
message_nodata = local.oncall_24x7
}
#### Azure
- App Services
- Functions
- SQL Database / Elastic Pool
- PostgreSQL
- Storage
- Key Vault
- Event Hub
- Service Bus
module "datadog-message-alerting-bh-only" {
source = "claranet/monitors/datadog//common/alerting-message"
version = "{revision}"
#### GCP
- Compute Engine
- Cloud SQL (MySQL, common)
- Pub/Sub (topics, subscriptions)
- Load Balancer
- Memorystore Redis
message_alert = local.oncall_office_hours
message_warning = local.oncall_office_hours
message_nodata = local.oncall_office_hours
}
### Container Platforms
module "datadog-monitors-system-generic" {
source = "claranet/monitors/datadog//system/generic"
version = "{revision}"
- **Docker**: Container status, resource usage
- **Kubernetes**:
- Pod monitors (crash, restart, not running)
- Node monitors (resource usage, status)
- Cluster monitors (API server, scheduler)
- Workload monitors (deployments, statefulsets)
- Velero/Ark backup monitors
### Network Monitors
- **HTTP**: Webcheck, SSL certificate expiry
- **DNS**: Query response time, availability
- **TLS**: Certificate expiration
## Monitor Configuration Pattern
Each monitor module follows this pattern:
```hcl
module "service_monitor" {
source = "./path/to/monitor"
# Environment and messaging
environment = var.environment
message = module.datadog-message-alerting.alerting-message
memory_message = module.datadog-message-alerting-bh-only.alerting-message
# Use variables to customize monitors configuration
message = var.alert_message
# Timing configuration
evaluation_delay = 15
new_host_delay = 300
# Enable/disable monitors
monitor_name_enabled = "true"
# Thresholds
monitor_name_critical = 90
monitor_name_warning = 75
# Filtering
filter_tags_custom = "env:production,team:platform"
}
# Other monitors modules to declare ...
#module "datadog-monitors-my-monitors-set" {
# source = "claranet/monitors/datadog//my/monitors/set"
# version = "{revision}"
#
# environment = var.environment
# message = module.datadog-message-alerting.alerting-message
#}
```
* Replace `{revision}` to the last git tag available on this repository.
* The `//` is very important, it's a terraform specific syntax used to separate git url and folder path.
* `my/monitors/set` represents the path to a monitors set sub directory listed below.
## Alerting Integration
## Contributions
The `common/alerting-message` module provides templates for:
- PagerDuty integration
- Slack notifications
- Email alerts
- Webhook notifications
Contributions are always welcome.
Example:
```hcl
module "alerting" {
source = "./terraform-datadog-old-monitors/common/alerting-message"
message_alert = "@pagerduty-critical"
message_warning = "@slack-warnings"
message_nodata = "@slack-monitoring"
}
```
The easiest way is to fork the repository, duplicate a module as "template" and work on it.
## Filter Tags
An internal CI will run the `auto_update.sh` script to compare with proposed changes and check if everything is up to date.
The `common/filter-tags` module helps with tag-based filtering:
So, when PR is ready you will need to run this script and push its changes to pass the CI, see [scripts repository](https://github.com/claranet/terraform-datadog-scripts/) for more information.
```hcl
module "filter_tags" {
source = "./terraform-datadog-old-monitors/common/filter-tags"
environment = "production"
filter_tags_use_defaults = true
filter_tags_custom = "service:api,tier:backend"
}
```
For example, this will regenerate every READMEs thanks to [terraform-docs](https://github.com/segmentio/terraform-docs) currently in v0.9.1.
## Best Practices
## Monitors summary
1. **Start with defaults**: Use default thresholds first, then customize
2. **Gradual rollout**: Enable monitors incrementally
3. **Tag strategy**: Use consistent tagging across infrastructure
4. **Alert fatigue**: Tune thresholds to reduce false positives
5. **Documentation**: Document custom threshold decisions
6. **Testing**: Test monitors in non-production first
- [caas](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/)
- [docker](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/docker/)
- [kubernetes](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/)
- [ark](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/ark/)
- [cluster](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/cluster/)
- [ingress](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/ingress/)
- [vts](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/ingress/vts/)
- [node](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/node/)
- [pod](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/pod/)
- [velero](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/velero/)
- [workload](https://github.com/claranet/terraform-datadog-monitors/tree/master/caas/kubernetes/workload/)
- [cloud](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/)
- [aws](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/)
- [alb](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/alb/)
- [apigateway](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/apigateway/)
- [beanstalk](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/beanstalk/)
- [ecs](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/ecs/)
- [common](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/ecs/common/)
- [ec2-cluster](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/ecs/ec2-cluster/)
- [fargate](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/ecs/fargate/)
- [elasticache](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/elasticache/)
- [common](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/elasticache/common/)
- [memcached](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/elasticache/memcached/)
- [redis](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/elasticache/redis/)
- [elasticsearch](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/elasticsearch/)
- [elb](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/elb/)
- [kinesis-firehose](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/kinesis-firehose/)
- [lambda](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/lambda/)
- [nlb](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/nlb/)
- [rds](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/rds/)
- [aurora](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/rds/aurora/)
- [mysql](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/rds/aurora/mysql/)
- [postgresql](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/rds/aurora/postgresql/)
- [common](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/rds/common/)
- [sqs](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/sqs/)
- [vpn](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/aws/vpn/)
- [azure](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/)
- [apimanagement](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/apimanagement/)
- [app-gateway](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/app-gateway/)
- [app-services](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/app-services/)
- [azure-search](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/azure-search/)
- [cosmosdb](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/cosmosdb/)
- [datalakestore](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/datalakestore/)
- [eventgrid](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/eventgrid/)
- [eventhub](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/eventhub/)
- [functions](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/functions/)
- [iothubs](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/iothubs/)
- [keyvault](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/keyvault/)
- [load-balancer](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/load-balancer/)
- [mysql](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/mysql/)
- [postgresql](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/postgresql/)
- [redis](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/redis/)
- [serverfarms](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/serverfarms/)
- [servicebus](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/servicebus/)
- [sql-database](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/sql-database/)
- [sql-elasticpool](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/sql-elasticpool/)
- [storage](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/storage/)
- [stream-analytics](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/stream-analytics/)
- [virtual-machine](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/azure/virtual-machine/)
- [gcp](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/)
- [big-query](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/big-query/)
- [cloud-sql](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/cloud-sql/)
- [common](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/cloud-sql/common/)
- [mysql](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/cloud-sql/mysql/)
- [gce](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/gce/)
- [instance](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/gce/instance/)
- [lb](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/lb/)
- [memorystore](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/memorystore/)
- [redis](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/memorystore/redis/)
- [pubsub](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/pubsub/)
- [subscription](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/pubsub/subscription/)
- [topic](https://github.com/claranet/terraform-datadog-monitors/tree/master/cloud/gcp/pubsub/topic/)
- [common](https://github.com/claranet/terraform-datadog-monitors/tree/master/common/)
- [alerting-message](https://github.com/claranet/terraform-datadog-monitors/tree/master/common/alerting-message/)
- [filter-tags](https://github.com/claranet/terraform-datadog-monitors/tree/master/common/filter-tags/)
- [database](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/)
- [elasticsearch](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/elasticsearch/)
- [mongodb](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/mongodb/)
- [mysql](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/mysql/)
- [postgresql](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/postgresql/)
- [proxysql](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/proxysql/)
- [redis](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/redis/)
- [solr](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/solr/)
- [sqlserver](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/sqlserver/)
- [zookeeper](https://github.com/claranet/terraform-datadog-monitors/tree/master/database/zookeeper/)
- [middleware](https://github.com/claranet/terraform-datadog-monitors/tree/master/middleware/)
- [apache](https://github.com/claranet/terraform-datadog-monitors/tree/master/middleware/apache/)
- [kong](https://github.com/claranet/terraform-datadog-monitors/tree/master/middleware/kong/)
- [nginx](https://github.com/claranet/terraform-datadog-monitors/tree/master/middleware/nginx/)
- [php-fpm](https://github.com/claranet/terraform-datadog-monitors/tree/master/middleware/php-fpm/)
- [network](https://github.com/claranet/terraform-datadog-monitors/tree/master/network/)
- [dns](https://github.com/claranet/terraform-datadog-monitors/tree/master/network/dns/)
- [http](https://github.com/claranet/terraform-datadog-monitors/tree/master/network/http/)
- [ssl](https://github.com/claranet/terraform-datadog-monitors/tree/master/network/http/ssl/)
- [webcheck](https://github.com/claranet/terraform-datadog-monitors/tree/master/network/http/webcheck/)
- [tls](https://github.com/claranet/terraform-datadog-monitors/tree/master/network/tls/)
- [saas](https://github.com/claranet/terraform-datadog-monitors/tree/master/saas/)
- [new-relic](https://github.com/claranet/terraform-datadog-monitors/tree/master/saas/new-relic/)
- [system](https://github.com/claranet/terraform-datadog-monitors/tree/master/system/)
- [generic](https://github.com/claranet/terraform-datadog-monitors/tree/master/system/generic/)
- [unreachable](https://github.com/claranet/terraform-datadog-monitors/tree/master/system/unreachable/)
## Customization Examples
### Custom Thresholds
```hcl
# More aggressive CPU monitoring
cpu_critical = 85
cpu_warning = 70
# Relaxed disk space monitoring
disk_space_critical = 95
disk_space_warning = 90
```
### Conditional Monitoring
```hcl
# Only monitor specific services
filter_tags_custom = "service:critical-app"
# Skip new hosts for longer period
new_host_delay = 600 # 10 minutes
```
### Custom Alert Messages
```hcl
message = <<-EOT
{{#is_alert}}
CRITICAL: {{check}} on {{host.name}}
@pagerduty-critical
{{/is_alert}}
{{#is_warning}}
WARNING: {{check}} on {{host.name}}
@slack-warnings
{{/is_warning}}
EOT
```
## Maintenance
This module appears to be a legacy/archived version (hence "old-monitors" name). Consider:
- Reviewing for updates from Claranet repository
- Migrating to newer monitoring solutions if available
- Documenting which monitors are actively used
- Deprecating unused monitor configurations
## Outputs
Each sub-module may export:
- Monitor IDs
- Monitor names
- Alert status
Check individual module outputs.tf files for specifics.
## Notes
- This is a comprehensive library of monitor templates
- Based on Claranet's open-source Datadog monitors
- Covers most common infrastructure components
- Highly customizable with sensible defaults
- May contain more monitors than needed for your use case
- Review and enable only required monitors to avoid alert fatigue
## Migration Path
If migrating from this module:
1. Audit currently active monitors
2. Document custom thresholds
3. Test new monitoring solutions in parallel
4. Gradually migrate monitor by monitor
5. Keep this module for reference
## Resources
- Original Claranet repository: [terraform-datadog-monitors](https://github.com/claranet/terraform-datadog-monitors)
- Datadog monitor documentation: [Datadog Monitors](https://docs.datadoghq.com/monitors/)
## License
Based on Claranet's open-source work.
Internal use: Sanoma/WeBuildYourCloud
## Authors
- Original: Claranet team
- Maintained by: Platform Engineering team

0
TEMPLATING.md Normal file → Executable file
View File

69
caas/docker/README.md Normal file → Executable file
View File

@ -24,41 +24,60 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.memory_used](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.not_responding](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| environment | Architecture Environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded 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\_used\_enabled | Flag to enable Container Memory Usage monitor | `string` | `"false"` | no |
| memory\_used\_extra\_tags | Extra tags for Container Memory Usage monitor | `list(string)` | `[]` | no |
| memory\_used\_message | Custom message for the Container Memory Usage monitor | `string` | `""` | no |
| memory\_used\_threshold\_critical | Container Memory Usage critical threshold | `string` | `90` | no |
| memory\_used\_threshold\_warning | Container Memory Usage warning threshold | `string` | `85` | no |
| memory\_used\_time\_aggregator | Time aggregator for the Container Memory Usage monitor | `string` | `"min"` | no |
| memory\_used\_timeframe | Timeframe for the Container Memory Usage monitor | `string` | `"last_5m"` | no |
| message | Message sent when an alert is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| not\_responding\_enabled | Flag to enable Docker does not respond monitor | `string` | `"true"` | no |
| not\_responding\_extra\_tags | Extra tags for Docker does not respond monitor | `list(string)` | `[]` | no |
| not\_responding\_message | Custom message for Docker does not respond monitor | `string` | `""` | no |
| not\_responding\_no\_data\_timeframe | Docker does not respond monitor no data timeframe | `string` | `10` | no |
| not\_responding\_threshold\_warning | Docker does not respond monitor (warning threshold) | `string` | `3` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_memory_used_enabled"></a> [memory\_used\_enabled](#input\_memory\_used\_enabled) | Flag to enable Container Memory Usage monitor | `string` | `"false"` | no |
| <a name="input_memory_used_extra_tags"></a> [memory\_used\_extra\_tags](#input\_memory\_used\_extra\_tags) | Extra tags for Container Memory Usage monitor | `list(string)` | `[]` | no |
| <a name="input_memory_used_message"></a> [memory\_used\_message](#input\_memory\_used\_message) | Custom message for the Container Memory Usage monitor | `string` | `""` | no |
| <a name="input_memory_used_threshold_critical"></a> [memory\_used\_threshold\_critical](#input\_memory\_used\_threshold\_critical) | Container Memory Usage critical threshold | `string` | `90` | no |
| <a name="input_memory_used_threshold_warning"></a> [memory\_used\_threshold\_warning](#input\_memory\_used\_threshold\_warning) | Container Memory Usage warning threshold | `string` | `85` | no |
| <a name="input_memory_used_time_aggregator"></a> [memory\_used\_time\_aggregator](#input\_memory\_used\_time\_aggregator) | Time aggregator for the Container Memory Usage monitor | `string` | `"min"` | no |
| <a name="input_memory_used_timeframe"></a> [memory\_used\_timeframe](#input\_memory\_used\_timeframe) | Timeframe for the Container Memory Usage monitor | `string` | `"last_5m"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when an alert is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_not_responding_enabled"></a> [not\_responding\_enabled](#input\_not\_responding\_enabled) | Flag to enable Docker does not respond monitor | `string` | `"true"` | no |
| <a name="input_not_responding_extra_tags"></a> [not\_responding\_extra\_tags](#input\_not\_responding\_extra\_tags) | Extra tags for Docker does not respond monitor | `list(string)` | `[]` | no |
| <a name="input_not_responding_message"></a> [not\_responding\_message](#input\_not\_responding\_message) | Custom message for Docker does not respond monitor | `string` | `""` | no |
| <a name="input_not_responding_no_data_timeframe"></a> [not\_responding\_no\_data\_timeframe](#input\_not\_responding\_no\_data\_timeframe) | Docker does not respond monitor no data timeframe | `string` | `10` | no |
| <a name="input_not_responding_threshold_warning"></a> [not\_responding\_threshold\_warning](#input\_not\_responding\_threshold\_warning) | Docker does not respond monitor (warning threshold) | `string` | `3` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| memory\_used\_id | id for monitor memory\_used |
| not\_responding\_id | id for monitor not\_responding |
| <a name="output_memory_used_id"></a> [memory\_used\_id](#output\_memory\_used\_id) | id for monitor memory\_used |
| <a name="output_not_responding_id"></a> [not\_responding\_id](#output\_not\_responding\_id) | id for monitor not\_responding |
## Related documentation
* [Datadog Docker integration](https://docs.datadoghq.com/integrations/docker_daemon/)

0
caas/docker/inputs.tf Normal file → Executable file
View File

0
caas/docker/modules.tf Normal file → Executable file
View File

12
caas/docker/monitors-docker.tf Normal file → Executable file
View File

@ -11,7 +11,7 @@ resource "datadog_monitor" "not_responding" {
"docker.service_up"${module.filter-tags.service_check}.by("host").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.not_responding_threshold_warning
critical = 5
}
@ -27,10 +27,6 @@ EOQ
renotify_interval = 0
tags = concat(["env:${var.environment}", "type:docker", "provider:docker", "resource:docker", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "memory_used" {
@ -45,7 +41,7 @@ resource "datadog_monitor" "memory_used" {
> ${var.memory_used_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
warning = var.memory_used_threshold_warning
critical = var.memory_used_threshold_critical
}
@ -61,9 +57,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:docker", "provider:docker", "resource:docker", "team:claranet", "created-by:terraform"], var.memory_used_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/docker/outputs.tf Normal file → Executable file
View File

5
caas/docker/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

52
caas/kubernetes/ark/README.md Normal file → Executable file
View File

@ -23,33 +23,51 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.ark_schedules_monitor](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| ark\_schedules\_enabled | Flag to enable Ark schedules monitor | `string` | `"true"` | no |
| ark\_schedules\_extra\_tags | Extra tags for Ark schedules monitor | `list(string)` | `[]` | no |
| ark\_schedules\_monitor\_message | Custom message for Ark schedules monitor | `string` | `""` | no |
| ark\_schedules\_monitor\_no\_data\_timeframe | No data timeframe in minutes | `number` | `2880` | no |
| ark\_schedules\_monitor\_timeframe | Monitor timeframe for Ark schedules monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| environment | Architecture environment | `any` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_ark_schedules_enabled"></a> [ark\_schedules\_enabled](#input\_ark\_schedules\_enabled) | Flag to enable Ark schedules monitor | `string` | `"true"` | no |
| <a name="input_ark_schedules_extra_tags"></a> [ark\_schedules\_extra\_tags](#input\_ark\_schedules\_extra\_tags) | Extra tags for Ark schedules monitor | `list(string)` | `[]` | no |
| <a name="input_ark_schedules_monitor_message"></a> [ark\_schedules\_monitor\_message](#input\_ark\_schedules\_monitor\_message) | Custom message for Ark schedules monitor | `string` | `""` | no |
| <a name="input_ark_schedules_monitor_no_data_timeframe"></a> [ark\_schedules\_monitor\_no\_data\_timeframe](#input\_ark\_schedules\_monitor\_no\_data\_timeframe) | No data timeframe in minutes | `number` | `2880` | no |
| <a name="input_ark_schedules_monitor_timeframe"></a> [ark\_schedules\_monitor\_timeframe](#input\_ark\_schedules\_monitor\_timeframe) | Monitor timeframe for Ark schedules monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `any` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| ark\_schedules\_monitor\_id | id for monitor ark\_schedules\_monitor |
| <a name="output_ark_schedules_monitor_id"></a> [ark\_schedules\_monitor\_id](#output\_ark\_schedules\_monitor\_id) | id for monitor ark\_schedules\_monitor |
## Related documentation
DataDog blog: https://www.datadoghq.com/blog/monitor-prometheus-metrics

0
caas/kubernetes/ark/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/ark/modules.tf Normal file → Executable file
View File

6
caas/kubernetes/ark/monitors-ark.tf Normal file → Executable file
View File

@ -8,7 +8,7 @@ resource "datadog_monitor" "ark_schedules_monitor" {
sum(${var.ark_schedules_monitor_timeframe}):min:ark.ark_backup_failure_total${module.filter-tags.query_alert} by {schedule}.as_count() > 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
warning = 0
}
@ -26,9 +26,5 @@ EOQ
require_full_window = false
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:ark", "team:claranet", "created-by:terraform"], var.ark_schedules_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/ark/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/ark/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

52
caas/kubernetes/cluster/README.md Normal file → Executable file
View File

@ -23,33 +23,51 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.apiserver](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| apiserver\_enabled | Flag to enable API server monitor | `string` | `"true"` | no |
| apiserver\_extra\_tags | Extra tags for API server monitor | `list(string)` | `[]` | no |
| apiserver\_message | Custom message for API server monitor | `string` | `""` | no |
| apiserver\_no\_data\_timeframe | Number of minutes before reporting no data | `string` | `10` | no |
| apiserver\_threshold\_warning | API server monitor (warning threshold) | `string` | `3` | no |
| environment | Architecture environment | `any` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_apiserver_enabled"></a> [apiserver\_enabled](#input\_apiserver\_enabled) | Flag to enable API server monitor | `string` | `"true"` | no |
| <a name="input_apiserver_extra_tags"></a> [apiserver\_extra\_tags](#input\_apiserver\_extra\_tags) | Extra tags for API server monitor | `list(string)` | `[]` | no |
| <a name="input_apiserver_message"></a> [apiserver\_message](#input\_apiserver\_message) | Custom message for API server monitor | `string` | `""` | no |
| <a name="input_apiserver_no_data_timeframe"></a> [apiserver\_no\_data\_timeframe](#input\_apiserver\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no |
| <a name="input_apiserver_threshold_warning"></a> [apiserver\_threshold\_warning](#input\_apiserver\_threshold\_warning) | API server monitor (warning threshold) | `string` | `3` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `any` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| apiserver\_id | id for monitor apiserver |
| <a name="output_apiserver_id"></a> [apiserver\_id](#output\_apiserver\_id) | id for monitor apiserver |
## Related documentation
* [Datadog metrics](https://docs.datadoghq.com/agent/kubernetes/metrics/)

0
caas/kubernetes/cluster/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/cluster/modules.tf Normal file → Executable file
View File

6
caas/kubernetes/cluster/monitors-k8s-cluster.tf Normal file → Executable file
View File

@ -9,7 +9,7 @@ resource "datadog_monitor" "apiserver" {
"kube_apiserver_controlplane.up"${module.filter-tags.service_check}.last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.apiserver_threshold_warning
critical = 5
}
@ -25,9 +25,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.apiserver_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/cluster/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/cluster/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

0
caas/kubernetes/ingress/vts/MANIFEST.txt Normal file → Executable file
View File

77
caas/kubernetes/ingress/vts/README.md Normal file → Executable file
View File

@ -24,44 +24,65 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../../common/filter-tags | n/a |
| <a name="module_filter-tags-4xx"></a> [filter-tags-4xx](#module\_filter-tags-4xx) | ../../../../common/filter-tags | n/a |
| <a name="module_filter-tags-5xx"></a> [filter-tags-5xx](#module\_filter-tags-5xx) | ../../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.nginx_ingress_too_many_4xx](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.nginx_ingress_too_many_5xx](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| artificial\_requests\_count | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no |
| environment | Architecture Environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| ingress\_4xx\_enabled | Flag to enable Ingress 4xx errors monitor | `string` | `"true"` | no |
| ingress\_4xx\_extra\_tags | Extra tags for Ingress 4xx errors monitor | `list(string)` | `[]` | no |
| ingress\_4xx\_message | Message sent when an alert is triggered | `string` | `""` | no |
| ingress\_4xx\_threshold\_critical | 4xx critical threshold in percentage | `string` | `"40"` | no |
| ingress\_4xx\_threshold\_warning | 4xx warning threshold in percentage | `string` | `"20"` | no |
| ingress\_4xx\_time\_aggregator | Monitor aggregator for Ingress 4xx errors [available values: min, max or avg] | `string` | `"min"` | no |
| ingress\_4xx\_timeframe | Monitor timeframe for Ingress 4xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| ingress\_5xx\_enabled | Flag to enable Ingress 5xx errors monitor | `string` | `"true"` | no |
| ingress\_5xx\_extra\_tags | Extra tags for Ingress 5xx errors monitor | `list(string)` | `[]` | no |
| ingress\_5xx\_message | Message sent when an alert is triggered | `string` | `""` | no |
| ingress\_5xx\_threshold\_critical | 5xx critical threshold in percentage | `string` | `"20"` | no |
| ingress\_5xx\_threshold\_warning | 5xx warning threshold in percentage | `string` | `"10"` | no |
| ingress\_5xx\_time\_aggregator | Monitor aggregator for Ingress 5xx errors [available values: min, max or avg] | `string` | `"min"` | no |
| ingress\_5xx\_timeframe | Monitor timeframe for Ingress 5xx errors [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 an alert is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_artificial_requests_count"></a> [artificial\_requests\_count](#input\_artificial\_requests\_count) | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_ingress_4xx_enabled"></a> [ingress\_4xx\_enabled](#input\_ingress\_4xx\_enabled) | Flag to enable Ingress 4xx errors monitor | `string` | `"true"` | no |
| <a name="input_ingress_4xx_extra_tags"></a> [ingress\_4xx\_extra\_tags](#input\_ingress\_4xx\_extra\_tags) | Extra tags for Ingress 4xx errors monitor | `list(string)` | `[]` | no |
| <a name="input_ingress_4xx_message"></a> [ingress\_4xx\_message](#input\_ingress\_4xx\_message) | Message sent when an alert is triggered | `string` | `""` | no |
| <a name="input_ingress_4xx_threshold_critical"></a> [ingress\_4xx\_threshold\_critical](#input\_ingress\_4xx\_threshold\_critical) | 4xx critical threshold in percentage | `string` | `"40"` | no |
| <a name="input_ingress_4xx_threshold_warning"></a> [ingress\_4xx\_threshold\_warning](#input\_ingress\_4xx\_threshold\_warning) | 4xx warning threshold in percentage | `string` | `"20"` | no |
| <a name="input_ingress_4xx_time_aggregator"></a> [ingress\_4xx\_time\_aggregator](#input\_ingress\_4xx\_time\_aggregator) | Monitor aggregator for Ingress 4xx errors [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_ingress_4xx_timeframe"></a> [ingress\_4xx\_timeframe](#input\_ingress\_4xx\_timeframe) | Monitor timeframe for Ingress 4xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_ingress_5xx_enabled"></a> [ingress\_5xx\_enabled](#input\_ingress\_5xx\_enabled) | Flag to enable Ingress 5xx errors monitor | `string` | `"true"` | no |
| <a name="input_ingress_5xx_extra_tags"></a> [ingress\_5xx\_extra\_tags](#input\_ingress\_5xx\_extra\_tags) | Extra tags for Ingress 5xx errors monitor | `list(string)` | `[]` | no |
| <a name="input_ingress_5xx_message"></a> [ingress\_5xx\_message](#input\_ingress\_5xx\_message) | Message sent when an alert is triggered | `string` | `""` | no |
| <a name="input_ingress_5xx_threshold_critical"></a> [ingress\_5xx\_threshold\_critical](#input\_ingress\_5xx\_threshold\_critical) | 5xx critical threshold in percentage | `string` | `"20"` | no |
| <a name="input_ingress_5xx_threshold_warning"></a> [ingress\_5xx\_threshold\_warning](#input\_ingress\_5xx\_threshold\_warning) | 5xx warning threshold in percentage | `string` | `"10"` | no |
| <a name="input_ingress_5xx_time_aggregator"></a> [ingress\_5xx\_time\_aggregator](#input\_ingress\_5xx\_time\_aggregator) | Monitor aggregator for Ingress 5xx errors [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_ingress_5xx_timeframe"></a> [ingress\_5xx\_timeframe](#input\_ingress\_5xx\_timeframe) | Monitor timeframe for Ingress 5xx errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when an alert is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| nginx\_ingress\_too\_many\_4xx\_id | id for monitor nginx\_ingress\_too\_many\_4xx |
| nginx\_ingress\_too\_many\_5xx\_id | id for monitor nginx\_ingress\_too\_many\_5xx |
| <a name="output_nginx_ingress_too_many_4xx_id"></a> [nginx\_ingress\_too\_many\_4xx\_id](#output\_nginx\_ingress\_too\_many\_4xx\_id) | id for monitor nginx\_ingress\_too\_many\_4xx |
| <a name="output_nginx_ingress_too_many_5xx_id"></a> [nginx\_ingress\_too\_many\_5xx\_id](#output\_nginx\_ingress\_too\_many\_5xx\_id) | id for monitor nginx\_ingress\_too\_many\_5xx |
## Related documentation
DataDog blog: https://www.datadoghq.com/blog/monitor-prometheus-metrics

0
caas/kubernetes/ingress/vts/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/ingress/vts/modules.tf Normal file → Executable file
View File

12
caas/kubernetes/ingress/vts/monitors-ingress.tf Normal file → Executable file
View File

@ -11,7 +11,7 @@ resource "datadog_monitor" "nginx_ingress_too_many_5xx" {
* 100, 0) > ${var.ingress_5xx_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
warning = var.ingress_5xx_threshold_warning
critical = var.ingress_5xx_threshold_critical
}
@ -27,10 +27,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:nginx-ingress-controller", "team:claranet", "created-by:terraform"], var.ingress_5xx_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "nginx_ingress_too_many_4xx" {
@ -46,7 +42,7 @@ resource "datadog_monitor" "nginx_ingress_too_many_4xx" {
* 100, 0) > ${var.ingress_4xx_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
warning = var.ingress_4xx_threshold_warning
critical = var.ingress_4xx_threshold_critical
}
@ -62,9 +58,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:prometheus", "resource:nginx-ingress-controller", "team:claranet", "created-by:terraform"], var.ingress_4xx_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/ingress/vts/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/ingress/vts/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

170
caas/kubernetes/node/README.md Normal file → Executable file
View File

@ -32,87 +32,115 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
| <a name="module_filter-tags-unschedulable"></a> [filter-tags-unschedulable](#module\_filter-tags-unschedulable) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.disk_out](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.disk_pressure](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.kubelet_ping](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.kubelet_syncloop](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.memory_pressure](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.node_unschedulable](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ready](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.unregister_net_device](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.volume_inodes](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.volume_space](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| disk\_out\_enabled | Flag to enable Out of disk monitor | `string` | `"true"` | no |
| disk\_out\_extra\_tags | Extra tags for Out of disk monitor | `list(string)` | `[]` | no |
| disk\_out\_message | Custom message for Out of disk monitor | `string` | `""` | no |
| disk\_out\_threshold\_warning | Out of disk monitor (warning threshold) | `string` | `3` | no |
| disk\_pressure\_enabled | Flag to enable Disk pressure monitor | `string` | `"true"` | no |
| disk\_pressure\_extra\_tags | Extra tags for Disk pressure monitor | `list(string)` | `[]` | no |
| disk\_pressure\_message | Custom message for Disk pressure monitor | `string` | `""` | no |
| disk\_pressure\_threshold\_warning | Disk pressure monitor (warning threshold) | `string` | `3` | no |
| environment | Architecture environment | `any` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| kubelet\_ping\_enabled | Flag to enable Kubelet ping monitor | `string` | `"true"` | no |
| kubelet\_ping\_extra\_tags | Extra tags for Kubelet ping monitor | `list(string)` | `[]` | no |
| kubelet\_ping\_message | Custom message for Kubelet ping monitor | `string` | `""` | no |
| kubelet\_ping\_no\_data\_timeframe | Number of minutes before reporting no data | `string` | `10` | no |
| kubelet\_ping\_threshold\_warning | Kubelet ping monitor (warning threshold) | `string` | `3` | no |
| kubelet\_syncloop\_enabled | Flag to enable Kubelet sync loop monitor | `string` | `"true"` | no |
| kubelet\_syncloop\_extra\_tags | Extra tags for Kubelet sync loop monitor | `list(string)` | `[]` | no |
| kubelet\_syncloop\_message | Custom message for Kubelet sync loop monitor | `string` | `""` | no |
| kubelet\_syncloop\_threshold\_warning | Kubelet sync loop monitor (warning threshold) | `string` | `3` | no |
| memory\_pressure\_enabled | Flag to enable Memory pressure monitor | `string` | `"true"` | no |
| memory\_pressure\_extra\_tags | Extra tags for Memory pressure monitor | `list(string)` | `[]` | no |
| memory\_pressure\_message | Custom message for Memory pressure monitor | `string` | `""` | no |
| memory\_pressure\_threshold\_warning | Memory pressure monitor (warning threshold) | `string` | `3` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| node\_unschedulable\_enabled | Flag to enable node unschedulable monitor | `string` | `"true"` | no |
| node\_unschedulable\_extra\_tags | Extra tags for node unschedulable monitor | `list(string)` | `[]` | no |
| node\_unschedulable\_message | Custom message for node unschedulable monitor | `string` | `""` | no |
| node\_unschedulable\_time\_aggregator | Monitor aggregator for node unschedulable [available values: min, max or avg] | `string` | `"min"` | no |
| node\_unschedulable\_timeframe | Monitor timeframe for node unschedulable [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1h"` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| ready\_enabled | Flag to enable Node ready monitor | `string` | `"true"` | no |
| ready\_extra\_tags | Extra tags for Node ready monitor | `list(string)` | `[]` | no |
| ready\_message | Custom message for Node ready monitor | `string` | `""` | no |
| ready\_threshold\_warning | Node ready monitor (warning threshold) | `string` | `3` | no |
| unregister\_net\_device\_enabled | Flag to enable Unregister net device monitor | `string` | `"true"` | no |
| unregister\_net\_device\_extra\_tags | Extra tags for Unregister net device monitor | `list(string)` | `[]` | no |
| unregister\_net\_device\_message | Custom message for Unregister net device monitor | `string` | `""` | no |
| unregister\_net\_device\_threshold\_critical | Unregister net device critical threshold | `number` | `3` | no |
| unregister\_net\_device\_time\_aggregator | Monitor aggregator for Unregister net device [available values: min, max or avg] | `string` | `"min"` | no |
| unregister\_net\_device\_timeframe | Monitor timeframe for Unregister net device [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"15m"` | no |
| volume\_inodes\_enabled | Flag to enable Volume inodes monitor | `string` | `"true"` | no |
| volume\_inodes\_extra\_tags | Extra tags for Volume inodes monitor | `list(string)` | `[]` | no |
| volume\_inodes\_message | Custom message for Volume inodes monitor | `string` | `""` | no |
| volume\_inodes\_threshold\_critical | Volume inodes critical threshold | `number` | `95` | no |
| volume\_inodes\_threshold\_warning | Volume inodes warning threshold | `number` | `90` | no |
| volume\_inodes\_time\_aggregator | Monitor aggregator for Volume inodes [available values: min, max or avg] | `string` | `"min"` | no |
| volume\_inodes\_timeframe | Monitor timeframe for Volume inodes [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| volume\_space\_enabled | Flag to enable Volume space monitor | `string` | `"true"` | no |
| volume\_space\_extra\_tags | Extra tags for Volume space monitor | `list(string)` | `[]` | no |
| volume\_space\_message | Custom message for Volume space monitor | `string` | `""` | no |
| volume\_space\_threshold\_critical | Volume space critical threshold | `number` | `95` | no |
| volume\_space\_threshold\_warning | Volume space warning threshold | `number` | `90` | no |
| volume\_space\_time\_aggregator | Monitor aggregator for Volume space [available values: min, max or avg] | `string` | `"min"` | no |
| volume\_space\_timeframe | Monitor timeframe for Volume space [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_disk_out_enabled"></a> [disk\_out\_enabled](#input\_disk\_out\_enabled) | Flag to enable Out of disk monitor | `string` | `"true"` | no |
| <a name="input_disk_out_extra_tags"></a> [disk\_out\_extra\_tags](#input\_disk\_out\_extra\_tags) | Extra tags for Out of disk monitor | `list(string)` | `[]` | no |
| <a name="input_disk_out_message"></a> [disk\_out\_message](#input\_disk\_out\_message) | Custom message for Out of disk monitor | `string` | `""` | no |
| <a name="input_disk_out_threshold_warning"></a> [disk\_out\_threshold\_warning](#input\_disk\_out\_threshold\_warning) | Out of disk monitor (warning threshold) | `string` | `3` | no |
| <a name="input_disk_pressure_enabled"></a> [disk\_pressure\_enabled](#input\_disk\_pressure\_enabled) | Flag to enable Disk pressure monitor | `string` | `"true"` | no |
| <a name="input_disk_pressure_extra_tags"></a> [disk\_pressure\_extra\_tags](#input\_disk\_pressure\_extra\_tags) | Extra tags for Disk pressure monitor | `list(string)` | `[]` | no |
| <a name="input_disk_pressure_message"></a> [disk\_pressure\_message](#input\_disk\_pressure\_message) | Custom message for Disk pressure monitor | `string` | `""` | no |
| <a name="input_disk_pressure_threshold_warning"></a> [disk\_pressure\_threshold\_warning](#input\_disk\_pressure\_threshold\_warning) | Disk pressure monitor (warning threshold) | `string` | `3` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `any` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_kubelet_ping_enabled"></a> [kubelet\_ping\_enabled](#input\_kubelet\_ping\_enabled) | Flag to enable Kubelet ping monitor | `string` | `"true"` | no |
| <a name="input_kubelet_ping_extra_tags"></a> [kubelet\_ping\_extra\_tags](#input\_kubelet\_ping\_extra\_tags) | Extra tags for Kubelet ping monitor | `list(string)` | `[]` | no |
| <a name="input_kubelet_ping_message"></a> [kubelet\_ping\_message](#input\_kubelet\_ping\_message) | Custom message for Kubelet ping monitor | `string` | `""` | no |
| <a name="input_kubelet_ping_no_data_timeframe"></a> [kubelet\_ping\_no\_data\_timeframe](#input\_kubelet\_ping\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no |
| <a name="input_kubelet_ping_threshold_warning"></a> [kubelet\_ping\_threshold\_warning](#input\_kubelet\_ping\_threshold\_warning) | Kubelet ping monitor (warning threshold) | `string` | `3` | no |
| <a name="input_kubelet_syncloop_enabled"></a> [kubelet\_syncloop\_enabled](#input\_kubelet\_syncloop\_enabled) | Flag to enable Kubelet sync loop monitor | `string` | `"true"` | no |
| <a name="input_kubelet_syncloop_extra_tags"></a> [kubelet\_syncloop\_extra\_tags](#input\_kubelet\_syncloop\_extra\_tags) | Extra tags for Kubelet sync loop monitor | `list(string)` | `[]` | no |
| <a name="input_kubelet_syncloop_message"></a> [kubelet\_syncloop\_message](#input\_kubelet\_syncloop\_message) | Custom message for Kubelet sync loop monitor | `string` | `""` | no |
| <a name="input_kubelet_syncloop_threshold_warning"></a> [kubelet\_syncloop\_threshold\_warning](#input\_kubelet\_syncloop\_threshold\_warning) | Kubelet sync loop monitor (warning threshold) | `string` | `3` | no |
| <a name="input_memory_pressure_enabled"></a> [memory\_pressure\_enabled](#input\_memory\_pressure\_enabled) | Flag to enable Memory pressure monitor | `string` | `"true"` | no |
| <a name="input_memory_pressure_extra_tags"></a> [memory\_pressure\_extra\_tags](#input\_memory\_pressure\_extra\_tags) | Extra tags for Memory pressure monitor | `list(string)` | `[]` | no |
| <a name="input_memory_pressure_message"></a> [memory\_pressure\_message](#input\_memory\_pressure\_message) | Custom message for Memory pressure monitor | `string` | `""` | no |
| <a name="input_memory_pressure_threshold_warning"></a> [memory\_pressure\_threshold\_warning](#input\_memory\_pressure\_threshold\_warning) | Memory pressure monitor (warning threshold) | `string` | `3` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_node_unschedulable_enabled"></a> [node\_unschedulable\_enabled](#input\_node\_unschedulable\_enabled) | Flag to enable node unschedulable monitor | `string` | `"true"` | no |
| <a name="input_node_unschedulable_extra_tags"></a> [node\_unschedulable\_extra\_tags](#input\_node\_unschedulable\_extra\_tags) | Extra tags for node unschedulable monitor | `list(string)` | `[]` | no |
| <a name="input_node_unschedulable_message"></a> [node\_unschedulable\_message](#input\_node\_unschedulable\_message) | Custom message for node unschedulable monitor | `string` | `""` | no |
| <a name="input_node_unschedulable_time_aggregator"></a> [node\_unschedulable\_time\_aggregator](#input\_node\_unschedulable\_time\_aggregator) | Monitor aggregator for node unschedulable [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_node_unschedulable_timeframe"></a> [node\_unschedulable\_timeframe](#input\_node\_unschedulable\_timeframe) | Monitor timeframe for node unschedulable [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1h"` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_ready_enabled"></a> [ready\_enabled](#input\_ready\_enabled) | Flag to enable Node ready monitor | `string` | `"true"` | no |
| <a name="input_ready_extra_tags"></a> [ready\_extra\_tags](#input\_ready\_extra\_tags) | Extra tags for Node ready monitor | `list(string)` | `[]` | no |
| <a name="input_ready_message"></a> [ready\_message](#input\_ready\_message) | Custom message for Node ready monitor | `string` | `""` | no |
| <a name="input_ready_threshold_warning"></a> [ready\_threshold\_warning](#input\_ready\_threshold\_warning) | Node ready monitor (warning threshold) | `string` | `3` | no |
| <a name="input_unregister_net_device_enabled"></a> [unregister\_net\_device\_enabled](#input\_unregister\_net\_device\_enabled) | Flag to enable Unregister net device monitor | `string` | `"true"` | no |
| <a name="input_unregister_net_device_extra_tags"></a> [unregister\_net\_device\_extra\_tags](#input\_unregister\_net\_device\_extra\_tags) | Extra tags for Unregister net device monitor | `list(string)` | `[]` | no |
| <a name="input_unregister_net_device_message"></a> [unregister\_net\_device\_message](#input\_unregister\_net\_device\_message) | Custom message for Unregister net device monitor | `string` | `""` | no |
| <a name="input_unregister_net_device_threshold_critical"></a> [unregister\_net\_device\_threshold\_critical](#input\_unregister\_net\_device\_threshold\_critical) | Unregister net device critical threshold | `number` | `3` | no |
| <a name="input_unregister_net_device_time_aggregator"></a> [unregister\_net\_device\_time\_aggregator](#input\_unregister\_net\_device\_time\_aggregator) | Monitor aggregator for Unregister net device [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_unregister_net_device_timeframe"></a> [unregister\_net\_device\_timeframe](#input\_unregister\_net\_device\_timeframe) | Monitor timeframe for Unregister net device [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"15m"` | no |
| <a name="input_volume_inodes_enabled"></a> [volume\_inodes\_enabled](#input\_volume\_inodes\_enabled) | Flag to enable Volume inodes monitor | `string` | `"true"` | no |
| <a name="input_volume_inodes_extra_tags"></a> [volume\_inodes\_extra\_tags](#input\_volume\_inodes\_extra\_tags) | Extra tags for Volume inodes monitor | `list(string)` | `[]` | no |
| <a name="input_volume_inodes_message"></a> [volume\_inodes\_message](#input\_volume\_inodes\_message) | Custom message for Volume inodes monitor | `string` | `""` | no |
| <a name="input_volume_inodes_threshold_critical"></a> [volume\_inodes\_threshold\_critical](#input\_volume\_inodes\_threshold\_critical) | Volume inodes critical threshold | `number` | `95` | no |
| <a name="input_volume_inodes_threshold_warning"></a> [volume\_inodes\_threshold\_warning](#input\_volume\_inodes\_threshold\_warning) | Volume inodes warning threshold | `number` | `90` | no |
| <a name="input_volume_inodes_time_aggregator"></a> [volume\_inodes\_time\_aggregator](#input\_volume\_inodes\_time\_aggregator) | Monitor aggregator for Volume inodes [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_volume_inodes_timeframe"></a> [volume\_inodes\_timeframe](#input\_volume\_inodes\_timeframe) | Monitor timeframe for Volume inodes [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_volume_space_enabled"></a> [volume\_space\_enabled](#input\_volume\_space\_enabled) | Flag to enable Volume space monitor | `string` | `"true"` | no |
| <a name="input_volume_space_extra_tags"></a> [volume\_space\_extra\_tags](#input\_volume\_space\_extra\_tags) | Extra tags for Volume space monitor | `list(string)` | `[]` | no |
| <a name="input_volume_space_message"></a> [volume\_space\_message](#input\_volume\_space\_message) | Custom message for Volume space monitor | `string` | `""` | no |
| <a name="input_volume_space_threshold_critical"></a> [volume\_space\_threshold\_critical](#input\_volume\_space\_threshold\_critical) | Volume space critical threshold | `number` | `95` | no |
| <a name="input_volume_space_threshold_warning"></a> [volume\_space\_threshold\_warning](#input\_volume\_space\_threshold\_warning) | Volume space warning threshold | `number` | `90` | no |
| <a name="input_volume_space_time_aggregator"></a> [volume\_space\_time\_aggregator](#input\_volume\_space\_time\_aggregator) | Monitor aggregator for Volume space [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_volume_space_timeframe"></a> [volume\_space\_timeframe](#input\_volume\_space\_timeframe) | Monitor timeframe for Volume space [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 |
|------|-------------|
| disk\_out\_id | id for monitor disk\_out |
| disk\_pressure\_id | id for monitor disk\_pressure |
| kubelet\_ping\_id | id for monitor kubelet\_ping |
| kubelet\_syncloop\_id | id for monitor kubelet\_syncloop |
| memory\_pressure\_id | id for monitor memory\_pressure |
| node\_unschedulable\_id | id for monitor node\_unschedulable |
| ready\_id | id for monitor ready |
| unregister\_net\_device\_id | id for monitor unregister\_net\_device |
| volume\_inodes\_id | id for monitor volume\_inodes |
| volume\_space\_id | id for monitor volume\_space |
| <a name="output_disk_out_id"></a> [disk\_out\_id](#output\_disk\_out\_id) | id for monitor disk\_out |
| <a name="output_disk_pressure_id"></a> [disk\_pressure\_id](#output\_disk\_pressure\_id) | id for monitor disk\_pressure |
| <a name="output_kubelet_ping_id"></a> [kubelet\_ping\_id](#output\_kubelet\_ping\_id) | id for monitor kubelet\_ping |
| <a name="output_kubelet_syncloop_id"></a> [kubelet\_syncloop\_id](#output\_kubelet\_syncloop\_id) | id for monitor kubelet\_syncloop |
| <a name="output_memory_pressure_id"></a> [memory\_pressure\_id](#output\_memory\_pressure\_id) | id for monitor memory\_pressure |
| <a name="output_node_unschedulable_id"></a> [node\_unschedulable\_id](#output\_node\_unschedulable\_id) | id for monitor node\_unschedulable |
| <a name="output_ready_id"></a> [ready\_id](#output\_ready\_id) | id for monitor ready |
| <a name="output_unregister_net_device_id"></a> [unregister\_net\_device\_id](#output\_unregister\_net\_device\_id) | id for monitor unregister\_net\_device |
| <a name="output_volume_inodes_id"></a> [volume\_inodes\_id](#output\_volume\_inodes\_id) | id for monitor volume\_inodes |
| <a name="output_volume_space_id"></a> [volume\_space\_id](#output\_volume\_space\_id) | id for monitor volume\_space |
## Related documentation
* [Datadog metrics](https://docs.datadoghq.com/agent/kubernetes/metrics/)

0
caas/kubernetes/node/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/node/modules.tf Normal file → Executable file
View File

58
caas/kubernetes/node/monitors-k8s-node.tf Normal file → Executable file
View File

@ -8,7 +8,7 @@ resource "datadog_monitor" "disk_pressure" {
"kubernetes_state.node.disk_pressure"${module.filter-tags.service_check}.by("node").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.disk_pressure_threshold_warning
critical = 5
}
@ -23,10 +23,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.disk_pressure_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "disk_out" {
@ -39,7 +35,7 @@ resource "datadog_monitor" "disk_out" {
"kubernetes_state.node.out_of_disk"${module.filter-tags.service_check}.by("node").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.disk_out_threshold_warning
critical = 5
}
@ -54,10 +50,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.disk_out_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "memory_pressure" {
@ -70,7 +62,7 @@ resource "datadog_monitor" "memory_pressure" {
"kubernetes_state.node.memory_pressure"${module.filter-tags.service_check}.by("node").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.memory_pressure_threshold_warning
critical = 5
}
@ -85,10 +77,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.memory_pressure_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "ready" {
@ -101,7 +89,7 @@ resource "datadog_monitor" "ready" {
"kubernetes_state.node.ready"${module.filter-tags.service_check}.by("node").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.ready_threshold_warning
critical = 5
}
@ -116,10 +104,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.ready_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "kubelet_ping" {
@ -132,7 +116,7 @@ resource "datadog_monitor" "kubelet_ping" {
"kubernetes.kubelet.check.ping"${module.filter-tags.service_check}.by("name").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.kubelet_ping_threshold_warning
critical = 5
}
@ -148,10 +132,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.kubelet_ping_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "kubelet_syncloop" {
@ -164,7 +144,7 @@ resource "datadog_monitor" "kubelet_syncloop" {
"kubernetes.kubelet.check.syncloop"${module.filter-tags.service_check}.by("name").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.kubelet_syncloop_threshold_warning
critical = 5
}
@ -179,10 +159,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.kubelet_syncloop_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "unregister_net_device" {
@ -204,10 +180,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.unregister_net_device_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "node_unschedulable" {
@ -222,7 +194,7 @@ resource "datadog_monitor" "node_unschedulable" {
> 0
EOQ
thresholds = {
monitor_thresholds {
critical = 0
}
@ -237,10 +209,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.node_unschedulable_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "volume_space" {
@ -256,7 +224,7 @@ resource "datadog_monitor" "volume_space" {
* 100 > ${var.volume_space_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.volume_space_threshold_critical
warning = var.volume_space_threshold_warning
}
@ -272,10 +240,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.volume_space_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "volume_inodes" {
@ -291,7 +255,7 @@ resource "datadog_monitor" "volume_inodes" {
* 100 > ${var.volume_inodes_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.volume_inodes_threshold_critical
warning = var.volume_inodes_threshold_warning
}
@ -307,9 +271,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.volume_inodes_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/node/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/node/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

90
caas/kubernetes/pod/README.md Normal file → Executable file
View File

@ -25,49 +25,71 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
| <a name="module_filter-tags-nocontainercreating"></a> [filter-tags-nocontainercreating](#module\_filter-tags-nocontainercreating) | ../../../common/filter-tags | n/a |
| <a name="module_filter-tags-phase"></a> [filter-tags-phase](#module\_filter-tags-phase) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.error](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.pod_phase_status](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.terminated](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| environment | Architecture environment | `any` | n/a | yes |
| error\_enabled | Flag to enable Pod errors monitor | `string` | `"true"` | no |
| error\_extra\_tags | Extra tags for Pod errors monitor | `list(string)` | `[]` | no |
| error\_message | Custom message for Pod errors monitor | `string` | `""` | no |
| error\_threshold\_critical | error critical threshold | `number` | `0.5` | no |
| error\_threshold\_warning | error warning threshold | `number` | `0` | no |
| error\_time\_aggregator | Monitor aggregator for Pod errors [available values: min, max or avg] | `string` | `"min"` | no |
| error\_timeframe | Monitor timeframe for Pod errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| pod\_phase\_status\_enabled | Flag to enable Pod phase status monitor | `string` | `"true"` | no |
| pod\_phase\_status\_extra\_tags | Extra tags for Pod phase status monitor | `list(string)` | `[]` | no |
| pod\_phase\_status\_message | Custom message for Pod phase status monitor | `string` | `""` | no |
| pod\_phase\_status\_time\_aggregator | Monitor aggregator for Pod phase status [available values: min, max or avg] | `string` | `"max"` | no |
| pod\_phase\_status\_timeframe | Monitor timeframe for Pod phase status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| terminated\_enabled | Flag to enable Pod terminated monitor | `string` | `"true"` | no |
| terminated\_extra\_tags | Extra tags for Pod terminated monitor | `list(string)` | `[]` | no |
| terminated\_message | Custom message for Pod terminated monitor | `string` | `""` | no |
| terminated\_threshold\_critical | terminated critical threshold | `number` | `0.5` | no |
| terminated\_threshold\_warning | terminated warning threshold | `number` | `0` | no |
| terminated\_time\_aggregator | Monitor aggregator for Pod terminated [available values: min, max or avg] | `string` | `"sum"` | no |
| terminated\_timeframe | Monitor timeframe for Pod terminated [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_10m"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `any` | n/a | yes |
| <a name="input_error_enabled"></a> [error\_enabled](#input\_error\_enabled) | Flag to enable Pod errors monitor | `string` | `"true"` | no |
| <a name="input_error_extra_tags"></a> [error\_extra\_tags](#input\_error\_extra\_tags) | Extra tags for Pod errors monitor | `list(string)` | `[]` | no |
| <a name="input_error_message"></a> [error\_message](#input\_error\_message) | Custom message for Pod errors monitor | `string` | `""` | no |
| <a name="input_error_threshold_critical"></a> [error\_threshold\_critical](#input\_error\_threshold\_critical) | error critical threshold | `number` | `0.5` | no |
| <a name="input_error_threshold_warning"></a> [error\_threshold\_warning](#input\_error\_threshold\_warning) | error warning threshold | `number` | `0` | no |
| <a name="input_error_time_aggregator"></a> [error\_time\_aggregator](#input\_error\_time\_aggregator) | Monitor aggregator for Pod errors [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_error_timeframe"></a> [error\_timeframe](#input\_error\_timeframe) | Monitor timeframe for Pod errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_pod_phase_status_enabled"></a> [pod\_phase\_status\_enabled](#input\_pod\_phase\_status\_enabled) | Flag to enable Pod phase status monitor | `string` | `"true"` | no |
| <a name="input_pod_phase_status_extra_tags"></a> [pod\_phase\_status\_extra\_tags](#input\_pod\_phase\_status\_extra\_tags) | Extra tags for Pod phase status monitor | `list(string)` | `[]` | no |
| <a name="input_pod_phase_status_message"></a> [pod\_phase\_status\_message](#input\_pod\_phase\_status\_message) | Custom message for Pod phase status monitor | `string` | `""` | no |
| <a name="input_pod_phase_status_time_aggregator"></a> [pod\_phase\_status\_time\_aggregator](#input\_pod\_phase\_status\_time\_aggregator) | Monitor aggregator for Pod phase status [available values: min, max or avg] | `string` | `"max"` | no |
| <a name="input_pod_phase_status_timeframe"></a> [pod\_phase\_status\_timeframe](#input\_pod\_phase\_status\_timeframe) | Monitor timeframe for Pod phase status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_terminated_enabled"></a> [terminated\_enabled](#input\_terminated\_enabled) | Flag to enable Pod terminated monitor | `string` | `"true"` | no |
| <a name="input_terminated_extra_tags"></a> [terminated\_extra\_tags](#input\_terminated\_extra\_tags) | Extra tags for Pod terminated monitor | `list(string)` | `[]` | no |
| <a name="input_terminated_message"></a> [terminated\_message](#input\_terminated\_message) | Custom message for Pod terminated monitor | `string` | `""` | no |
| <a name="input_terminated_threshold_critical"></a> [terminated\_threshold\_critical](#input\_terminated\_threshold\_critical) | terminated critical threshold | `number` | `0.5` | no |
| <a name="input_terminated_threshold_warning"></a> [terminated\_threshold\_warning](#input\_terminated\_threshold\_warning) | terminated warning threshold | `number` | `0` | no |
| <a name="input_terminated_time_aggregator"></a> [terminated\_time\_aggregator](#input\_terminated\_time\_aggregator) | Monitor aggregator for Pod terminated [available values: min, max or avg] | `string` | `"sum"` | no |
| <a name="input_terminated_timeframe"></a> [terminated\_timeframe](#input\_terminated\_timeframe) | Monitor timeframe for Pod terminated [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_10m"` | no |
## Outputs
| Name | Description |
|------|-------------|
| error\_id | id for monitor error |
| pod\_phase\_status\_id | id for monitor pod\_phase\_status |
| terminated\_id | id for monitor terminated |
| <a name="output_error_id"></a> [error\_id](#output\_error\_id) | id for monitor error |
| <a name="output_pod_phase_status_id"></a> [pod\_phase\_status\_id](#output\_pod\_phase\_status\_id) | id for monitor pod\_phase\_status |
| <a name="output_terminated_id"></a> [terminated\_id](#output\_terminated\_id) | id for monitor terminated |
## Related documentation
* [Datadog metrics](https://docs.datadoghq.com/agent/kubernetes/metrics/)
@ -76,4 +98,4 @@ Creates DataDog monitors with the following checks:
## Requirements
* Datadog Agent > v6.6
* Datadog Agent > v7.2

0
caas/kubernetes/pod/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/pod/modules.tf Normal file → Executable file
View File

24
caas/kubernetes/pod/monitors-k8s-pod.tf Normal file → Executable file
View File

@ -6,10 +6,10 @@ resource "datadog_monitor" "pod_phase_status" {
query = <<EOQ
${var.pod_phase_status_time_aggregator}(${var.pod_phase_status_timeframe}):
default(sum:kubernetes_state.pod.status_phase${module.filter-tags-phase.query_alert} by {namespace}, 0) > 0
default(sum:kubernetes_state.pod.status_phase${module.filter-tags-phase.query_alert} by {namespace,kube_cluster_name}, 0) > 0
EOQ
thresholds = {
monitor_thresholds {
critical = 0
}
@ -25,10 +25,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.pod_phase_status_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "error" {
@ -39,11 +35,11 @@ resource "datadog_monitor" "error" {
query = <<EOQ
${var.error_time_aggregator}(${var.error_timeframe}):
sum:kubernetes_state.container.status_report.count.waiting${module.filter-tags-nocontainercreating.query_alert} by {namespace,pod,reason}
sum:kubernetes_state.container.status_report.count.waiting${module.filter-tags-nocontainercreating.query_alert} by {namespace,pod,reason,kube_cluster_name}
> ${var.error_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.error_threshold_critical
warning = var.error_threshold_warning
}
@ -59,10 +55,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.error_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "terminated" {
@ -73,11 +65,11 @@ resource "datadog_monitor" "terminated" {
query = <<EOQ
${var.terminated_time_aggregator}(${var.terminated_timeframe}):
sum:kubernetes_state.container.status_report.count.terminated${module.filter-tags-nocontainercreating.query_alert} by {namespace,pod,reason}
sum:kubernetes_state.container.status_report.count.terminated${module.filter-tags-nocontainercreating.query_alert} by {namespace,pod,reason,kube_cluster_name}
> ${var.terminated_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.terminated_threshold_critical
warning = var.terminated_threshold_warning
}
@ -93,9 +85,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-pod", "team:claranet", "created-by:terraform"], var.terminated_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/pod/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/pod/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

97
caas/kubernetes/velero/README.md Normal file → Executable file
View File

@ -27,53 +27,76 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
| <a name="module_filter-tags-scheduled-backup"></a> [filter-tags-scheduled-backup](#module\_filter-tags-scheduled-backup) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.velero_backup_deletion_failure](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.velero_backup_failure](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.velero_backup_partial_failure](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.velero_scheduled_backup_missing](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.velero_volume_snapshot_failure](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| environment | Architecture environment | `any` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| velero\_backup\_deletion\_failure\_enabled | Flag to enable Velero backup deletion failure monitor | `string` | `"true"` | no |
| velero\_backup\_deletion\_failure\_extra\_tags | Extra tags for Velero backup deletion failure monitor | `list(string)` | `[]` | no |
| velero\_backup\_deletion\_failure\_monitor\_message | Custom message for Velero backup deletion failure monitor | `string` | `""` | no |
| velero\_backup\_deletion\_failure\_monitor\_timeframe | Monitor timeframe for Velero backup deletion failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| velero\_backup\_failure\_enabled | Flag to enable Velero backup failure monitor | `string` | `"true"` | no |
| velero\_backup\_failure\_extra\_tags | Extra tags for Velero backup failure monitor | `list(string)` | `[]` | no |
| velero\_backup\_failure\_monitor\_message | Custom message for Velero backup failure monitor | `string` | `""` | no |
| velero\_backup\_failure\_monitor\_timeframe | Monitor timeframe for Velero backup failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| velero\_backup\_partial\_failure\_enabled | Flag to enable Velero backup partial failure monitor | `string` | `"true"` | no |
| velero\_backup\_partial\_failure\_extra\_tags | Extra tags for Velero backup partial failure monitor | `list(string)` | `[]` | no |
| velero\_backup\_partial\_failure\_monitor\_message | Custom message for Velero backup partial failure monitor | `string` | `""` | no |
| velero\_backup\_partial\_failure\_monitor\_timeframe | Monitor timeframe for Velero backup partial failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| velero\_scheduled\_backup\_missing\_enabled | Flag to enable Velero scheduled backup missing monitor | `string` | `"true"` | no |
| velero\_scheduled\_backup\_missing\_extra\_tags | Extra tags for Velero scheduled backup missing monitor | `list(string)` | `[]` | no |
| velero\_scheduled\_backup\_missing\_monitor\_message | Custom message for Velero scheduled backup missing monitor | `string` | `""` | no |
| velero\_scheduled\_backup\_missing\_monitor\_no\_data\_timeframe | No data timeframe in minutes | `number` | `2880` | no |
| velero\_scheduled\_backup\_missing\_monitor\_timeframe | Monitor timeframe for Velero scheduled backup missing monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| velero\_volume\_snapshot\_failure\_enabled | Flag to enable Velero volume snapshot failure monitor | `string` | `"true"` | no |
| velero\_volume\_snapshot\_failure\_extra\_tags | Extra tags for Velero volume snapshot failure monitor | `list(string)` | `[]` | no |
| velero\_volume\_snapshot\_failure\_monitor\_message | Custom message for Velero volume snapshot failure monitor | `string` | `""` | no |
| velero\_volume\_snapshot\_failure\_monitor\_timeframe | Monitor timeframe for Velero volume snapshot failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `any` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_velero_backup_deletion_failure_enabled"></a> [velero\_backup\_deletion\_failure\_enabled](#input\_velero\_backup\_deletion\_failure\_enabled) | Flag to enable Velero backup deletion failure monitor | `string` | `"true"` | no |
| <a name="input_velero_backup_deletion_failure_extra_tags"></a> [velero\_backup\_deletion\_failure\_extra\_tags](#input\_velero\_backup\_deletion\_failure\_extra\_tags) | Extra tags for Velero backup deletion failure monitor | `list(string)` | `[]` | no |
| <a name="input_velero_backup_deletion_failure_monitor_message"></a> [velero\_backup\_deletion\_failure\_monitor\_message](#input\_velero\_backup\_deletion\_failure\_monitor\_message) | Custom message for Velero backup deletion failure monitor | `string` | `""` | no |
| <a name="input_velero_backup_deletion_failure_monitor_timeframe"></a> [velero\_backup\_deletion\_failure\_monitor\_timeframe](#input\_velero\_backup\_deletion\_failure\_monitor\_timeframe) | Monitor timeframe for Velero backup deletion failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| <a name="input_velero_backup_failure_enabled"></a> [velero\_backup\_failure\_enabled](#input\_velero\_backup\_failure\_enabled) | Flag to enable Velero backup failure monitor | `string` | `"true"` | no |
| <a name="input_velero_backup_failure_extra_tags"></a> [velero\_backup\_failure\_extra\_tags](#input\_velero\_backup\_failure\_extra\_tags) | Extra tags for Velero backup failure monitor | `list(string)` | `[]` | no |
| <a name="input_velero_backup_failure_monitor_message"></a> [velero\_backup\_failure\_monitor\_message](#input\_velero\_backup\_failure\_monitor\_message) | Custom message for Velero backup failure monitor | `string` | `""` | no |
| <a name="input_velero_backup_failure_monitor_timeframe"></a> [velero\_backup\_failure\_monitor\_timeframe](#input\_velero\_backup\_failure\_monitor\_timeframe) | Monitor timeframe for Velero backup failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| <a name="input_velero_backup_partial_failure_enabled"></a> [velero\_backup\_partial\_failure\_enabled](#input\_velero\_backup\_partial\_failure\_enabled) | Flag to enable Velero backup partial failure monitor | `string` | `"true"` | no |
| <a name="input_velero_backup_partial_failure_extra_tags"></a> [velero\_backup\_partial\_failure\_extra\_tags](#input\_velero\_backup\_partial\_failure\_extra\_tags) | Extra tags for Velero backup partial failure monitor | `list(string)` | `[]` | no |
| <a name="input_velero_backup_partial_failure_monitor_message"></a> [velero\_backup\_partial\_failure\_monitor\_message](#input\_velero\_backup\_partial\_failure\_monitor\_message) | Custom message for Velero backup partial failure monitor | `string` | `""` | no |
| <a name="input_velero_backup_partial_failure_monitor_timeframe"></a> [velero\_backup\_partial\_failure\_monitor\_timeframe](#input\_velero\_backup\_partial\_failure\_monitor\_timeframe) | Monitor timeframe for Velero backup partial failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| <a name="input_velero_scheduled_backup_missing_enabled"></a> [velero\_scheduled\_backup\_missing\_enabled](#input\_velero\_scheduled\_backup\_missing\_enabled) | Flag to enable Velero scheduled backup missing monitor | `string` | `"true"` | no |
| <a name="input_velero_scheduled_backup_missing_extra_tags"></a> [velero\_scheduled\_backup\_missing\_extra\_tags](#input\_velero\_scheduled\_backup\_missing\_extra\_tags) | Extra tags for Velero scheduled backup missing monitor | `list(string)` | `[]` | no |
| <a name="input_velero_scheduled_backup_missing_monitor_message"></a> [velero\_scheduled\_backup\_missing\_monitor\_message](#input\_velero\_scheduled\_backup\_missing\_monitor\_message) | Custom message for Velero scheduled backup missing monitor | `string` | `""` | no |
| <a name="input_velero_scheduled_backup_missing_monitor_no_data_timeframe"></a> [velero\_scheduled\_backup\_missing\_monitor\_no\_data\_timeframe](#input\_velero\_scheduled\_backup\_missing\_monitor\_no\_data\_timeframe) | No data timeframe in minutes | `number` | `2880` | no |
| <a name="input_velero_scheduled_backup_missing_monitor_timeframe"></a> [velero\_scheduled\_backup\_missing\_monitor\_timeframe](#input\_velero\_scheduled\_backup\_missing\_monitor\_timeframe) | Monitor timeframe for Velero scheduled backup missing monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
| <a name="input_velero_volume_snapshot_failure_enabled"></a> [velero\_volume\_snapshot\_failure\_enabled](#input\_velero\_volume\_snapshot\_failure\_enabled) | Flag to enable Velero volume snapshot failure monitor | `string` | `"true"` | no |
| <a name="input_velero_volume_snapshot_failure_extra_tags"></a> [velero\_volume\_snapshot\_failure\_extra\_tags](#input\_velero\_volume\_snapshot\_failure\_extra\_tags) | Extra tags for Velero volume snapshot failure monitor | `list(string)` | `[]` | no |
| <a name="input_velero_volume_snapshot_failure_monitor_message"></a> [velero\_volume\_snapshot\_failure\_monitor\_message](#input\_velero\_volume\_snapshot\_failure\_monitor\_message) | Custom message for Velero volume snapshot failure monitor | `string` | `""` | no |
| <a name="input_velero_volume_snapshot_failure_monitor_timeframe"></a> [velero\_volume\_snapshot\_failure\_monitor\_timeframe](#input\_velero\_volume\_snapshot\_failure\_monitor\_timeframe) | Monitor timeframe for Velero volume snapshot failure monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1d"` | no |
## Outputs
| Name | Description |
|------|-------------|
| velero\_backup\_deletion\_failure\_id | id for monitor velero\_backup\_deletion\_failure |
| velero\_backup\_failure\_id | id for monitor velero\_backup\_failure |
| velero\_backup\_partial\_failure\_id | id for monitor velero\_backup\_partial\_failure |
| velero\_scheduled\_backup\_missing\_id | id for monitor velero\_scheduled\_backup\_missing |
| velero\_volume\_snapshot\_failure\_id | id for monitor velero\_volume\_snapshot\_failure |
| <a name="output_velero_backup_deletion_failure_id"></a> [velero\_backup\_deletion\_failure\_id](#output\_velero\_backup\_deletion\_failure\_id) | id for monitor velero\_backup\_deletion\_failure |
| <a name="output_velero_backup_failure_id"></a> [velero\_backup\_failure\_id](#output\_velero\_backup\_failure\_id) | id for monitor velero\_backup\_failure |
| <a name="output_velero_backup_partial_failure_id"></a> [velero\_backup\_partial\_failure\_id](#output\_velero\_backup\_partial\_failure\_id) | id for monitor velero\_backup\_partial\_failure |
| <a name="output_velero_scheduled_backup_missing_id"></a> [velero\_scheduled\_backup\_missing\_id](#output\_velero\_scheduled\_backup\_missing\_id) | id for monitor velero\_scheduled\_backup\_missing |
| <a name="output_velero_volume_snapshot_failure_id"></a> [velero\_volume\_snapshot\_failure\_id](#output\_velero\_volume\_snapshot\_failure\_id) | id for monitor velero\_volume\_snapshot\_failure |
## Related documentation
Documentation for Datadog prometheus intergration: https://docs.datadoghq.com/integrations/prometheus/

0
caas/kubernetes/velero/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/velero/modules.tf Normal file → Executable file
View File

30
caas/kubernetes/velero/monitors-velero.tf Normal file → Executable file
View File

@ -8,7 +8,7 @@ resource "datadog_monitor" "velero_scheduled_backup_missing" {
sum(${var.velero_scheduled_backup_missing_monitor_timeframe}):sum:velero.velero_backup_success_total${module.filter-tags-scheduled-backup.query_alert} by {cluster-name,schedule}.as_count() < 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
}
@ -25,10 +25,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:openmetrics", "resource:velero", "team:claranet", "created-by:terraform"], var.velero_scheduled_backup_missing_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "velero_backup_failure" {
@ -41,7 +37,7 @@ resource "datadog_monitor" "velero_backup_failure" {
sum(${var.velero_backup_failure_monitor_timeframe}):min:velero.velero_backup_failure_total${module.filter-tags.query_alert} by {schedule}.as_count() > 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
warning = 0
}
@ -58,10 +54,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:openmetrics", "resource:velero", "team:claranet", "created-by:terraform"], var.velero_backup_failure_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "velero_backup_partial_failure" {
@ -74,7 +66,7 @@ resource "datadog_monitor" "velero_backup_partial_failure" {
sum(${var.velero_backup_partial_failure_monitor_timeframe}):min:velero.velero_backup_partial_failure_total${module.filter-tags.query_alert} by {schedule}.as_count() > 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
warning = 0
}
@ -91,10 +83,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:openmetrics", "resource:velero", "team:claranet", "created-by:terraform"], var.velero_backup_partial_failure_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "velero_backup_deletion_failure" {
@ -107,7 +95,7 @@ resource "datadog_monitor" "velero_backup_deletion_failure" {
sum(${var.velero_backup_deletion_failure_monitor_timeframe}):min:velero.velero_backup_deletion_failure_total${module.filter-tags.query_alert} by {schedule}.as_count() > 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
warning = 0
}
@ -124,10 +112,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:openmetrics", "resource:velero", "team:claranet", "created-by:terraform"], var.velero_backup_deletion_failure_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "velero_volume_snapshot_failure" {
@ -140,7 +124,7 @@ resource "datadog_monitor" "velero_volume_snapshot_failure" {
sum(${var.velero_volume_snapshot_failure_monitor_timeframe}):min:velero.velero_volume_snapshot_failure_total${module.filter-tags.query_alert} by {schedule}.as_count() > 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
warning = 0
}
@ -157,9 +141,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:openmetrics", "resource:velero", "team:claranet", "created-by:terraform"], var.velero_volume_snapshot_failure_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/velero/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/velero/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

106
caas/kubernetes/workload/README.md Normal file → Executable file
View File

@ -27,58 +27,80 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.cronjob](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.job](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.replica_available](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.replica_current](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.replica_ready](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| cronjob\_enabled | Flag to enable Cronjob monitor | `string` | `"true"` | no |
| cronjob\_extra\_tags | Extra tags for Cronjob monitor | `list(string)` | `[]` | no |
| cronjob\_message | Custom message for Cronjob monitor | `string` | `""` | no |
| cronjob\_threshold\_warning | Cronjob monitor (warning threshold) | `string` | `3` | no |
| environment | Architecture environment | `any` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| job\_enabled | Flag to enable Job monitor | `string` | `"true"` | no |
| job\_extra\_tags | Extra tags for Job monitor | `list(string)` | `[]` | no |
| job\_message | Custom message for Job monitor | `string` | `""` | no |
| job\_threshold\_warning | Job monitor (warning threshold) | `string` | `3` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| replica\_available\_enabled | Flag to enable Available replica monitor | `string` | `"true"` | no |
| replica\_available\_extra\_tags | Extra tags for Available replicamonitor | `list(string)` | `[]` | no |
| replica\_available\_message | Custom message for Available replica monitor | `string` | `""` | no |
| replica\_available\_threshold\_critical | Available replica critical threshold | `number` | `1` | no |
| replica\_available\_time\_aggregator | Monitor aggregator for Available replica [available values: min, max or avg] | `string` | `"max"` | no |
| replica\_available\_timeframe | Monitor timeframe for Available replica [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| replica\_current\_enabled | Flag to enable Current replica monitor | `string` | `"true"` | no |
| replica\_current\_extra\_tags | Extra tags for Current replica monitor | `list(string)` | `[]` | no |
| replica\_current\_message | Custom message for Current replica monitor | `string` | `""` | no |
| replica\_current\_threshold\_critical | Current replica critical threshold | `number` | `1` | no |
| replica\_current\_time\_aggregator | Monitor aggregator for Current replica [available values: min, max or avg] | `string` | `"max"` | no |
| replica\_current\_timeframe | Monitor timeframe for Current replica [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| replica\_ready\_enabled | Flag to enable Ready replica monitor | `string` | `"true"` | no |
| replica\_ready\_extra\_tags | Extra tags for Ready replica monitor | `list(string)` | `[]` | no |
| replica\_ready\_message | Custom message for Ready replica monitor | `string` | `""` | no |
| replica\_ready\_threshold\_critical | Ready replica critical threshold | `number` | `1` | no |
| replica\_ready\_time\_aggregator | Monitor aggregator for Ready replica [available values: min, max or avg] | `string` | `"max"` | no |
| replica\_ready\_timeframe | Monitor timeframe for Ready replica [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_cronjob_enabled"></a> [cronjob\_enabled](#input\_cronjob\_enabled) | Flag to enable Cronjob monitor | `string` | `"true"` | no |
| <a name="input_cronjob_extra_tags"></a> [cronjob\_extra\_tags](#input\_cronjob\_extra\_tags) | Extra tags for Cronjob monitor | `list(string)` | `[]` | no |
| <a name="input_cronjob_message"></a> [cronjob\_message](#input\_cronjob\_message) | Custom message for Cronjob monitor | `string` | `""` | no |
| <a name="input_cronjob_threshold_warning"></a> [cronjob\_threshold\_warning](#input\_cronjob\_threshold\_warning) | Cronjob monitor (warning threshold) | `string` | `3` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `any` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_job_enabled"></a> [job\_enabled](#input\_job\_enabled) | Flag to enable Job monitor | `string` | `"true"` | no |
| <a name="input_job_extra_tags"></a> [job\_extra\_tags](#input\_job\_extra\_tags) | Extra tags for Job monitor | `list(string)` | `[]` | no |
| <a name="input_job_message"></a> [job\_message](#input\_job\_message) | Custom message for Job monitor | `string` | `""` | no |
| <a name="input_job_threshold_warning"></a> [job\_threshold\_warning](#input\_job\_threshold\_warning) | Job monitor (warning threshold) | `string` | `3` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_replica_available_enabled"></a> [replica\_available\_enabled](#input\_replica\_available\_enabled) | Flag to enable Available replica monitor | `string` | `"true"` | no |
| <a name="input_replica_available_extra_tags"></a> [replica\_available\_extra\_tags](#input\_replica\_available\_extra\_tags) | Extra tags for Available replicamonitor | `list(string)` | `[]` | no |
| <a name="input_replica_available_message"></a> [replica\_available\_message](#input\_replica\_available\_message) | Custom message for Available replica monitor | `string` | `""` | no |
| <a name="input_replica_available_threshold_critical"></a> [replica\_available\_threshold\_critical](#input\_replica\_available\_threshold\_critical) | Available replica critical threshold | `number` | `1` | no |
| <a name="input_replica_available_time_aggregator"></a> [replica\_available\_time\_aggregator](#input\_replica\_available\_time\_aggregator) | Monitor aggregator for Available replica [available values: min, max or avg] | `string` | `"max"` | no |
| <a name="input_replica_available_timeframe"></a> [replica\_available\_timeframe](#input\_replica\_available\_timeframe) | Monitor timeframe for Available replica [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| <a name="input_replica_current_enabled"></a> [replica\_current\_enabled](#input\_replica\_current\_enabled) | Flag to enable Current replica monitor | `string` | `"true"` | no |
| <a name="input_replica_current_extra_tags"></a> [replica\_current\_extra\_tags](#input\_replica\_current\_extra\_tags) | Extra tags for Current replica monitor | `list(string)` | `[]` | no |
| <a name="input_replica_current_message"></a> [replica\_current\_message](#input\_replica\_current\_message) | Custom message for Current replica monitor | `string` | `""` | no |
| <a name="input_replica_current_threshold_critical"></a> [replica\_current\_threshold\_critical](#input\_replica\_current\_threshold\_critical) | Current replica critical threshold | `number` | `1` | no |
| <a name="input_replica_current_time_aggregator"></a> [replica\_current\_time\_aggregator](#input\_replica\_current\_time\_aggregator) | Monitor aggregator for Current replica [available values: min, max or avg] | `string` | `"max"` | no |
| <a name="input_replica_current_timeframe"></a> [replica\_current\_timeframe](#input\_replica\_current\_timeframe) | Monitor timeframe for Current replica [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| <a name="input_replica_ready_enabled"></a> [replica\_ready\_enabled](#input\_replica\_ready\_enabled) | Flag to enable Ready replica monitor | `string` | `"true"` | no |
| <a name="input_replica_ready_extra_tags"></a> [replica\_ready\_extra\_tags](#input\_replica\_ready\_extra\_tags) | Extra tags for Ready replica monitor | `list(string)` | `[]` | no |
| <a name="input_replica_ready_message"></a> [replica\_ready\_message](#input\_replica\_ready\_message) | Custom message for Ready replica monitor | `string` | `""` | no |
| <a name="input_replica_ready_threshold_critical"></a> [replica\_ready\_threshold\_critical](#input\_replica\_ready\_threshold\_critical) | Ready replica critical threshold | `number` | `1` | no |
| <a name="input_replica_ready_time_aggregator"></a> [replica\_ready\_time\_aggregator](#input\_replica\_ready\_time\_aggregator) | Monitor aggregator for Ready replica [available values: min, max or avg] | `string` | `"max"` | no |
| <a name="input_replica_ready_timeframe"></a> [replica\_ready\_timeframe](#input\_replica\_ready\_timeframe) | Monitor timeframe for Ready replica [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 |
|------|-------------|
| cronjob\_id | id for monitor cronjob |
| job\_id | id for monitor job |
| replica\_available\_id | id for monitor replica\_available |
| replica\_current\_id | id for monitor replica\_current |
| replica\_ready\_id | id for monitor replica\_ready |
| <a name="output_cronjob_id"></a> [cronjob\_id](#output\_cronjob\_id) | id for monitor cronjob |
| <a name="output_job_id"></a> [job\_id](#output\_job\_id) | id for monitor job |
| <a name="output_replica_available_id"></a> [replica\_available\_id](#output\_replica\_available\_id) | id for monitor replica\_available |
| <a name="output_replica_current_id"></a> [replica\_current\_id](#output\_replica\_current\_id) | id for monitor replica\_current |
| <a name="output_replica_ready_id"></a> [replica\_ready\_id](#output\_replica\_ready\_id) | id for monitor replica\_ready |
## Related documentation
* [Datadog metrics](https://docs.datadoghq.com/agent/kubernetes/metrics/)

0
caas/kubernetes/workload/inputs.tf Normal file → Executable file
View File

0
caas/kubernetes/workload/modules.tf Normal file → Executable file
View File

30
caas/kubernetes/workload/monitors-k8s-workload.tf Normal file → Executable file
View File

@ -8,7 +8,7 @@ resource "datadog_monitor" "job" {
"kubernetes_state.job.complete"${module.filter-tags.service_check}.by("job_name").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.job_threshold_warning
critical = 5
}
@ -23,10 +23,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.job_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "cronjob" {
@ -39,7 +35,7 @@ resource "datadog_monitor" "cronjob" {
"kubernetes_state.cronjob.on_schedule_check"${module.filter-tags.service_check}.by("cronjob").last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.cronjob_threshold_warning
critical = 5
}
@ -54,10 +50,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.cronjob_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "replica_available" {
@ -73,7 +65,7 @@ resource "datadog_monitor" "replica_available" {
+ 1 < ${var.replica_available_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.replica_available_threshold_critical
}
@ -88,10 +80,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.replica_available_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "replica_ready" {
@ -107,7 +95,7 @@ resource "datadog_monitor" "replica_ready" {
+ 1 < ${var.replica_available_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.replica_ready_threshold_critical
}
@ -122,10 +110,6 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.replica_ready_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "replica_current" {
@ -141,7 +125,7 @@ resource "datadog_monitor" "replica_current" {
+ 1 < ${var.replica_available_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.replica_current_threshold_critical
}
@ -156,9 +140,5 @@ EOQ
require_full_window = true
tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-workload", "team:claranet", "created-by:terraform"], var.replica_current_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
caas/kubernetes/workload/outputs.tf Normal file → Executable file
View File

5
caas/kubernetes/workload/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

BIN
cloud/aws/.DS_Store vendored Normal file

Binary file not shown.

143
cloud/aws/alb/README.md Normal file → Executable file
View File

@ -28,76 +28,99 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.ALB_httpcode_4xx](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ALB_httpcode_5xx](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ALB_httpcode_target_4xx](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ALB_httpcode_target_5xx](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ALB_latency](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.ALB_no_healthy_instances](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| alb\_no\_healthy\_instances\_enabled | Flag to enable ALB no healthy instances monitor | `string` | `"true"` | no |
| alb\_no\_healthy\_instances\_extra\_tags | Extra tags for ALB no healthy instances monitor | `list(string)` | `[]` | no |
| alb\_no\_healthy\_instances\_message | Custom message for ALB no healthy instances monitor | `string` | `""` | no |
| alb\_no\_healthy\_instances\_no\_data\_timeframe | Number of minutes before reporting no data | `string` | `10` | no |
| alb\_no\_healthy\_instances\_threshold\_warning | ALB no healthy instances warning threshold in percentage | `number` | `100` | no |
| alb\_no\_healthy\_instances\_time\_aggregator | Monitor aggregator for ALB no healthy instances [available values: min, max or avg] | `string` | `"min"` | no |
| alb\_no\_healthy\_instances\_timeframe | Monitor timeframe for ALB no healthy instances [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| artificial\_requests\_count | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no |
| environment | Architecture environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `900` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| httpcode\_alb\_4xx\_enabled | Flag to enable ALB httpcode 4xx monitor | `string` | `"true"` | no |
| httpcode\_alb\_4xx\_extra\_tags | Extra tags for ALB httpcode 4xx monitor | `list(string)` | `[]` | no |
| httpcode\_alb\_4xx\_message | Custom message for ALB httpcode 4xx monitor | `string` | `""` | no |
| httpcode\_alb\_4xx\_threshold\_critical | loadbalancer 4xx critical threshold in percentage | `number` | `80` | no |
| httpcode\_alb\_4xx\_threshold\_warning | loadbalancer 4xx warning threshold in percentage | `number` | `60` | no |
| httpcode\_alb\_4xx\_time\_aggregator | Monitor aggregator for ALB httpcode 4xx [available values: min, max or avg] | `string` | `"min"` | no |
| httpcode\_alb\_4xx\_timeframe | Monitor timeframe for ALB httpcode 4xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| httpcode\_alb\_5xx\_enabled | Flag to enable ALB httpcode 5xx monitor | `string` | `"true"` | no |
| httpcode\_alb\_5xx\_extra\_tags | Extra tags for ALB httpcode 5xx monitor | `list(string)` | `[]` | no |
| httpcode\_alb\_5xx\_message | Custom message for ALB httpcode 5xx monitor | `string` | `""` | no |
| httpcode\_alb\_5xx\_threshold\_critical | loadbalancer 5xx critical threshold in percentage | `number` | `80` | no |
| httpcode\_alb\_5xx\_threshold\_warning | loadbalancer 5xx warning threshold in percentage | `number` | `60` | no |
| httpcode\_alb\_5xx\_time\_aggregator | Monitor aggregator for ALB httpcode 5xx [available values: min, max or avg] | `string` | `"min"` | no |
| httpcode\_alb\_5xx\_timeframe | Monitor timeframe for ALB httpcode 5xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| httpcode\_target\_4xx\_enabled | Flag to enable ALB target httpcode 4xx monitor | `string` | `"true"` | no |
| httpcode\_target\_4xx\_extra\_tags | Extra tags for ALB target httpcode 4xx monitor | `list(string)` | `[]` | no |
| httpcode\_target\_4xx\_message | Custom message for ALB target httpcode 4xx monitor | `string` | `""` | no |
| httpcode\_target\_4xx\_threshold\_critical | target 4xx critical threshold in percentage | `number` | `80` | no |
| httpcode\_target\_4xx\_threshold\_warning | target 4xx warning threshold in percentage | `number` | `60` | no |
| httpcode\_target\_4xx\_time\_aggregator | Monitor aggregator for ALB target httpcode 4xx [available values: min, max or avg] | `string` | `"min"` | no |
| httpcode\_target\_4xx\_timeframe | Monitor timeframe for ALB target httpcode 4xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| httpcode\_target\_5xx\_enabled | Flag to enable ALB target httpcode 5xx monitor | `string` | `"true"` | no |
| httpcode\_target\_5xx\_extra\_tags | Extra tags for ALB target httpcode 5xx monitor | `list(string)` | `[]` | no |
| httpcode\_target\_5xx\_message | Custom message for ALB target httpcode 5xx monitor | `string` | `""` | no |
| httpcode\_target\_5xx\_threshold\_critical | target 5xx critical threshold in percentage | `number` | `80` | no |
| httpcode\_target\_5xx\_threshold\_warning | target 5xx warning threshold in percentage | `number` | `60` | no |
| httpcode\_target\_5xx\_time\_aggregator | Monitor aggregator for ALB target httpcode 5xx [available values: min, max or avg] | `string` | `"min"` | no |
| httpcode\_target\_5xx\_timeframe | Monitor timeframe for ALB target httpcode 5xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| latency\_enabled | Flag to enable ALB latency monitor | `string` | `"true"` | no |
| latency\_extra\_tags | Extra tags for ALB latency monitor | `list(string)` | `[]` | no |
| latency\_message | Custom message for ALB latency monitor | `string` | `""` | no |
| latency\_threshold\_critical | latency critical threshold in seconds | `number` | `3` | no |
| latency\_threshold\_warning | latency warning threshold in seconds | `number` | `1` | no |
| latency\_time\_aggregator | Monitor aggregator for ALB latency [available values: min, max or avg] | `string` | `"min"` | no |
| latency\_timeframe | Monitor timeframe for ALB latency [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 monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_alb_no_healthy_instances_enabled"></a> [alb\_no\_healthy\_instances\_enabled](#input\_alb\_no\_healthy\_instances\_enabled) | Flag to enable ALB no healthy instances monitor | `string` | `"true"` | no |
| <a name="input_alb_no_healthy_instances_extra_tags"></a> [alb\_no\_healthy\_instances\_extra\_tags](#input\_alb\_no\_healthy\_instances\_extra\_tags) | Extra tags for ALB no healthy instances monitor | `list(string)` | `[]` | no |
| <a name="input_alb_no_healthy_instances_message"></a> [alb\_no\_healthy\_instances\_message](#input\_alb\_no\_healthy\_instances\_message) | Custom message for ALB no healthy instances monitor | `string` | `""` | no |
| <a name="input_alb_no_healthy_instances_no_data_timeframe"></a> [alb\_no\_healthy\_instances\_no\_data\_timeframe](#input\_alb\_no\_healthy\_instances\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no |
| <a name="input_alb_no_healthy_instances_threshold_warning"></a> [alb\_no\_healthy\_instances\_threshold\_warning](#input\_alb\_no\_healthy\_instances\_threshold\_warning) | ALB no healthy instances warning threshold in percentage | `number` | `100` | no |
| <a name="input_alb_no_healthy_instances_time_aggregator"></a> [alb\_no\_healthy\_instances\_time\_aggregator](#input\_alb\_no\_healthy\_instances\_time\_aggregator) | Monitor aggregator for ALB no healthy instances [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_alb_no_healthy_instances_timeframe"></a> [alb\_no\_healthy\_instances\_timeframe](#input\_alb\_no\_healthy\_instances\_timeframe) | Monitor timeframe for ALB no healthy instances [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_artificial_requests_count"></a> [artificial\_requests\_count](#input\_artificial\_requests\_count) | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_httpcode_alb_4xx_enabled"></a> [httpcode\_alb\_4xx\_enabled](#input\_httpcode\_alb\_4xx\_enabled) | Flag to enable ALB httpcode 4xx monitor | `string` | `"true"` | no |
| <a name="input_httpcode_alb_4xx_extra_tags"></a> [httpcode\_alb\_4xx\_extra\_tags](#input\_httpcode\_alb\_4xx\_extra\_tags) | Extra tags for ALB httpcode 4xx monitor | `list(string)` | `[]` | no |
| <a name="input_httpcode_alb_4xx_message"></a> [httpcode\_alb\_4xx\_message](#input\_httpcode\_alb\_4xx\_message) | Custom message for ALB httpcode 4xx monitor | `string` | `""` | no |
| <a name="input_httpcode_alb_4xx_threshold_critical"></a> [httpcode\_alb\_4xx\_threshold\_critical](#input\_httpcode\_alb\_4xx\_threshold\_critical) | loadbalancer 4xx critical threshold in percentage | `number` | `80` | no |
| <a name="input_httpcode_alb_4xx_threshold_warning"></a> [httpcode\_alb\_4xx\_threshold\_warning](#input\_httpcode\_alb\_4xx\_threshold\_warning) | loadbalancer 4xx warning threshold in percentage | `number` | `60` | no |
| <a name="input_httpcode_alb_4xx_time_aggregator"></a> [httpcode\_alb\_4xx\_time\_aggregator](#input\_httpcode\_alb\_4xx\_time\_aggregator) | Monitor aggregator for ALB httpcode 4xx [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_httpcode_alb_4xx_timeframe"></a> [httpcode\_alb\_4xx\_timeframe](#input\_httpcode\_alb\_4xx\_timeframe) | Monitor timeframe for ALB httpcode 4xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_httpcode_alb_5xx_enabled"></a> [httpcode\_alb\_5xx\_enabled](#input\_httpcode\_alb\_5xx\_enabled) | Flag to enable ALB httpcode 5xx monitor | `string` | `"true"` | no |
| <a name="input_httpcode_alb_5xx_extra_tags"></a> [httpcode\_alb\_5xx\_extra\_tags](#input\_httpcode\_alb\_5xx\_extra\_tags) | Extra tags for ALB httpcode 5xx monitor | `list(string)` | `[]` | no |
| <a name="input_httpcode_alb_5xx_message"></a> [httpcode\_alb\_5xx\_message](#input\_httpcode\_alb\_5xx\_message) | Custom message for ALB httpcode 5xx monitor | `string` | `""` | no |
| <a name="input_httpcode_alb_5xx_threshold_critical"></a> [httpcode\_alb\_5xx\_threshold\_critical](#input\_httpcode\_alb\_5xx\_threshold\_critical) | loadbalancer 5xx critical threshold in percentage | `number` | `80` | no |
| <a name="input_httpcode_alb_5xx_threshold_warning"></a> [httpcode\_alb\_5xx\_threshold\_warning](#input\_httpcode\_alb\_5xx\_threshold\_warning) | loadbalancer 5xx warning threshold in percentage | `number` | `60` | no |
| <a name="input_httpcode_alb_5xx_time_aggregator"></a> [httpcode\_alb\_5xx\_time\_aggregator](#input\_httpcode\_alb\_5xx\_time\_aggregator) | Monitor aggregator for ALB httpcode 5xx [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_httpcode_alb_5xx_timeframe"></a> [httpcode\_alb\_5xx\_timeframe](#input\_httpcode\_alb\_5xx\_timeframe) | Monitor timeframe for ALB httpcode 5xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_httpcode_target_4xx_enabled"></a> [httpcode\_target\_4xx\_enabled](#input\_httpcode\_target\_4xx\_enabled) | Flag to enable ALB target httpcode 4xx monitor | `string` | `"true"` | no |
| <a name="input_httpcode_target_4xx_extra_tags"></a> [httpcode\_target\_4xx\_extra\_tags](#input\_httpcode\_target\_4xx\_extra\_tags) | Extra tags for ALB target httpcode 4xx monitor | `list(string)` | `[]` | no |
| <a name="input_httpcode_target_4xx_message"></a> [httpcode\_target\_4xx\_message](#input\_httpcode\_target\_4xx\_message) | Custom message for ALB target httpcode 4xx monitor | `string` | `""` | no |
| <a name="input_httpcode_target_4xx_threshold_critical"></a> [httpcode\_target\_4xx\_threshold\_critical](#input\_httpcode\_target\_4xx\_threshold\_critical) | target 4xx critical threshold in percentage | `number` | `80` | no |
| <a name="input_httpcode_target_4xx_threshold_warning"></a> [httpcode\_target\_4xx\_threshold\_warning](#input\_httpcode\_target\_4xx\_threshold\_warning) | target 4xx warning threshold in percentage | `number` | `60` | no |
| <a name="input_httpcode_target_4xx_time_aggregator"></a> [httpcode\_target\_4xx\_time\_aggregator](#input\_httpcode\_target\_4xx\_time\_aggregator) | Monitor aggregator for ALB target httpcode 4xx [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_httpcode_target_4xx_timeframe"></a> [httpcode\_target\_4xx\_timeframe](#input\_httpcode\_target\_4xx\_timeframe) | Monitor timeframe for ALB target httpcode 4xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_httpcode_target_5xx_enabled"></a> [httpcode\_target\_5xx\_enabled](#input\_httpcode\_target\_5xx\_enabled) | Flag to enable ALB target httpcode 5xx monitor | `string` | `"true"` | no |
| <a name="input_httpcode_target_5xx_extra_tags"></a> [httpcode\_target\_5xx\_extra\_tags](#input\_httpcode\_target\_5xx\_extra\_tags) | Extra tags for ALB target httpcode 5xx monitor | `list(string)` | `[]` | no |
| <a name="input_httpcode_target_5xx_message"></a> [httpcode\_target\_5xx\_message](#input\_httpcode\_target\_5xx\_message) | Custom message for ALB target httpcode 5xx monitor | `string` | `""` | no |
| <a name="input_httpcode_target_5xx_threshold_critical"></a> [httpcode\_target\_5xx\_threshold\_critical](#input\_httpcode\_target\_5xx\_threshold\_critical) | target 5xx critical threshold in percentage | `number` | `80` | no |
| <a name="input_httpcode_target_5xx_threshold_warning"></a> [httpcode\_target\_5xx\_threshold\_warning](#input\_httpcode\_target\_5xx\_threshold\_warning) | target 5xx warning threshold in percentage | `number` | `60` | no |
| <a name="input_httpcode_target_5xx_time_aggregator"></a> [httpcode\_target\_5xx\_time\_aggregator](#input\_httpcode\_target\_5xx\_time\_aggregator) | Monitor aggregator for ALB target httpcode 5xx [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_httpcode_target_5xx_timeframe"></a> [httpcode\_target\_5xx\_timeframe](#input\_httpcode\_target\_5xx\_timeframe) | Monitor timeframe for ALB target httpcode 5xx [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_latency_enabled"></a> [latency\_enabled](#input\_latency\_enabled) | Flag to enable ALB latency monitor | `string` | `"true"` | no |
| <a name="input_latency_extra_tags"></a> [latency\_extra\_tags](#input\_latency\_extra\_tags) | Extra tags for ALB latency monitor | `list(string)` | `[]` | no |
| <a name="input_latency_message"></a> [latency\_message](#input\_latency\_message) | Custom message for ALB latency monitor | `string` | `""` | no |
| <a name="input_latency_threshold_critical"></a> [latency\_threshold\_critical](#input\_latency\_threshold\_critical) | latency critical threshold in seconds | `number` | `3` | no |
| <a name="input_latency_threshold_warning"></a> [latency\_threshold\_warning](#input\_latency\_threshold\_warning) | latency warning threshold in seconds | `number` | `1` | no |
| <a name="input_latency_time_aggregator"></a> [latency\_time\_aggregator](#input\_latency\_time\_aggregator) | Monitor aggregator for ALB latency [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_latency_timeframe"></a> [latency\_timeframe](#input\_latency\_timeframe) | Monitor timeframe for ALB latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| ALB\_httpcode\_4xx\_id | id for monitor ALB\_httpcode\_4xx |
| ALB\_httpcode\_5xx\_id | id for monitor ALB\_httpcode\_5xx |
| ALB\_httpcode\_target\_4xx\_id | id for monitor ALB\_httpcode\_target\_4xx |
| ALB\_httpcode\_target\_5xx\_id | id for monitor ALB\_httpcode\_target\_5xx |
| ALB\_latency\_id | id for monitor ALB\_latency |
| ALB\_no\_healthy\_instances\_id | id for monitor ALB\_no\_healthy\_instances |
| <a name="output_ALB_httpcode_4xx_id"></a> [ALB\_httpcode\_4xx\_id](#output\_ALB\_httpcode\_4xx\_id) | id for monitor ALB\_httpcode\_4xx |
| <a name="output_ALB_httpcode_5xx_id"></a> [ALB\_httpcode\_5xx\_id](#output\_ALB\_httpcode\_5xx\_id) | id for monitor ALB\_httpcode\_5xx |
| <a name="output_ALB_httpcode_target_4xx_id"></a> [ALB\_httpcode\_target\_4xx\_id](#output\_ALB\_httpcode\_target\_4xx\_id) | id for monitor ALB\_httpcode\_target\_4xx |
| <a name="output_ALB_httpcode_target_5xx_id"></a> [ALB\_httpcode\_target\_5xx\_id](#output\_ALB\_httpcode\_target\_5xx\_id) | id for monitor ALB\_httpcode\_target\_5xx |
| <a name="output_ALB_latency_id"></a> [ALB\_latency\_id](#output\_ALB\_latency\_id) | id for monitor ALB\_latency |
| <a name="output_ALB_no_healthy_instances_id"></a> [ALB\_no\_healthy\_instances\_id](#output\_ALB\_no\_healthy\_instances\_id) | id for monitor ALB\_no\_healthy\_instances |
## Related documentation
DataDog blog: [https://www.datadoghq.com/blog/monitor-application-load-balancer/](https://www.datadoghq.com/blog/monitor-application-load-balancer/)

0
cloud/aws/alb/inputs.tf Normal file → Executable file
View File

0
cloud/aws/alb/modules.tf Normal file → Executable file
View File

36
cloud/aws/alb/monitors-alb.tf Normal file → Executable file
View File

@ -12,7 +12,7 @@ resource "datadog_monitor" "ALB_no_healthy_instances" {
) * 100 < 1
EOQ
thresholds = {
monitor_thresholds {
critical = 1
warning = var.alb_no_healthy_instances_threshold_warning
}
@ -27,10 +27,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.alb_no_healthy_instances_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "ALB_latency" {
@ -45,7 +41,7 @@ resource "datadog_monitor" "ALB_latency" {
> ${var.latency_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.latency_threshold_critical
warning = var.latency_threshold_warning
}
@ -59,10 +55,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "ALB_httpcode_5xx" {
@ -78,7 +70,7 @@ resource "datadog_monitor" "ALB_httpcode_5xx" {
* 100 > ${var.httpcode_alb_5xx_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.httpcode_alb_5xx_threshold_critical
warning = var.httpcode_alb_5xx_threshold_warning
}
@ -92,10 +84,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_alb_5xx_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "ALB_httpcode_4xx" {
@ -111,7 +99,7 @@ resource "datadog_monitor" "ALB_httpcode_4xx" {
* 100 > ${var.httpcode_alb_4xx_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.httpcode_alb_4xx_threshold_critical
warning = var.httpcode_alb_4xx_threshold_warning
}
@ -125,10 +113,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_alb_4xx_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "ALB_httpcode_target_5xx" {
@ -144,7 +128,7 @@ resource "datadog_monitor" "ALB_httpcode_target_5xx" {
* 100 > ${var.httpcode_target_5xx_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.httpcode_target_5xx_threshold_critical
warning = var.httpcode_target_5xx_threshold_warning
}
@ -158,10 +142,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_5xx_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "ALB_httpcode_target_4xx" {
@ -177,7 +157,7 @@ resource "datadog_monitor" "ALB_httpcode_target_4xx" {
* 100 > ${var.httpcode_target_4xx_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.httpcode_target_4xx_threshold_critical
warning = var.httpcode_target_4xx_threshold_warning
}
@ -191,9 +171,5 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.httpcode_target_4xx_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
cloud/aws/alb/outputs.tf Normal file → Executable file
View File

5
cloud/aws/alb/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

86
cloud/aws/apigateway/README.md Normal file → Executable file
View File

@ -25,50 +25,68 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
No modules.
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.API_Gateway_latency](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.API_http_4xx_errors_count](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.API_http_5xx_errors_count](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| artificial\_requests\_count | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no |
| environment | Environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `900` | no |
| filter\_tags | Tags used for filtering | `string` | `"*"` | no |
| http\_4xx\_requests\_enabled | Flag to enable API Gateway HTTP 4xx requests monitor | `string` | `"true"` | no |
| http\_4xx\_requests\_extra\_tags | Extra tags for API Gateway HTTP 4xx requests monitor | `list(string)` | `[]` | no |
| http\_4xx\_requests\_message | Custom message for API Gateway HTTP 4xx requests monitor | `string` | `""` | no |
| http\_4xx\_requests\_threshold\_critical | Maximum critical acceptable percent of 4xx errors | `number` | `30` | no |
| http\_4xx\_requests\_threshold\_warning | Maximum warning acceptable percent of 4xx errors | `number` | `15` | no |
| http\_4xx\_requests\_time\_aggregator | Monitor aggregator for API HTTP 4xx requests [available values: min, max or avg] | `string` | `"min"` | no |
| http\_4xx\_requests\_timeframe | Monitor timeframe for API HTTP 4xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| http\_5xx\_requests\_enabled | Flag to enable API Gateway HTTP 5xx requests monitor | `string` | `"true"` | no |
| http\_5xx\_requests\_extra\_tags | Extra tags for API Gateway HTTP 5xx requests monitor | `list(string)` | `[]` | no |
| http\_5xx\_requests\_message | Custom message for API Gateway HTTP 5xx requests monitor | `string` | `""` | no |
| http\_5xx\_requests\_threshold\_critical | Maximum critical acceptable percent of 5xx errors | `number` | `20` | no |
| http\_5xx\_requests\_threshold\_warning | Maximum warning acceptable percent of 5xx errors | `number` | `10` | no |
| http\_5xx\_requests\_time\_aggregator | Monitor aggregator for API HTTP 5xx requests [available values: min, max or avg] | `string` | `"min"` | no |
| http\_5xx\_requests\_timeframe | Monitor timeframe for API HTTP 5xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| latency\_enabled | Flag to enable API Gateway latency monitor | `string` | `"true"` | no |
| latency\_extra\_tags | Extra tags for API Gateway latency monitor | `list(string)` | `[]` | no |
| latency\_message | Custom message for API Gateway latency monitor | `string` | `""` | no |
| latency\_threshold\_critical | Alerting threshold in milliseconds | `number` | `3000` | no |
| latency\_threshold\_warning | Warning threshold in milliseconds | `number` | `1000` | no |
| latency\_time\_aggregator | Monitor aggregator for API Gateway latency [available values: min, max or avg] | `string` | `"min"` | no |
| latency\_timeframe | Monitor timeframe for API latency [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 monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_artificial_requests_count"></a> [artificial\_requests\_count](#input\_artificial\_requests\_count) | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no |
| <a name="input_filter_tags"></a> [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no |
| <a name="input_http_4xx_requests_enabled"></a> [http\_4xx\_requests\_enabled](#input\_http\_4xx\_requests\_enabled) | Flag to enable API Gateway HTTP 4xx requests monitor | `string` | `"true"` | no |
| <a name="input_http_4xx_requests_extra_tags"></a> [http\_4xx\_requests\_extra\_tags](#input\_http\_4xx\_requests\_extra\_tags) | Extra tags for API Gateway HTTP 4xx requests monitor | `list(string)` | `[]` | no |
| <a name="input_http_4xx_requests_message"></a> [http\_4xx\_requests\_message](#input\_http\_4xx\_requests\_message) | Custom message for API Gateway HTTP 4xx requests monitor | `string` | `""` | no |
| <a name="input_http_4xx_requests_threshold_critical"></a> [http\_4xx\_requests\_threshold\_critical](#input\_http\_4xx\_requests\_threshold\_critical) | Maximum critical acceptable percent of 4xx errors | `number` | `30` | no |
| <a name="input_http_4xx_requests_threshold_warning"></a> [http\_4xx\_requests\_threshold\_warning](#input\_http\_4xx\_requests\_threshold\_warning) | Maximum warning acceptable percent of 4xx errors | `number` | `15` | no |
| <a name="input_http_4xx_requests_time_aggregator"></a> [http\_4xx\_requests\_time\_aggregator](#input\_http\_4xx\_requests\_time\_aggregator) | Monitor aggregator for API HTTP 4xx requests [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_http_4xx_requests_timeframe"></a> [http\_4xx\_requests\_timeframe](#input\_http\_4xx\_requests\_timeframe) | Monitor timeframe for API HTTP 4xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_http_5xx_requests_enabled"></a> [http\_5xx\_requests\_enabled](#input\_http\_5xx\_requests\_enabled) | Flag to enable API Gateway HTTP 5xx requests monitor | `string` | `"true"` | no |
| <a name="input_http_5xx_requests_extra_tags"></a> [http\_5xx\_requests\_extra\_tags](#input\_http\_5xx\_requests\_extra\_tags) | Extra tags for API Gateway HTTP 5xx requests monitor | `list(string)` | `[]` | no |
| <a name="input_http_5xx_requests_message"></a> [http\_5xx\_requests\_message](#input\_http\_5xx\_requests\_message) | Custom message for API Gateway HTTP 5xx requests monitor | `string` | `""` | no |
| <a name="input_http_5xx_requests_threshold_critical"></a> [http\_5xx\_requests\_threshold\_critical](#input\_http\_5xx\_requests\_threshold\_critical) | Maximum critical acceptable percent of 5xx errors | `number` | `20` | no |
| <a name="input_http_5xx_requests_threshold_warning"></a> [http\_5xx\_requests\_threshold\_warning](#input\_http\_5xx\_requests\_threshold\_warning) | Maximum warning acceptable percent of 5xx errors | `number` | `10` | no |
| <a name="input_http_5xx_requests_time_aggregator"></a> [http\_5xx\_requests\_time\_aggregator](#input\_http\_5xx\_requests\_time\_aggregator) | Monitor aggregator for API HTTP 5xx requests [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_http_5xx_requests_timeframe"></a> [http\_5xx\_requests\_timeframe](#input\_http\_5xx\_requests\_timeframe) | Monitor timeframe for API HTTP 5xx requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_latency_enabled"></a> [latency\_enabled](#input\_latency\_enabled) | Flag to enable API Gateway latency monitor | `string` | `"true"` | no |
| <a name="input_latency_extra_tags"></a> [latency\_extra\_tags](#input\_latency\_extra\_tags) | Extra tags for API Gateway latency monitor | `list(string)` | `[]` | no |
| <a name="input_latency_message"></a> [latency\_message](#input\_latency\_message) | Custom message for API Gateway latency monitor | `string` | `""` | no |
| <a name="input_latency_threshold_critical"></a> [latency\_threshold\_critical](#input\_latency\_threshold\_critical) | Alerting threshold in milliseconds | `number` | `3000` | no |
| <a name="input_latency_threshold_warning"></a> [latency\_threshold\_warning](#input\_latency\_threshold\_warning) | Warning threshold in milliseconds | `number` | `1000` | no |
| <a name="input_latency_time_aggregator"></a> [latency\_time\_aggregator](#input\_latency\_time\_aggregator) | Monitor aggregator for API Gateway latency [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_latency_timeframe"></a> [latency\_timeframe](#input\_latency\_timeframe) | Monitor timeframe for API latency [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| API\_Gateway\_latency\_id | id for monitor API\_Gateway\_latency |
| API\_http\_4xx\_errors\_count\_id | id for monitor API\_http\_4xx\_errors\_count |
| API\_http\_5xx\_errors\_count\_id | id for monitor API\_http\_5xx\_errors\_count |
| <a name="output_API_Gateway_latency_id"></a> [API\_Gateway\_latency\_id](#output\_API\_Gateway\_latency\_id) | id for monitor API\_Gateway\_latency |
| <a name="output_API_http_4xx_errors_count_id"></a> [API\_http\_4xx\_errors\_count\_id](#output\_API\_http\_4xx\_errors\_count\_id) | id for monitor API\_http\_4xx\_errors\_count |
| <a name="output_API_http_5xx_errors_count_id"></a> [API\_http\_5xx\_errors\_count\_id](#output\_API\_http\_5xx\_errors\_count\_id) | id for monitor API\_http\_5xx\_errors\_count |
## Related documentation
DataDog documentation: [https://docs.datadoghq.com/integrations/amazon_api_gateway/](https://docs.datadoghq.com/integrations/amazon_api_gateway/)

0
cloud/aws/apigateway/inputs.tf Normal file → Executable file
View File

18
cloud/aws/apigateway/monitors-api.tf Normal file → Executable file
View File

@ -11,7 +11,7 @@ resource "datadog_monitor" "API_Gateway_latency" {
> ${var.latency_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
warning = var.latency_threshold_warning
critical = var.latency_threshold_critical
}
@ -25,10 +25,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.latency_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
# Monitoring API Gateway 5xx errors percent
@ -45,7 +41,7 @@ resource "datadog_monitor" "API_http_5xx_errors_count" {
* 100 > ${var.http_5xx_requests_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
warning = var.http_5xx_requests_threshold_warning
critical = var.http_5xx_requests_threshold_critical
}
@ -59,10 +55,6 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_5xx_requests_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
# Monitoring API Gateway 4xx errors percent
@ -79,7 +71,7 @@ resource "datadog_monitor" "API_http_4xx_errors_count" {
* 100 > ${var.http_4xx_requests_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
warning = var.http_4xx_requests_threshold_warning
critical = var.http_4xx_requests_threshold_critical
}
@ -93,9 +85,5 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.http_4xx_requests_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
cloud/aws/apigateway/outputs.tf Normal file → Executable file
View File

5
cloud/aws/apigateway/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

112
cloud/aws/beanstalk/README.md Normal file → Executable file
View File

@ -26,61 +26,83 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../common/filter-tags | n/a |
| <a name="module_filter-tags-no-host"></a> [filter-tags-no-host](#module\_filter-tags-no-host) | ../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.application_5xx_error_rate](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.application_latency_p90](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.health](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.root_filesystem_usage](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| application\_5xx\_error\_rate\_enabled | Flag to enable Beanstalk application 5xx error ratemonitor | `string` | `"true"` | no |
| application\_5xx\_error\_rate\_extra\_tags | Extra tags for application 5xx error rate monitor | `list(string)` | `[]` | no |
| application\_5xx\_error\_rate\_message | Custom message for application 5xx error rate | `string` | `""` | no |
| application\_5xx\_error\_rate\_threshold\_critical | 5xx Error rate critical threshold in percent | `number` | `5` | no |
| application\_5xx\_error\_rate\_threshold\_warning | 5xx Error rate warning threshold in percent | `string` | `3` | no |
| application\_5xx\_error\_rate\_time\_aggregator | Monitor aggregator for beanstalk application 5xx error rate [available values: min, max or avg] | `string` | `"sum"` | no |
| application\_5xx\_error\_rate\_timeframe | Monitor timeframe for beanstalk application 5xx error rate [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| application\_latency\_p90\_enabled | Flag to enable Beanstalk application latency P90 monitor | `string` | `"true"` | no |
| application\_latency\_p90\_extra\_tags | Extra tags for application latency P90 monitor | `list(string)` | `[]` | no |
| application\_latency\_p90\_message | Custom message for application latency P90 monitor | `string` | `""` | no |
| application\_latency\_p90\_threshold\_critical | P90 Latency critical threshold in seconds | `number` | `0.5` | no |
| application\_latency\_p90\_threshold\_warning | P90 Latency warning threshold in seconds | `string` | `0.3` | no |
| application\_latency\_p90\_time\_aggregator | Monitor aggregator for beanstalk application latency P90 [available values: min, max or avg] | `string` | `"min"` | no |
| application\_latency\_p90\_timeframe | Monitor timeframe for beanstalk application latency P90 [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| environment | Architecture Environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `900` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| health\_enabled | Flag to enable Beanstalk Health monitor | `string` | `"true"` | no |
| health\_extra\_tags | Extra tags for health monitor | `list(string)` | `[]` | no |
| health\_message | Custom message for health monitor | `string` | `""` | no |
| health\_no\_data\_timeframe | Number of minutes before reporting no data | `string` | `20` | no |
| health\_threshold\_critical | Health critical threshold (see the `aws.elasticbeanstalk.environment_health` values in the Datadog documentation) | `number` | `20` | no |
| health\_threshold\_warning | Health critical threshold (see the `aws.elasticbeanstalk.environment_health` values in the Datadog documentation) | `number` | `15` | no |
| health\_time\_aggregator | Monitor aggregator for beanstalk health [available values: min, max or avg] | `string` | `"min"` | no |
| health\_timeframe | Monitor timeframe for beanstalk health [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_10m"` | no |
| message | Message sent when an alert is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| root\_filesystem\_usage\_aggregator | Monitor aggregator for beanstalk instance file system usage [available values: min, max or avg] | `string` | `"max"` | no |
| root\_filesystem\_usage\_enabled | Flag to enable Beanstalk instance file system usage monitor | `string` | `"true"` | no |
| root\_filesystem\_usage\_extra\_tags | Extra tags for file system usage monitor | `list(string)` | `[]` | no |
| root\_filesystem\_usage\_message | Custom message for application file system usage | `string` | `""` | no |
| root\_filesystem\_usage\_threshold\_critical | File system usage critical threshold in percent | `string` | `90` | no |
| root\_filesystem\_usage\_threshold\_warning | File system usage warning threshold in percent | `string` | `80` | no |
| root\_filesystem\_usage\_timeframe | Monitor timeframe for beanstalk instance file system usage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| root\_filesystem\_usage\_timeout\_h | File system usage auto-resolving state (in hours) | `number` | `0` | no |
| <a name="input_application_5xx_error_rate_enabled"></a> [application\_5xx\_error\_rate\_enabled](#input\_application\_5xx\_error\_rate\_enabled) | Flag to enable Beanstalk application 5xx error ratemonitor | `string` | `"true"` | no |
| <a name="input_application_5xx_error_rate_extra_tags"></a> [application\_5xx\_error\_rate\_extra\_tags](#input\_application\_5xx\_error\_rate\_extra\_tags) | Extra tags for application 5xx error rate monitor | `list(string)` | `[]` | no |
| <a name="input_application_5xx_error_rate_message"></a> [application\_5xx\_error\_rate\_message](#input\_application\_5xx\_error\_rate\_message) | Custom message for application 5xx error rate | `string` | `""` | no |
| <a name="input_application_5xx_error_rate_threshold_critical"></a> [application\_5xx\_error\_rate\_threshold\_critical](#input\_application\_5xx\_error\_rate\_threshold\_critical) | 5xx Error rate critical threshold in percent | `number` | `5` | no |
| <a name="input_application_5xx_error_rate_threshold_warning"></a> [application\_5xx\_error\_rate\_threshold\_warning](#input\_application\_5xx\_error\_rate\_threshold\_warning) | 5xx Error rate warning threshold in percent | `string` | `3` | no |
| <a name="input_application_5xx_error_rate_time_aggregator"></a> [application\_5xx\_error\_rate\_time\_aggregator](#input\_application\_5xx\_error\_rate\_time\_aggregator) | Monitor aggregator for beanstalk application 5xx error rate [available values: min, max or avg] | `string` | `"sum"` | no |
| <a name="input_application_5xx_error_rate_timeframe"></a> [application\_5xx\_error\_rate\_timeframe](#input\_application\_5xx\_error\_rate\_timeframe) | Monitor timeframe for beanstalk application 5xx error rate [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| <a name="input_application_latency_p90_enabled"></a> [application\_latency\_p90\_enabled](#input\_application\_latency\_p90\_enabled) | Flag to enable Beanstalk application latency P90 monitor | `string` | `"true"` | no |
| <a name="input_application_latency_p90_extra_tags"></a> [application\_latency\_p90\_extra\_tags](#input\_application\_latency\_p90\_extra\_tags) | Extra tags for application latency P90 monitor | `list(string)` | `[]` | no |
| <a name="input_application_latency_p90_message"></a> [application\_latency\_p90\_message](#input\_application\_latency\_p90\_message) | Custom message for application latency P90 monitor | `string` | `""` | no |
| <a name="input_application_latency_p90_threshold_critical"></a> [application\_latency\_p90\_threshold\_critical](#input\_application\_latency\_p90\_threshold\_critical) | P90 Latency critical threshold in seconds | `number` | `0.5` | no |
| <a name="input_application_latency_p90_threshold_warning"></a> [application\_latency\_p90\_threshold\_warning](#input\_application\_latency\_p90\_threshold\_warning) | P90 Latency warning threshold in seconds | `string` | `0.3` | no |
| <a name="input_application_latency_p90_time_aggregator"></a> [application\_latency\_p90\_time\_aggregator](#input\_application\_latency\_p90\_time\_aggregator) | Monitor aggregator for beanstalk application latency P90 [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_application_latency_p90_timeframe"></a> [application\_latency\_p90\_timeframe](#input\_application\_latency\_p90\_timeframe) | Monitor timeframe for beanstalk application latency P90 [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_health_enabled"></a> [health\_enabled](#input\_health\_enabled) | Flag to enable Beanstalk Health monitor | `string` | `"true"` | no |
| <a name="input_health_extra_tags"></a> [health\_extra\_tags](#input\_health\_extra\_tags) | Extra tags for health monitor | `list(string)` | `[]` | no |
| <a name="input_health_message"></a> [health\_message](#input\_health\_message) | Custom message for health monitor | `string` | `""` | no |
| <a name="input_health_no_data_timeframe"></a> [health\_no\_data\_timeframe](#input\_health\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `20` | no |
| <a name="input_health_threshold_critical"></a> [health\_threshold\_critical](#input\_health\_threshold\_critical) | Health critical threshold (see the `aws.elasticbeanstalk.environment_health` values in the Datadog documentation) | `number` | `20` | no |
| <a name="input_health_threshold_warning"></a> [health\_threshold\_warning](#input\_health\_threshold\_warning) | Health critical threshold (see the `aws.elasticbeanstalk.environment_health` values in the Datadog documentation) | `number` | `15` | no |
| <a name="input_health_time_aggregator"></a> [health\_time\_aggregator](#input\_health\_time\_aggregator) | Monitor aggregator for beanstalk health [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_health_timeframe"></a> [health\_timeframe](#input\_health\_timeframe) | Monitor timeframe for beanstalk health [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_10m"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when an alert is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_root_filesystem_usage_aggregator"></a> [root\_filesystem\_usage\_aggregator](#input\_root\_filesystem\_usage\_aggregator) | Monitor aggregator for beanstalk instance file system usage [available values: min, max or avg] | `string` | `"max"` | no |
| <a name="input_root_filesystem_usage_enabled"></a> [root\_filesystem\_usage\_enabled](#input\_root\_filesystem\_usage\_enabled) | Flag to enable Beanstalk instance file system usage monitor | `string` | `"true"` | no |
| <a name="input_root_filesystem_usage_extra_tags"></a> [root\_filesystem\_usage\_extra\_tags](#input\_root\_filesystem\_usage\_extra\_tags) | Extra tags for file system usage monitor | `list(string)` | `[]` | no |
| <a name="input_root_filesystem_usage_message"></a> [root\_filesystem\_usage\_message](#input\_root\_filesystem\_usage\_message) | Custom message for application file system usage | `string` | `""` | no |
| <a name="input_root_filesystem_usage_threshold_critical"></a> [root\_filesystem\_usage\_threshold\_critical](#input\_root\_filesystem\_usage\_threshold\_critical) | File system usage critical threshold in percent | `string` | `90` | no |
| <a name="input_root_filesystem_usage_threshold_warning"></a> [root\_filesystem\_usage\_threshold\_warning](#input\_root\_filesystem\_usage\_threshold\_warning) | File system usage warning threshold in percent | `string` | `80` | no |
| <a name="input_root_filesystem_usage_timeframe"></a> [root\_filesystem\_usage\_timeframe](#input\_root\_filesystem\_usage\_timeframe) | Monitor timeframe for beanstalk instance file system usage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no |
| <a name="input_root_filesystem_usage_timeout_h"></a> [root\_filesystem\_usage\_timeout\_h](#input\_root\_filesystem\_usage\_timeout\_h) | File system usage auto-resolving state (in hours) | `number` | `0` | no |
## Outputs
| Name | Description |
|------|-------------|
| application\_5xx\_error\_rate\_id | id for monitor application\_5xx\_error\_rate |
| application\_latency\_p90\_id | id for monitor application\_latency\_p90 |
| health\_id | id for monitor health |
| root\_filesystem\_usage\_id | id for monitor root\_filesystem\_usage |
| <a name="output_application_5xx_error_rate_id"></a> [application\_5xx\_error\_rate\_id](#output\_application\_5xx\_error\_rate\_id) | id for monitor application\_5xx\_error\_rate |
| <a name="output_application_latency_p90_id"></a> [application\_latency\_p90\_id](#output\_application\_latency\_p90\_id) | id for monitor application\_latency\_p90 |
| <a name="output_health_id"></a> [health\_id](#output\_health\_id) | id for monitor health |
| <a name="output_root_filesystem_usage_id"></a> [root\_filesystem\_usage\_id](#output\_root\_filesystem\_usage\_id) | id for monitor root\_filesystem\_usage |
## Related documentation
Datadog documentation: [https://docs.datadoghq.com/integrations/amazon_elasticbeanstalk/](https://docs.datadoghq.com/integrations/amazon_elasticbeanstalk/)

0
cloud/aws/beanstalk/inputs.tf Normal file → Executable file
View File

0
cloud/aws/beanstalk/modules.tf Normal file → Executable file
View File

24
cloud/aws/beanstalk/monitors-beanstalk.tf Normal file → Executable file
View File

@ -9,7 +9,7 @@ resource "datadog_monitor" "health" {
${var.health_time_aggregator}(${var.health_timeframe}):min:aws.elasticbeanstalk.environment_health${module.filter-tags.query_alert} by {region,environmentname} >= ${var.health_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.health_threshold_critical
warning = var.health_threshold_warning
}
@ -25,10 +25,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.health_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "application_latency_p90" {
@ -41,7 +37,7 @@ resource "datadog_monitor" "application_latency_p90" {
${var.application_latency_p90_time_aggregator}(${var.application_latency_p90_timeframe}):min:aws.elasticbeanstalk.application_latency_p_9_0${module.filter-tags-no-host.query_alert} by {region,environmentname} >= ${var.application_latency_p90_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.application_latency_p90_threshold_critical
warning = var.application_latency_p90_threshold_warning
}
@ -56,10 +52,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.application_latency_p90_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "application_5xx_error_rate" {
@ -72,7 +64,7 @@ resource "datadog_monitor" "application_5xx_error_rate" {
${var.application_5xx_error_rate_time_aggregator}(${var.application_5xx_error_rate_timeframe}):sum:aws.elasticbeanstalk.application_requests_5xx${module.filter-tags-no-host.query_alert} by {region,environmentname}.as_rate() / sum:aws.elasticbeanstalk.application_requests_total${module.filter-tags-no-host.query_alert} by {region,environmentname}.as_rate() * 100 > ${var.application_5xx_error_rate_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.application_5xx_error_rate_threshold_critical
warning = var.application_5xx_error_rate_threshold_warning
}
@ -87,10 +79,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.application_5xx_error_rate_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "root_filesystem_usage" {
@ -103,7 +91,7 @@ resource "datadog_monitor" "root_filesystem_usage" {
${var.root_filesystem_usage_aggregator}(${var.root_filesystem_usage_timeframe}):min:aws.elasticbeanstalk.root_filesystem_util${module.filter-tags.query_alert} by {region,environmentname,host} > ${var.root_filesystem_usage_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.root_filesystem_usage_threshold_critical
warning = var.root_filesystem_usage_threshold_warning
}
@ -118,9 +106,5 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.root_filesystem_usage_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
cloud/aws/beanstalk/outputs.tf Normal file → Executable file
View File

5
cloud/aws/beanstalk/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

0
cloud/aws/ecs/common/MANIFEST.txt Normal file → Executable file
View File

92
cloud/aws/ecs/common/README.md Normal file → Executable file
View File

@ -25,51 +25,71 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.service_cpu_utilization](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.service_memory_utilization](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.service_missing_tasks](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| environment | Architecture environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `900` | no |
| filter\_tags | Tags used for filtering | `string` | `"*"` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| service\_cpu\_utilization\_enabled | Flag to enable Service CPU Utilization monitor | `string` | `"false"` | no |
| service\_cpu\_utilization\_extra\_tags | Extra tags for Service CPU Utilization monitor | `list(string)` | `[]` | no |
| service\_cpu\_utilization\_message | Custom message for the Service CPU Utilization monitor | `string` | `""` | no |
| service\_cpu\_utilization\_threshold\_critical | Critical threshold for the Service CPU Utilization monitor | `string` | `"90"` | no |
| service\_cpu\_utilization\_threshold\_warning | Warning threshold for the Service CPU Utilization monitor | `string` | `"80"` | no |
| service\_cpu\_utilization\_time\_aggregator | Monitor aggregator for Service CPU Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| service\_cpu\_utilization\_timeframe | Timeframe for the Service CPU Utilization monitor | `string` | `"last_5m"` | no |
| service\_memory\_utilization\_enabled | Flag to enable Service Memory Utilization monitor | `string` | `"false"` | no |
| service\_memory\_utilization\_extra\_tags | Extra tags for Service Memory Utilization monitor | `list(string)` | `[]` | no |
| service\_memory\_utilization\_message | Custom message for the Service Memory Utilization monitor | `string` | `""` | no |
| service\_memory\_utilization\_threshold\_critical | Critical threshold for the Service Memory Utilization monitor | `string` | `90` | no |
| service\_memory\_utilization\_threshold\_warning | Warning threshold for the Service Memory Utilization monitor | `string` | `85` | no |
| service\_memory\_utilization\_time\_aggregator | Monitor aggregator for Service Memory Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| service\_memory\_utilization\_timeframe | Timeframe for the Service Memory Utilization monitor | `string` | `"last_5m"` | no |
| service\_missing\_tasks\_enabled | Flag to enable Service Missing Tasks monitor | `string` | `"true"` | no |
| service\_missing\_tasks\_extra\_tags | Extra tags for Service Missing Tasks monitor | `list(string)` | `[]` | no |
| service\_missing\_tasks\_message | Custom message for the Service Missing Tasks monitor | `string` | `""` | no |
| service\_missing\_tasks\_threshold\_critical | Critical threshold for the Service Missing Tasks monitor | `string` | `60` | no |
| service\_missing\_tasks\_threshold\_warning | Warning threshold for the Service Missing Tasks monitor | `string` | `80` | no |
| service\_missing\_tasks\_time\_aggregator | Monitor aggregator for Service Missing Tasks [available values: min, max or avg] | `string` | `"min"` | no |
| service\_missing\_tasks\_timeframe | Timeframe for the Service Missing Tasks monitor | `string` | `"last_5m"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no |
| <a name="input_filter_tags"></a> [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_service_cpu_utilization_enabled"></a> [service\_cpu\_utilization\_enabled](#input\_service\_cpu\_utilization\_enabled) | Flag to enable Service CPU Utilization monitor | `string` | `"false"` | no |
| <a name="input_service_cpu_utilization_extra_tags"></a> [service\_cpu\_utilization\_extra\_tags](#input\_service\_cpu\_utilization\_extra\_tags) | Extra tags for Service CPU Utilization monitor | `list(string)` | `[]` | no |
| <a name="input_service_cpu_utilization_message"></a> [service\_cpu\_utilization\_message](#input\_service\_cpu\_utilization\_message) | Custom message for the Service CPU Utilization monitor | `string` | `""` | no |
| <a name="input_service_cpu_utilization_threshold_critical"></a> [service\_cpu\_utilization\_threshold\_critical](#input\_service\_cpu\_utilization\_threshold\_critical) | Critical threshold for the Service CPU Utilization monitor | `string` | `"90"` | no |
| <a name="input_service_cpu_utilization_threshold_warning"></a> [service\_cpu\_utilization\_threshold\_warning](#input\_service\_cpu\_utilization\_threshold\_warning) | Warning threshold for the Service CPU Utilization monitor | `string` | `"80"` | no |
| <a name="input_service_cpu_utilization_time_aggregator"></a> [service\_cpu\_utilization\_time\_aggregator](#input\_service\_cpu\_utilization\_time\_aggregator) | Monitor aggregator for Service CPU Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_service_cpu_utilization_timeframe"></a> [service\_cpu\_utilization\_timeframe](#input\_service\_cpu\_utilization\_timeframe) | Timeframe for the Service CPU Utilization monitor | `string` | `"last_5m"` | no |
| <a name="input_service_memory_utilization_enabled"></a> [service\_memory\_utilization\_enabled](#input\_service\_memory\_utilization\_enabled) | Flag to enable Service Memory Utilization monitor | `string` | `"false"` | no |
| <a name="input_service_memory_utilization_extra_tags"></a> [service\_memory\_utilization\_extra\_tags](#input\_service\_memory\_utilization\_extra\_tags) | Extra tags for Service Memory Utilization monitor | `list(string)` | `[]` | no |
| <a name="input_service_memory_utilization_message"></a> [service\_memory\_utilization\_message](#input\_service\_memory\_utilization\_message) | Custom message for the Service Memory Utilization monitor | `string` | `""` | no |
| <a name="input_service_memory_utilization_threshold_critical"></a> [service\_memory\_utilization\_threshold\_critical](#input\_service\_memory\_utilization\_threshold\_critical) | Critical threshold for the Service Memory Utilization monitor | `string` | `90` | no |
| <a name="input_service_memory_utilization_threshold_warning"></a> [service\_memory\_utilization\_threshold\_warning](#input\_service\_memory\_utilization\_threshold\_warning) | Warning threshold for the Service Memory Utilization monitor | `string` | `85` | no |
| <a name="input_service_memory_utilization_time_aggregator"></a> [service\_memory\_utilization\_time\_aggregator](#input\_service\_memory\_utilization\_time\_aggregator) | Monitor aggregator for Service Memory Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_service_memory_utilization_timeframe"></a> [service\_memory\_utilization\_timeframe](#input\_service\_memory\_utilization\_timeframe) | Timeframe for the Service Memory Utilization monitor | `string` | `"last_5m"` | no |
| <a name="input_service_missing_tasks_enabled"></a> [service\_missing\_tasks\_enabled](#input\_service\_missing\_tasks\_enabled) | Flag to enable Service Missing Tasks monitor | `string` | `"true"` | no |
| <a name="input_service_missing_tasks_extra_tags"></a> [service\_missing\_tasks\_extra\_tags](#input\_service\_missing\_tasks\_extra\_tags) | Extra tags for Service Missing Tasks monitor | `list(string)` | `[]` | no |
| <a name="input_service_missing_tasks_message"></a> [service\_missing\_tasks\_message](#input\_service\_missing\_tasks\_message) | Custom message for the Service Missing Tasks monitor | `string` | `""` | no |
| <a name="input_service_missing_tasks_threshold_critical"></a> [service\_missing\_tasks\_threshold\_critical](#input\_service\_missing\_tasks\_threshold\_critical) | Critical threshold for the Service Missing Tasks monitor | `string` | `60` | no |
| <a name="input_service_missing_tasks_threshold_warning"></a> [service\_missing\_tasks\_threshold\_warning](#input\_service\_missing\_tasks\_threshold\_warning) | Warning threshold for the Service Missing Tasks monitor | `string` | `80` | no |
| <a name="input_service_missing_tasks_time_aggregator"></a> [service\_missing\_tasks\_time\_aggregator](#input\_service\_missing\_tasks\_time\_aggregator) | Monitor aggregator for Service Missing Tasks [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_service_missing_tasks_timeframe"></a> [service\_missing\_tasks\_timeframe](#input\_service\_missing\_tasks\_timeframe) | Timeframe for the Service Missing Tasks monitor | `string` | `"last_5m"` | no |
## Outputs
| Name | Description |
|------|-------------|
| service\_cpu\_utilization\_id | id for monitor service\_cpu\_utilization |
| service\_memory\_utilization\_id | id for monitor service\_memory\_utilization |
| service\_missing\_tasks\_id | id for monitor service\_missing\_tasks |
| <a name="output_service_cpu_utilization_id"></a> [service\_cpu\_utilization\_id](#output\_service\_cpu\_utilization\_id) | id for monitor service\_cpu\_utilization |
| <a name="output_service_memory_utilization_id"></a> [service\_memory\_utilization\_id](#output\_service\_memory\_utilization\_id) | id for monitor service\_memory\_utilization |
| <a name="output_service_missing_tasks_id"></a> [service\_missing\_tasks\_id](#output\_service\_missing\_tasks\_id) | id for monitor service\_missing\_tasks |
## Related documentation

0
cloud/aws/ecs/common/inputs.tf Normal file → Executable file
View File

0
cloud/aws/ecs/common/modules.tf Normal file → Executable file
View File

18
cloud/aws/ecs/common/monitors-ecs-common.tf Normal file → Executable file
View File

@ -12,7 +12,7 @@ resource "datadog_monitor" "service_cpu_utilization" {
EOQ
thresholds = {
monitor_thresholds {
critical = var.service_cpu_utilization_threshold_critical
warning = var.service_cpu_utilization_threshold_warning
}
@ -28,10 +28,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:service"], var.service_cpu_utilization_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "service_memory_utilization" {
@ -46,7 +42,7 @@ resource "datadog_monitor" "service_memory_utilization" {
> ${var.service_memory_utilization_threshold_critical}
EOQ
thresholds = {
monitor_thresholds {
critical = var.service_memory_utilization_threshold_critical
warning = var.service_memory_utilization_threshold_warning
}
@ -62,10 +58,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:service"], var.service_memory_utilization_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "service_missing_tasks" {
@ -81,7 +73,7 @@ resource "datadog_monitor" "service_missing_tasks" {
EOQ
thresholds = {
monitor_thresholds {
critical = var.service_missing_tasks_threshold_critical
warning = var.service_missing_tasks_threshold_warning
}
@ -97,8 +89,4 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:service"], var.service_missing_tasks_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
cloud/aws/ecs/common/outputs.tf Normal file → Executable file
View File

5
cloud/aws/ecs/common/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

0
cloud/aws/ecs/ec2-cluster/MANIFEST.txt Normal file → Executable file
View File

86
cloud/aws/ecs/ec2-cluster/README.md Normal file → Executable file
View File

@ -25,48 +25,68 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [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 | Flag to enable Agent Status monitor | `string` | `"true"` | no |
| agent\_status\_extra\_tags | Extra tags for Agent Status monitor | `list(string)` | `[]` | no |
| agent\_status\_message | Custom message for the Agent Status monitor | `string` | `""` | no |
| agent\_status\_no\_data\_timeframe | Agent status does not respond monitor no data timeframe | `string` | `10` | no |
| agent\_status\_threshold\_warning | Warning threshold for the Agent Status monitor | `string` | `3` | no |
| cluster\_cpu\_utilization\_enabled | Flag to enable Cluster CPU utilization monitor | `string` | `"false"` | no |
| cluster\_cpu\_utilization\_extra\_tags | Extra tags for Cluster CPU utilization monitor | `list(string)` | `[]` | no |
| cluster\_cpu\_utilization\_message | Custom message for the Cluster CPU Utilization monitor | `string` | `""` | no |
| cluster\_cpu\_utilization\_threshold\_critical | Critical threshold for the Cluster CPU Utilization monitor | `string` | `90` | no |
| cluster\_cpu\_utilization\_threshold\_warning | Warning threshold for the Cluster CPU Utilization monitor | `string` | `85` | no |
| cluster\_cpu\_utilization\_time\_aggregator | Monitor aggregator for Cluster CPU Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| cluster\_cpu\_utilization\_timeframe | Timeframe for the Cluster CPU Utilization monitor | `string` | `"last_5m"` | no |
| cluster\_memory\_reservation\_enabled | Flag to enable Cluster memory reservation monitor | `string` | `"false"` | no |
| cluster\_memory\_reservation\_extra\_tags | Extra tags for Cluster Memory Reservation monitor | `list(string)` | `[]` | no |
| cluster\_memory\_reservation\_message | Custom message for the Cluster Memory Reservation monitor | `string` | `""` | no |
| cluster\_memory\_reservation\_threshold\_critical | Critical threshold for the Cluster Memory Reservation monitor | `string` | `90` | no |
| cluster\_memory\_reservation\_threshold\_warning | Warning threshold for the Cluster Memory Reservation monitor | `string` | `85` | no |
| cluster\_memory\_reservation\_time\_aggregator | Monitor aggregator for Cluster Memory Reservation [available values: min, max or avg] | `string` | `"min"` | no |
| cluster\_memory\_reservation\_timeframe | Timeframe for the Cluster Memory Reservation monitor | `string` | `"last_5m"` | no |
| environment | Architecture environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `900` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `string` | `"true"` | no |
| message | Message sent when a monitor is triggered | `any` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_agent_status_enabled"></a> [agent\_status\_enabled](#input\_agent\_status\_enabled) | Flag to enable Agent Status monitor | `string` | `"true"` | no |
| <a name="input_agent_status_extra_tags"></a> [agent\_status\_extra\_tags](#input\_agent\_status\_extra\_tags) | Extra tags for Agent Status monitor | `list(string)` | `[]` | no |
| <a name="input_agent_status_message"></a> [agent\_status\_message](#input\_agent\_status\_message) | Custom message for the Agent Status monitor | `string` | `""` | no |
| <a name="input_agent_status_no_data_timeframe"></a> [agent\_status\_no\_data\_timeframe](#input\_agent\_status\_no\_data\_timeframe) | Agent status does not respond monitor no data timeframe | `string` | `10` | no |
| <a name="input_agent_status_threshold_warning"></a> [agent\_status\_threshold\_warning](#input\_agent\_status\_threshold\_warning) | Warning threshold for the Agent Status monitor | `string` | `3` | no |
| <a name="input_cluster_cpu_utilization_enabled"></a> [cluster\_cpu\_utilization\_enabled](#input\_cluster\_cpu\_utilization\_enabled) | Flag to enable Cluster CPU utilization monitor | `string` | `"false"` | no |
| <a name="input_cluster_cpu_utilization_extra_tags"></a> [cluster\_cpu\_utilization\_extra\_tags](#input\_cluster\_cpu\_utilization\_extra\_tags) | Extra tags for Cluster CPU utilization monitor | `list(string)` | `[]` | no |
| <a name="input_cluster_cpu_utilization_message"></a> [cluster\_cpu\_utilization\_message](#input\_cluster\_cpu\_utilization\_message) | Custom message for the Cluster CPU Utilization monitor | `string` | `""` | no |
| <a name="input_cluster_cpu_utilization_threshold_critical"></a> [cluster\_cpu\_utilization\_threshold\_critical](#input\_cluster\_cpu\_utilization\_threshold\_critical) | Critical threshold for the Cluster CPU Utilization monitor | `string` | `90` | no |
| <a name="input_cluster_cpu_utilization_threshold_warning"></a> [cluster\_cpu\_utilization\_threshold\_warning](#input\_cluster\_cpu\_utilization\_threshold\_warning) | Warning threshold for the Cluster CPU Utilization monitor | `string` | `85` | no |
| <a name="input_cluster_cpu_utilization_time_aggregator"></a> [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 |
| <a name="input_cluster_cpu_utilization_timeframe"></a> [cluster\_cpu\_utilization\_timeframe](#input\_cluster\_cpu\_utilization\_timeframe) | Timeframe for the Cluster CPU Utilization monitor | `string` | `"last_5m"` | no |
| <a name="input_cluster_memory_reservation_enabled"></a> [cluster\_memory\_reservation\_enabled](#input\_cluster\_memory\_reservation\_enabled) | Flag to enable Cluster memory reservation monitor | `string` | `"false"` | no |
| <a name="input_cluster_memory_reservation_extra_tags"></a> [cluster\_memory\_reservation\_extra\_tags](#input\_cluster\_memory\_reservation\_extra\_tags) | Extra tags for Cluster Memory Reservation monitor | `list(string)` | `[]` | no |
| <a name="input_cluster_memory_reservation_message"></a> [cluster\_memory\_reservation\_message](#input\_cluster\_memory\_reservation\_message) | Custom message for the Cluster Memory Reservation monitor | `string` | `""` | no |
| <a name="input_cluster_memory_reservation_threshold_critical"></a> [cluster\_memory\_reservation\_threshold\_critical](#input\_cluster\_memory\_reservation\_threshold\_critical) | Critical threshold for the Cluster Memory Reservation monitor | `string` | `90` | no |
| <a name="input_cluster_memory_reservation_threshold_warning"></a> [cluster\_memory\_reservation\_threshold\_warning](#input\_cluster\_memory\_reservation\_threshold\_warning) | Warning threshold for the Cluster Memory Reservation monitor | `string` | `85` | no |
| <a name="input_cluster_memory_reservation_time_aggregator"></a> [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 |
| <a name="input_cluster_memory_reservation_timeframe"></a> [cluster\_memory\_reservation\_timeframe](#input\_cluster\_memory\_reservation\_timeframe) | Timeframe for the Cluster Memory Reservation monitor | `string` | `"last_5m"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
## Outputs
| Name | Description |
|------|-------------|
| cluster\_cpu\_utilization\_id | id for monitor cluster\_cpu\_utilization |
| cluster\_memory\_reservation\_id | id for monitor cluster\_memory\_reservation |
| ecs\_agent\_status\_id | id for monitor ecs\_agent\_status |
| <a name="output_cluster_cpu_utilization_id"></a> [cluster\_cpu\_utilization\_id](#output\_cluster\_cpu\_utilization\_id) | id for monitor cluster\_cpu\_utilization |
| <a name="output_cluster_memory_reservation_id"></a> [cluster\_memory\_reservation\_id](#output\_cluster\_memory\_reservation\_id) | id for monitor cluster\_memory\_reservation |
| <a name="output_ecs_agent_status_id"></a> [ecs\_agent\_status\_id](#output\_ecs\_agent\_status\_id) | id for monitor ecs\_agent\_status |
## Related documentation

0
cloud/aws/ecs/ec2-cluster/inputs.tf Normal file → Executable file
View File

0
cloud/aws/ecs/ec2-cluster/modules.tf Normal file → Executable file
View File

18
cloud/aws/ecs/ec2-cluster/monitors-ecs-ec2-cluster.tf Normal file → Executable file
View File

@ -10,7 +10,7 @@ resource "datadog_monitor" "ecs_agent_status" {
EOQ
thresholds = {
monitor_thresholds {
warning = var.agent_status_threshold_warning
critical = 5
}
@ -27,10 +27,6 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:agent"], var.agent_status_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "cluster_cpu_utilization" {
@ -46,7 +42,7 @@ resource "datadog_monitor" "cluster_cpu_utilization" {
EOQ
thresholds = {
monitor_thresholds {
critical = var.cluster_cpu_utilization_threshold_critical
warning = var.cluster_cpu_utilization_threshold_warning
}
@ -63,10 +59,6 @@ EOQ
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:cluster"], var.cluster_cpu_utilization_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "cluster_memory_reservation" {
@ -82,7 +74,7 @@ resource "datadog_monitor" "cluster_memory_reservation" {
EOQ
thresholds = {
monitor_thresholds {
critical = var.cluster_memory_reservation_threshold_critical
warning = var.cluster_memory_reservation_threshold_warning
}
@ -98,8 +90,4 @@ EOQ
locked = false
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:cluster"], var.cluster_memory_reservation_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
cloud/aws/ecs/ec2-cluster/outputs.tf Normal file → Executable file
View File

5
cloud/aws/ecs/ec2-cluster/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

0
cloud/aws/ecs/fargate/MANIFEST.txt Normal file → Executable file
View File

86
cloud/aws/ecs/fargate/README.md Normal file → Executable file
View File

@ -25,49 +25,69 @@ Creates DataDog monitors with the following checks:
| Name | Version |
|------|---------|
| terraform | >= 0.12.26 |
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 0.12.31 |
| <a name="requirement_datadog"></a> [datadog](#requirement\_datadog) | >= 3.1.0 |
## Providers
| Name | Version |
|------|---------|
| <a name="provider_datadog"></a> [datadog](#provider\_datadog) | 3.1.2 |
## Modules
| Name | Source | Version |
|------|--------|---------|
| <a name="module_filter-tags"></a> [filter-tags](#module\_filter-tags) | ../../../../common/filter-tags | n/a |
## Resources
| Name | Type |
|------|------|
| [datadog_monitor.cpu_utilization](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.memory_utilization](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
| [datadog_monitor.service_check](https://registry.terraform.io/providers/DataDog/datadog/latest/docs/resources/monitor) | resource |
## Inputs
| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| cpu\_utilization\_enabled | Flag to enable monitor | `string` | `"false"` | no |
| cpu\_utilization\_extra\_tags | Extra tags for the monitor | `list(string)` | `[]` | no |
| cpu\_utilization\_message | Custom message for the monitor | `string` | `""` | no |
| cpu\_utilization\_threshold\_critical | Critical threshold for the monitor | `string` | `90` | no |
| cpu\_utilization\_threshold\_warning | Warning threshold for the monitor | `string` | `85` | no |
| cpu\_utilization\_time\_aggregator | Monitor aggregator (min, max or avg) | `string` | `"min"` | no |
| cpu\_utilization\_timeframe | Timeframe for the monitor | `string` | `"last_5m"` | no |
| environment | Architecture environment | `string` | n/a | yes |
| evaluation\_delay | Delay in seconds for the metric evaluation | `number` | `15` | no |
| filter\_tags\_custom | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| filter\_tags\_custom\_excluded | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| filter\_tags\_use\_defaults | Use default filter tags convention | `bool` | `true` | no |
| memory\_utilization\_enabled | Flag to enable Fargate Memory utilization monitor | `string` | `"false"` | no |
| memory\_utilization\_extra\_tags | Extra tags for Fargate Memory utilization monitor | `list(string)` | `[]` | no |
| memory\_utilization\_message | Custom message for the Fargate Memory Utilization monitor | `string` | `""` | no |
| memory\_utilization\_threshold\_critical | Critical threshold for the Fargate Memory Utilization monitor | `string` | `90` | no |
| memory\_utilization\_threshold\_warning | Warning threshold for the Fargate Memory Utilization monitor | `string` | `85` | no |
| memory\_utilization\_time\_aggregator | Monitor aggregator for Fargate Memory Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| memory\_utilization\_timeframe | Timeframe for the Fargate Memory Utilization monitor | `string` | `"last_5m"` | no |
| message | Message sent when a monitor is triggered | `string` | n/a | yes |
| new\_host\_delay | Delay in seconds before monitor new resource | `number` | `300` | no |
| notify\_no\_data | Will raise no data alert if set to true | `bool` | `true` | no |
| prefix\_slug | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| service\_check\_enabled | Flag to enable monitor | `bool` | `true` | no |
| service\_check\_extra\_tags | Extra tags for the monitor | `list(string)` | `[]` | no |
| service\_check\_message | Custom message for the monitor | `string` | `""` | no |
| service\_check\_no\_data\_timeframe | No data timeframe in minutes | `number` | `10` | no |
| service\_check\_threshold\_warning | Warning threshold | `number` | `3` | no |
| <a name="input_cpu_utilization_enabled"></a> [cpu\_utilization\_enabled](#input\_cpu\_utilization\_enabled) | Flag to enable monitor | `string` | `"false"` | no |
| <a name="input_cpu_utilization_extra_tags"></a> [cpu\_utilization\_extra\_tags](#input\_cpu\_utilization\_extra\_tags) | Extra tags for the monitor | `list(string)` | `[]` | no |
| <a name="input_cpu_utilization_message"></a> [cpu\_utilization\_message](#input\_cpu\_utilization\_message) | Custom message for the monitor | `string` | `""` | no |
| <a name="input_cpu_utilization_threshold_critical"></a> [cpu\_utilization\_threshold\_critical](#input\_cpu\_utilization\_threshold\_critical) | Critical threshold for the monitor | `string` | `90` | no |
| <a name="input_cpu_utilization_threshold_warning"></a> [cpu\_utilization\_threshold\_warning](#input\_cpu\_utilization\_threshold\_warning) | Warning threshold for the monitor | `string` | `85` | no |
| <a name="input_cpu_utilization_time_aggregator"></a> [cpu\_utilization\_time\_aggregator](#input\_cpu\_utilization\_time\_aggregator) | Monitor aggregator (min, max or avg) | `string` | `"min"` | no |
| <a name="input_cpu_utilization_timeframe"></a> [cpu\_utilization\_timeframe](#input\_cpu\_utilization\_timeframe) | Timeframe for the monitor | `string` | `"last_5m"` | no |
| <a name="input_environment"></a> [environment](#input\_environment) | Architecture environment | `string` | n/a | yes |
| <a name="input_evaluation_delay"></a> [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no |
| <a name="input_filter_tags_custom"></a> [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no |
| <a name="input_filter_tags_custom_excluded"></a> [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no |
| <a name="input_filter_tags_use_defaults"></a> [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `bool` | `true` | no |
| <a name="input_memory_utilization_enabled"></a> [memory\_utilization\_enabled](#input\_memory\_utilization\_enabled) | Flag to enable Fargate Memory utilization monitor | `string` | `"false"` | no |
| <a name="input_memory_utilization_extra_tags"></a> [memory\_utilization\_extra\_tags](#input\_memory\_utilization\_extra\_tags) | Extra tags for Fargate Memory utilization monitor | `list(string)` | `[]` | no |
| <a name="input_memory_utilization_message"></a> [memory\_utilization\_message](#input\_memory\_utilization\_message) | Custom message for the Fargate Memory Utilization monitor | `string` | `""` | no |
| <a name="input_memory_utilization_threshold_critical"></a> [memory\_utilization\_threshold\_critical](#input\_memory\_utilization\_threshold\_critical) | Critical threshold for the Fargate Memory Utilization monitor | `string` | `90` | no |
| <a name="input_memory_utilization_threshold_warning"></a> [memory\_utilization\_threshold\_warning](#input\_memory\_utilization\_threshold\_warning) | Warning threshold for the Fargate Memory Utilization monitor | `string` | `85` | no |
| <a name="input_memory_utilization_time_aggregator"></a> [memory\_utilization\_time\_aggregator](#input\_memory\_utilization\_time\_aggregator) | Monitor aggregator for Fargate Memory Utilization [available values: min, max or avg] | `string` | `"min"` | no |
| <a name="input_memory_utilization_timeframe"></a> [memory\_utilization\_timeframe](#input\_memory\_utilization\_timeframe) | Timeframe for the Fargate Memory Utilization monitor | `string` | `"last_5m"` | no |
| <a name="input_message"></a> [message](#input\_message) | Message sent when a monitor is triggered | `string` | n/a | yes |
| <a name="input_new_host_delay"></a> [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_service_check_enabled"></a> [service\_check\_enabled](#input\_service\_check\_enabled) | Flag to enable monitor | `bool` | `true` | no |
| <a name="input_service_check_extra_tags"></a> [service\_check\_extra\_tags](#input\_service\_check\_extra\_tags) | Extra tags for the monitor | `list(string)` | `[]` | no |
| <a name="input_service_check_message"></a> [service\_check\_message](#input\_service\_check\_message) | Custom message for the monitor | `string` | `""` | no |
| <a name="input_service_check_no_data_timeframe"></a> [service\_check\_no\_data\_timeframe](#input\_service\_check\_no\_data\_timeframe) | No data timeframe in minutes | `number` | `10` | no |
| <a name="input_service_check_threshold_warning"></a> [service\_check\_threshold\_warning](#input\_service\_check\_threshold\_warning) | Warning threshold | `number` | `3` | no |
## Outputs
| Name | Description |
|------|-------------|
| cpu\_utilization\_id | id for monitor cpu\_utilization |
| memory\_utilization\_id | id for monitor memory\_utilization |
| service\_check\_id | id for monitor service\_check |
| <a name="output_cpu_utilization_id"></a> [cpu\_utilization\_id](#output\_cpu\_utilization\_id) | id for monitor cpu\_utilization |
| <a name="output_memory_utilization_id"></a> [memory\_utilization\_id](#output\_memory\_utilization\_id) | id for monitor memory\_utilization |
| <a name="output_service_check_id"></a> [service\_check\_id](#output\_service\_check\_id) | id for monitor service\_check |
## Related documentation
[Official DataDog documentation on ECS Fargate](https://docs.datadoghq.com/integrations/ecs_fargate/)

0
cloud/aws/ecs/fargate/inputs.tf Normal file → Executable file
View File

0
cloud/aws/ecs/fargate/modules.tf Normal file → Executable file
View File

21
cloud/aws/ecs/fargate/monitors-ecs-fargate.tf Normal file → Executable file
View File

@ -10,7 +10,7 @@ resource "datadog_monitor" "service_check" {
"fargate_check"${module.filter-tags.service_check}.last(6).count_by_status()
EOQ
thresholds = {
monitor_thresholds {
warning = var.service_check_threshold_warning
critical = 5
}
@ -27,12 +27,7 @@ EOQ
include_tags = true
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs_fargate", "team:claranet", "created-by:terraform", "category:service"], var.service_check_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs_fargate", "team:claranet", "created-by:terraform", "category:service"], var.service_check_extra_tags)
}
resource "datadog_monitor" "cpu_utilization" {
@ -48,7 +43,7 @@ ${var.cpu_utilization_time_aggregator}(${var.cpu_utilization_timeframe}):
EOQ
thresholds = {
monitor_thresholds {
critical = var.cpu_utilization_threshold_critical
warning = var.cpu_utilization_threshold_warning
}
@ -65,10 +60,6 @@ EOQ
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs_fargate", "team:claranet", "created-by:terraform"], var.cpu_utilization_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}
resource "datadog_monitor" "memory_utilization" {
@ -86,7 +77,7 @@ ${var.memory_utilization_time_aggregator}(${var.memory_utilization_timeframe}):
EOQ
thresholds = {
monitor_thresholds {
critical = var.memory_utilization_threshold_critical
warning = var.memory_utilization_threshold_warning
}
@ -103,8 +94,4 @@ EOQ
tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs_fargate", "team:claranet", "created-by:terraform"], var.memory_utilization_extra_tags)
lifecycle {
ignore_changes = [silenced]
}
}

0
cloud/aws/ecs/fargate/outputs.tf Normal file → Executable file
View File

5
cloud/aws/ecs/fargate/versions.tf Normal file → Executable file
View File

@ -1,8 +1,9 @@
terraform {
required_providers {
datadog = {
source = "terraform-providers/datadog"
source = "DataDog/datadog"
version = ">= 3.1.0"
}
}
required_version = ">= 0.12.26"
required_version = ">= 0.12.31"
}

Some files were not shown because too many files have changed in this diff Show More