From 27455866a758929aa51ffc7cf99f01dd127b1641 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Fri, 27 Oct 2017 15:11:53 +0200 Subject: [PATCH 1/4] MON-66: Update testing module url --- testing/modules.tf | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/testing/modules.tf b/testing/modules.tf index 5574a18..258d85b 100644 --- a/testing/modules.tf +++ b/testing/modules.tf @@ -1,5 +1,5 @@ module "datadog-monitors" { - source = "git::ssh://git@bitbucket.org/morea/terraform.datadog.monitors.git" + source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git" env = "${var.environment}" region = "${var.region}" @@ -12,4 +12,3 @@ module "datadog-monitors" { dd_linux_basics = "${var.dd_linux_basics}" } - From 66577a13e2b737a1ee9a2632756ce24179a5961c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Fri, 27 Oct 2017 15:18:43 +0200 Subject: [PATCH 2/4] MON-66: Dummy tesing subdir --- testing/dummy/dummy.tf | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 testing/dummy/dummy.tf diff --git a/testing/dummy/dummy.tf b/testing/dummy/dummy.tf new file mode 100644 index 0000000..f5cc69c --- /dev/null +++ b/testing/dummy/dummy.tf @@ -0,0 +1,3 @@ + + +resource "null_resource" "test-migration" {} \ No newline at end of file From a86de69c5e47ae6999093085100a19641fb6b770 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Fri, 27 Oct 2017 16:08:06 +0200 Subject: [PATCH 3/4] MON-66: New tree directory and README updates --- README.md | 16 +++++++--------- cloud/aws/elb/inputs.tf | 1 + monitors_elb.tf => cloud/aws/elb/monitors-elb.tf | 0 cloud/aws/rds-mysql/inputs.tf | 1 + .../aws/rds-mysql/monitors-rds_mysql-basics.tf | 0 middleware/apache/inputs.tf | 1 + .../apache/monitors-apache.tf | 0 middleware/nginx/inputs.tf | 1 + .../nginx/monitors-nginx.tf | 0 middleware/php-fpm/inputs.tf | 1 + .../php-fpm/monitors-fpm.tf | 0 os/linux/inputs.tf | 1 + .../linux/monitors-linux-basics.tf | 0 system/cpu/inputs.tf | 1 + .../cpu/monitors-custom-cpu.tf | 0 15 files changed, 14 insertions(+), 9 deletions(-) create mode 120000 cloud/aws/elb/inputs.tf rename monitors_elb.tf => cloud/aws/elb/monitors-elb.tf (100%) create mode 120000 cloud/aws/rds-mysql/inputs.tf rename monitors-rds_mysql-basics.tf => cloud/aws/rds-mysql/monitors-rds_mysql-basics.tf (100%) create mode 120000 middleware/apache/inputs.tf rename monitors_apache.tf => middleware/apache/monitors-apache.tf (100%) create mode 120000 middleware/nginx/inputs.tf rename monitors_nginx.tf => middleware/nginx/monitors-nginx.tf (100%) create mode 120000 middleware/php-fpm/inputs.tf rename monitors_fpm.tf => middleware/php-fpm/monitors-fpm.tf (100%) create mode 120000 os/linux/inputs.tf rename monitors-linux-basics.tf => os/linux/monitors-linux-basics.tf (100%) create mode 120000 system/cpu/inputs.tf rename monitors-custom-cpu.tf => system/cpu/monitors-custom-cpu.tf (100%) diff --git a/README.md b/README.md index 78e83cf..88e7dda 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -# README # +# README - DataDog Monitors # This repository is used to store all our monitors templates. -These templates have to be used with dedicated agent configurations and ressource tagging to works as expected. +These templates have to be used with dedicated agent configurations and resource tagging to works as expected. ### How to contribute ? ### @@ -10,13 +10,11 @@ The easiest way to contribute on this repository is to add monitors file inside ### Important notes ### -*This repository will be included as a Terraform module source. - -*Each monitors have to be disabled by default, so you have to manage this condition when you create your monitors. +* This repository will be included as a Terraform module source. +* Each monitors have to be disabled by default, so you have to manage this condition when you create your monitors. +* If you override a basic monitor with a custom one, you have to use tag filters on you query. (Example dd_cpu_high, if you want to override default cpu monitors) -*If you override a basic monitor with a custom one, you have to use tag filters on you query. (Example dd_cpu_high, if you want to override default cpu monitors) - -### Main.tf : add the datadog provider ### +### Main.tf : add the DataDog provider ### ``` provider "datadog" { @@ -29,7 +27,7 @@ provider "datadog" { ``` module "datadog-monitors" { - source = "git::ssh://git@bitbucket.org/morea/terraform.datadog.monitors.git" + source = "git::ssh://git@bitbucket.org/morea/terraform.feature.datadog.git//{module-path}?ref={version}" critical_escalation_group = "${var.critical_escalation_group}" warning_escalation_group = "${var.warning_escalation_group}" diff --git a/cloud/aws/elb/inputs.tf b/cloud/aws/elb/inputs.tf new file mode 120000 index 0000000..a68ace3 --- /dev/null +++ b/cloud/aws/elb/inputs.tf @@ -0,0 +1 @@ +../../../inputs.tf \ No newline at end of file diff --git a/monitors_elb.tf b/cloud/aws/elb/monitors-elb.tf similarity index 100% rename from monitors_elb.tf rename to cloud/aws/elb/monitors-elb.tf diff --git a/cloud/aws/rds-mysql/inputs.tf b/cloud/aws/rds-mysql/inputs.tf new file mode 120000 index 0000000..a68ace3 --- /dev/null +++ b/cloud/aws/rds-mysql/inputs.tf @@ -0,0 +1 @@ +../../../inputs.tf \ No newline at end of file diff --git a/monitors-rds_mysql-basics.tf b/cloud/aws/rds-mysql/monitors-rds_mysql-basics.tf similarity index 100% rename from monitors-rds_mysql-basics.tf rename to cloud/aws/rds-mysql/monitors-rds_mysql-basics.tf diff --git a/middleware/apache/inputs.tf b/middleware/apache/inputs.tf new file mode 120000 index 0000000..cdfc6c6 --- /dev/null +++ b/middleware/apache/inputs.tf @@ -0,0 +1 @@ +../../inputs.tf \ No newline at end of file diff --git a/monitors_apache.tf b/middleware/apache/monitors-apache.tf similarity index 100% rename from monitors_apache.tf rename to middleware/apache/monitors-apache.tf diff --git a/middleware/nginx/inputs.tf b/middleware/nginx/inputs.tf new file mode 120000 index 0000000..cdfc6c6 --- /dev/null +++ b/middleware/nginx/inputs.tf @@ -0,0 +1 @@ +../../inputs.tf \ No newline at end of file diff --git a/monitors_nginx.tf b/middleware/nginx/monitors-nginx.tf similarity index 100% rename from monitors_nginx.tf rename to middleware/nginx/monitors-nginx.tf diff --git a/middleware/php-fpm/inputs.tf b/middleware/php-fpm/inputs.tf new file mode 120000 index 0000000..cdfc6c6 --- /dev/null +++ b/middleware/php-fpm/inputs.tf @@ -0,0 +1 @@ +../../inputs.tf \ No newline at end of file diff --git a/monitors_fpm.tf b/middleware/php-fpm/monitors-fpm.tf similarity index 100% rename from monitors_fpm.tf rename to middleware/php-fpm/monitors-fpm.tf diff --git a/os/linux/inputs.tf b/os/linux/inputs.tf new file mode 120000 index 0000000..cdfc6c6 --- /dev/null +++ b/os/linux/inputs.tf @@ -0,0 +1 @@ +../../inputs.tf \ No newline at end of file diff --git a/monitors-linux-basics.tf b/os/linux/monitors-linux-basics.tf similarity index 100% rename from monitors-linux-basics.tf rename to os/linux/monitors-linux-basics.tf diff --git a/system/cpu/inputs.tf b/system/cpu/inputs.tf new file mode 120000 index 0000000..cdfc6c6 --- /dev/null +++ b/system/cpu/inputs.tf @@ -0,0 +1 @@ +../../inputs.tf \ No newline at end of file diff --git a/monitors-custom-cpu.tf b/system/cpu/monitors-custom-cpu.tf similarity index 100% rename from monitors-custom-cpu.tf rename to system/cpu/monitors-custom-cpu.tf From 5758f0f03f7b0201cd5f72d92ab438e556908899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=B4me=20Respaut?= Date: Fri, 27 Oct 2017 17:08:32 +0200 Subject: [PATCH 4/4] MON-66: Some more rename --- {monitors-unready => incubator}/monitors-apache-nat.tf | 0 {monitors-unready => incubator}/monitors-cassandra.tf | 0 {monitors-unready => incubator}/monitors-gcp-cloud-sql.tf | 0 {monitors-unready => incubator}/monitors-gcp-lb.tf | 0 {monitors-unready => incubator}/monitors-gcp-vpn.tf | 0 {monitors-unready => incubator}/monitors-kubernetes.tf | 0 {monitors-unready => incubator}/monitors-linux-basics.log | 0 {monitors-unready => incubator}/monitors-linux-basics.tf | 0 {monitors-unready => incubator}/monitors-redis-containers.tf | 0 {monitors-unready => incubator}/monitors-redis.tf | 0 {os/linux => system/generic}/inputs.tf | 0 system/{cpu => generic}/monitors-custom-cpu.tf | 0 system/{cpu => linux}/inputs.tf | 0 {os => system}/linux/monitors-linux-basics.tf | 0 14 files changed, 0 insertions(+), 0 deletions(-) rename {monitors-unready => incubator}/monitors-apache-nat.tf (100%) rename {monitors-unready => incubator}/monitors-cassandra.tf (100%) rename {monitors-unready => incubator}/monitors-gcp-cloud-sql.tf (100%) rename {monitors-unready => incubator}/monitors-gcp-lb.tf (100%) rename {monitors-unready => incubator}/monitors-gcp-vpn.tf (100%) rename {monitors-unready => incubator}/monitors-kubernetes.tf (100%) rename {monitors-unready => incubator}/monitors-linux-basics.log (100%) rename {monitors-unready => incubator}/monitors-linux-basics.tf (100%) rename {monitors-unready => incubator}/monitors-redis-containers.tf (100%) rename {monitors-unready => incubator}/monitors-redis.tf (100%) rename {os/linux => system/generic}/inputs.tf (100%) rename system/{cpu => generic}/monitors-custom-cpu.tf (100%) rename system/{cpu => linux}/inputs.tf (100%) rename {os => system}/linux/monitors-linux-basics.tf (100%) diff --git a/monitors-unready/monitors-apache-nat.tf b/incubator/monitors-apache-nat.tf similarity index 100% rename from monitors-unready/monitors-apache-nat.tf rename to incubator/monitors-apache-nat.tf diff --git a/monitors-unready/monitors-cassandra.tf b/incubator/monitors-cassandra.tf similarity index 100% rename from monitors-unready/monitors-cassandra.tf rename to incubator/monitors-cassandra.tf diff --git a/monitors-unready/monitors-gcp-cloud-sql.tf b/incubator/monitors-gcp-cloud-sql.tf similarity index 100% rename from monitors-unready/monitors-gcp-cloud-sql.tf rename to incubator/monitors-gcp-cloud-sql.tf diff --git a/monitors-unready/monitors-gcp-lb.tf b/incubator/monitors-gcp-lb.tf similarity index 100% rename from monitors-unready/monitors-gcp-lb.tf rename to incubator/monitors-gcp-lb.tf diff --git a/monitors-unready/monitors-gcp-vpn.tf b/incubator/monitors-gcp-vpn.tf similarity index 100% rename from monitors-unready/monitors-gcp-vpn.tf rename to incubator/monitors-gcp-vpn.tf diff --git a/monitors-unready/monitors-kubernetes.tf b/incubator/monitors-kubernetes.tf similarity index 100% rename from monitors-unready/monitors-kubernetes.tf rename to incubator/monitors-kubernetes.tf diff --git a/monitors-unready/monitors-linux-basics.log b/incubator/monitors-linux-basics.log similarity index 100% rename from monitors-unready/monitors-linux-basics.log rename to incubator/monitors-linux-basics.log diff --git a/monitors-unready/monitors-linux-basics.tf b/incubator/monitors-linux-basics.tf similarity index 100% rename from monitors-unready/monitors-linux-basics.tf rename to incubator/monitors-linux-basics.tf diff --git a/monitors-unready/monitors-redis-containers.tf b/incubator/monitors-redis-containers.tf similarity index 100% rename from monitors-unready/monitors-redis-containers.tf rename to incubator/monitors-redis-containers.tf diff --git a/monitors-unready/monitors-redis.tf b/incubator/monitors-redis.tf similarity index 100% rename from monitors-unready/monitors-redis.tf rename to incubator/monitors-redis.tf diff --git a/os/linux/inputs.tf b/system/generic/inputs.tf similarity index 100% rename from os/linux/inputs.tf rename to system/generic/inputs.tf diff --git a/system/cpu/monitors-custom-cpu.tf b/system/generic/monitors-custom-cpu.tf similarity index 100% rename from system/cpu/monitors-custom-cpu.tf rename to system/generic/monitors-custom-cpu.tf diff --git a/system/cpu/inputs.tf b/system/linux/inputs.tf similarity index 100% rename from system/cpu/inputs.tf rename to system/linux/inputs.tf diff --git a/os/linux/monitors-linux-basics.tf b/system/linux/monitors-linux-basics.tf similarity index 100% rename from os/linux/monitors-linux-basics.tf rename to system/linux/monitors-linux-basics.tf