diff --git a/.gitignore b/.gitignore index 0021961..086253b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,9 @@ -testing/* +# Ignore all volatile files +**/.terraform/modules +**/terraform.tfstate*.backup + +# Ignore all credentials files +**/terraform.tfvars + +# Ignore all but root state files +**/terraform.tfstate diff --git a/README.md b/README.md index 6576821..04854be 100644 --- a/README.md +++ b/README.md @@ -20,23 +20,47 @@ The easiest way to contribute on this repository is to add monitors file inside ``` module "datadog-monitors" { - source = "git:ssh://git@bitbucket.org/morea/terraform.datadog.monitors.git" + source = "git::ssh://git@bitbucket.org/morea/terraform.datadog.monitors.git" - ho_escalation_group = "${var.ho_escalation_group}" - hno_escalation_group = "${var.hno_escalation_group}" + critical_escalation_group = "${var.critical_escalation_group}" + warning_escalation_group = "${var.warning_escalation_group}" #default monitors templates integrations examples - linux_basics = "${var.linux_basics}" - #nginx = "disabled" - #aws_rds_mysql = "disabled" + dd_linux_basics = "${var.dd_linux_basics}" + #nginx = "false" + #aws_rds_mysql = "false" - #custom monitors template integrations examples - #cpu_custom = "enabled" #Will match the tag dd_custom_cpu (NB: it will replace the basic cpu alert) - #cpu_custom_period = "60" - #cpu_custom_warning_threshold = "90" - #cpu_custom_warning_escalation_msg = ${var.ho_escalation_group} - #cpu_custom_alert_threshold = "95" - #cpu_custom_alert_escalation_msg = ${var.hno_escalation_group} + dd_custom_cpu = "${var.dd_custom_cpu}" } +``` + +### Input Declaration example ### ``` +variable "critical_escalation_group" { + default = "@pagerduty_HODummy" +} +variable "warning_escalation_group" { + default = "@pagerduty_HNODummy" +} + +variable "datadog_app_key" {} +variable "datadog_api_key" {} + +variable "dd_linux_basics" { + default = "enabled" +} + +variable "dd_custom_cpu" { + type = "map" + default = { + status = "enabled" + name = "CPU High > 95% during 1 hour" + + period = "last_1h" + + critical_threshold = 95 + warning_threshold = 90 + } +} +``` diff --git a/datadog-samples/inputs-declaration.sample b/datadog-samples/inputs-declaration.sample index e40b091..55bf02e 100644 --- a/datadog-samples/inputs-declaration.sample +++ b/datadog-samples/inputs-declaration.sample @@ -1,19 +1,26 @@ -variable "ho_escalation_group" { +variable "critical_escalation_group" { default = "@pagerduty_HODummy" } - -variable "hno_escalation_group" { +variable "warning_escalation_group" { default = "@pagerduty_HNODummy" } -variable "linux_basics" { +variable "datadog_app_key" {} +variable "datadog_api_key" {} + +variable "dd_linux_basics" { default = "enabled" } -variable "datadog_api_key" { - default = "4878503d31a00ad7af4486581d0f98e8" -} +variable "dd_custom_cpu" { + type = "map" + default = { + status = "enabled" + name = "CPU High > 95% during 1 hour" -variable "datadog_app_key" { - default = "e1a10feedbb095e7d28ef966c4a2c00d50f53272" + period = "last_1h" + + critical_threshold = 95 + warning_threshold = 90 + } } diff --git a/datadog-samples/modules-declaration.sample b/datadog-samples/modules-declaration.sample index 8b57fec..036cb16 100644 --- a/datadog-samples/modules-declaration.sample +++ b/datadog-samples/modules-declaration.sample @@ -1,19 +1,13 @@ module "datadog-monitors" { - source = "git:ssh://git@bitbucket.org/morea/terraform.datadog.monitors.git" + source = "git::ssh://git@bitbucket.org/morea/terraform.datadog.monitors.git" - ho_escalation_group = "${var.ho_escalation_group}" - hno_escalation_group = "${var.hno_escalation_group}" + critical_escalation_group = "${var.critical_escalation_group}" + warning_escalation_group = "${var.warning_escalation_group}" #default monitors templates integrations examples - linux_basics = "${var.linux_basics}" - #nginx = "disabled" - #aws_rds_mysql = "disabled" + dd_linux_basics = "${var.dd_linux_basics}" + #nginx = "false" + #aws_rds_mysql = "false" - #custom monitors template integrations examples - #cpu_custom = "enabled" #Will match the tag dd_custom_cpu (NB: it will replace the basic cpu alert) - #cpu_custom_period = "60" - #cpu_custom_warning_threshold = "90" - #cpu_custom_warning_escalation_msg = ${var.ho_escalation_group} - #cpu_custom_alert_threshold = "95" - #cpu_custom_alert_escalation_msg = ${var.hno_escalation_group} + dd_custom_cpu = "${var.dd_custom_cpu}" }