73 lines
1.7 KiB
HCL
Executable File
73 lines
1.7 KiB
HCL
Executable File
###### Datadog Provider configuration ######
|
|
variable "datadog_api_key" {
|
|
description = "The datadog API key"
|
|
type = string
|
|
}
|
|
|
|
variable "datadog_app_key" {
|
|
description = "The datadog APP key"
|
|
type = string
|
|
}
|
|
|
|
variable "api_url" {
|
|
description = "Which API to Connect to, we are using the EU one for GDPR compliance"
|
|
type = string
|
|
default = "https://api.datadoghq.eu"
|
|
}
|
|
|
|
variable "http_client_retry_enabled" {
|
|
description = "Enables Request retries on HTTP status codes 429 and 5xx"
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
variable "http_client_retry_timeout" {
|
|
description = "Sets the number of HTTP request retry timeout period"
|
|
type = string
|
|
default = ""
|
|
}
|
|
|
|
variable "validate" {
|
|
description = "Validates the provided APP and API keys during provider initialization"
|
|
type = bool
|
|
default = true
|
|
}
|
|
|
|
###### Datadog Monitors Configuration ######
|
|
|
|
# Variable defining the query and threshold shared by a monitor and graph for the disk usage.
|
|
variable "disk_usage" {
|
|
type = map
|
|
|
|
default = {
|
|
query = "max:system.disk.in_use"
|
|
threshold = "85"
|
|
}
|
|
}
|
|
|
|
# Variable defining the query and threshold shared by a monitor and graph for the CPU usage.
|
|
variable "cpu_usage" {
|
|
type = map
|
|
|
|
default = {
|
|
query = "avg:aws.ec2.cpuutilization"
|
|
threshold = "85"
|
|
}
|
|
}
|
|
|
|
# Footer added to each monitor alert.
|
|
variable "datadog_alert_footer" {
|
|
default = <<EOF
|
|
{{#is_no_data}}Not receiving data{{/is_no_data}}
|
|
{{#is_alert}}@pagerduty{{/is_alert}}
|
|
{{#is_recovery}}@pagerduty-resolve{{/is_recovery}}
|
|
@slack-alerts
|
|
EOF
|
|
}
|
|
|
|
# Trigger a separate alert for each host and env.
|
|
variable "trigger_by" {
|
|
default = "{host,env}"
|
|
}
|
|
|