diff --git a/caas/docker/README.md b/caas/docker/README.md index dd18f9c4..30561217 100644 --- a/caas/docker/README.md +++ b/caas/docker/README.md @@ -73,6 +73,8 @@ Creates DataDog monitors with the following checks: | [not\_responding\_threshold\_warning](#input\_not\_responding\_threshold\_warning) | Docker does not respond monitor (warning threshold) | `string` | `3` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/caas/docker/common-inputs.tf b/caas/docker/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/caas/docker/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/docker/common-locals.tf b/caas/docker/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/caas/docker/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/caas/docker/inputs.tf b/caas/docker/inputs.tf index 7d662551..f8d6ca7d 100644 --- a/caas/docker/inputs.tf +++ b/caas/docker/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:docker", "provider:docker", "resource:docker"] } # Global DataDog @@ -130,4 +130,4 @@ variable "memory_used_extra_tags" { description = "Extra tags for Container Memory Usage monitor" type = list(string) default = [] -} +} \ No newline at end of file diff --git a/caas/docker/monitors-docker.tf b/caas/docker/monitors-docker.tf index 949f7643..6f2a2538 100644 --- a/caas/docker/monitors-docker.tf +++ b/caas/docker/monitors-docker.tf @@ -26,7 +26,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:docker", "provider:docker", "resource:docker", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags) + tags = concat(local.common_tags, var.tags, var.not_responding_extra_tags) } resource "datadog_monitor" "memory_used" { @@ -56,6 +56,6 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.memory_used_extra_tags) } diff --git a/caas/kubernetes/ark/README.md b/caas/kubernetes/ark/README.md index d33f6c09..ea6d5671 100644 --- a/caas/kubernetes/ark/README.md +++ b/caas/kubernetes/ark/README.md @@ -54,7 +54,7 @@ Creates DataDog monitors with the following checks: | [ark\_schedules\_monitor\_message](#input\_ark\_schedules\_monitor\_message) | Custom message for Ark schedules monitor | `string` | `""` | no | | [ark\_schedules\_monitor\_no\_data\_timeframe](#input\_ark\_schedules\_monitor\_no\_data\_timeframe) | No data timeframe in minutes | `number` | `2880` | no | | [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 | -| [environment](#input\_environment) | Architecture environment | `any` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:docker",
"provider:docker",
"resource:docker"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/caas/kubernetes/ark/common-inputs.tf b/caas/kubernetes/ark/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/caas/kubernetes/ark/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/ark/common-locals.tf b/caas/kubernetes/ark/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/caas/kubernetes/ark/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/ark/inputs.tf b/caas/kubernetes/ark/inputs.tf index 2613ddc1..f643b036 100644 --- a/caas/kubernetes/ark/inputs.tf +++ b/caas/kubernetes/ark/inputs.tf @@ -1,9 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:prometheus", "resource:ark"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" @@ -54,7 +55,6 @@ variable "notify_no_data" { } # Datadog monitors variables - variable "ark_schedules_monitor_message" { description = "Custom message for Ark schedules monitor" type = string @@ -83,4 +83,3 @@ variable "ark_schedules_monitor_no_data_timeframe" { description = "No data timeframe in minutes" default = 2880 } - diff --git a/caas/kubernetes/ark/monitors-ark.tf b/caas/kubernetes/ark/monitors-ark.tf index c3a30c7d..a663ec98 100644 --- a/caas/kubernetes/ark/monitors-ark.tf +++ b/caas/kubernetes/ark/monitors-ark.tf @@ -14,7 +14,6 @@ EOQ } evaluation_delay = var.evaluation_delay - new_host_delay = var.new_host_delay new_group_delay = var.new_group_delay no_data_timeframe = var.ark_schedules_monitor_no_data_timeframe @@ -25,6 +24,5 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.ark_schedules_extra_tags) } - diff --git a/caas/kubernetes/cluster/README.md b/caas/kubernetes/cluster/README.md index bedbbd71..0020fa2e 100644 --- a/caas/kubernetes/cluster/README.md +++ b/caas/kubernetes/cluster/README.md @@ -54,7 +54,7 @@ Creates DataDog monitors with the following checks: | [apiserver\_message](#input\_apiserver\_message) | Custom message for API server monitor | `string` | `""` | no | | [apiserver\_no\_data\_timeframe](#input\_apiserver\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [apiserver\_threshold\_warning](#input\_apiserver\_threshold\_warning) | API server monitor (warning threshold) | `string` | `3` | no | -| [environment](#input\_environment) | Architecture environment | `any` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -65,6 +65,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:caas",
"provider:prometheus",
"resource:ark"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/caas/kubernetes/cluster/common-inputs.tf b/caas/kubernetes/cluster/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/caas/kubernetes/cluster/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/cluster/common-locals.tf b/caas/kubernetes/cluster/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/caas/kubernetes/cluster/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/cluster/inputs.tf b/caas/kubernetes/cluster/inputs.tf index e43acfdb..1f2249ca 100644 --- a/caas/kubernetes/cluster/inputs.tf +++ b/caas/kubernetes/cluster/inputs.tf @@ -1,9 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:kubernetes", "resource:kubernetes-node"] } +# Datadog global variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/caas/kubernetes/cluster/monitors-k8s-cluster.tf b/caas/kubernetes/cluster/monitors-k8s-cluster.tf index 6e93407a..b6c63f8d 100644 --- a/caas/kubernetes/cluster/monitors-k8s-cluster.tf +++ b/caas/kubernetes/cluster/monitors-k8s-cluster.tf @@ -24,6 +24,5 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.apiserver_extra_tags) } - diff --git a/caas/kubernetes/ingress/vts/README.md b/caas/kubernetes/ingress/vts/README.md index e8b2ba32..6b8413d5 100644 --- a/caas/kubernetes/ingress/vts/README.md +++ b/caas/kubernetes/ingress/vts/README.md @@ -79,6 +79,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:caas",
"provider:kubernetes",
"resource:kubernetes-node"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/caas/kubernetes/ingress/vts/common-inputs.tf b/caas/kubernetes/ingress/vts/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/caas/kubernetes/ingress/vts/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/ingress/vts/common-locals.tf b/caas/kubernetes/ingress/vts/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/caas/kubernetes/ingress/vts/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/ingress/vts/inputs.tf b/caas/kubernetes/ingress/vts/inputs.tf index e401f507..19f3974a 100644 --- a/caas/kubernetes/ingress/vts/inputs.tf +++ b/caas/kubernetes/ingress/vts/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:prometheus", "resource:nginx-ingress-controller"] } # Global DataDog diff --git a/caas/kubernetes/ingress/vts/monitors-ingress.tf b/caas/kubernetes/ingress/vts/monitors-ingress.tf index 964ba926..87064b5a 100644 --- a/caas/kubernetes/ingress/vts/monitors-ingress.tf +++ b/caas/kubernetes/ingress/vts/monitors-ingress.tf @@ -26,7 +26,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.ingress_5xx_extra_tags) } resource "datadog_monitor" "nginx_ingress_too_many_4xx" { @@ -57,6 +57,6 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.ingress_4xx_extra_tags) } diff --git a/caas/kubernetes/node/README.md b/caas/kubernetes/node/README.md index 937eef43..c641ca72 100644 --- a/caas/kubernetes/node/README.md +++ b/caas/kubernetes/node/README.md @@ -76,7 +76,7 @@ Creates DataDog monitors with the following checks: | [disk\_pressure\_extra\_tags](#input\_disk\_pressure\_extra\_tags) | Extra tags for Disk pressure monitor | `list(string)` | `[]` | no | | [disk\_pressure\_message](#input\_disk\_pressure\_message) | Custom message for Disk pressure monitor | `string` | `""` | no | | [disk\_pressure\_threshold\_warning](#input\_disk\_pressure\_threshold\_warning) | Disk pressure monitor (warning threshold) | `string` | `3` | no | -| [environment](#input\_environment) | Architecture environment | `any` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -109,6 +109,8 @@ Creates DataDog monitors with the following checks: | [ready\_extra\_tags](#input\_ready\_extra\_tags) | Extra tags for Node ready monitor | `list(string)` | `[]` | no | | [ready\_message](#input\_ready\_message) | Custom message for Node ready monitor | `string` | `""` | no | | [ready\_threshold\_warning](#input\_ready\_threshold\_warning) | Node ready monitor (warning threshold) | `string` | `3` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:caas",
"provider:prometheus",
"resource:nginx-ingress-controller"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [unregister\_net\_device\_enabled](#input\_unregister\_net\_device\_enabled) | Flag to enable Unregister net device monitor | `string` | `"true"` | no | | [unregister\_net\_device\_extra\_tags](#input\_unregister\_net\_device\_extra\_tags) | Extra tags for Unregister net device monitor | `list(string)` | `[]` | no | diff --git a/caas/kubernetes/node/common-inputs.tf b/caas/kubernetes/node/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/caas/kubernetes/node/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/node/common-locals.tf b/caas/kubernetes/node/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/caas/kubernetes/node/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/node/inputs.tf b/caas/kubernetes/node/inputs.tf index dc3fe5e9..6dc3f091 100644 --- a/caas/kubernetes/node/inputs.tf +++ b/caas/kubernetes/node/inputs.tf @@ -1,9 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:kubernetes", "resource:kubernetes-node"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/caas/kubernetes/node/monitors-k8s-node.tf b/caas/kubernetes/node/monitors-k8s-node.tf index 8ab084c8..5c46795b 100644 --- a/caas/kubernetes/node/monitors-k8s-node.tf +++ b/caas/kubernetes/node/monitors-k8s-node.tf @@ -22,7 +22,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.disk_pressure_extra_tags) } resource "datadog_monitor" "disk_out" { @@ -49,7 +49,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.disk_out_extra_tags) } resource "datadog_monitor" "memory_pressure" { @@ -76,7 +76,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.memory_pressure_extra_tags) } resource "datadog_monitor" "ready" { @@ -103,7 +103,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.ready_extra_tags) } resource "datadog_monitor" "kubelet_ping" { @@ -131,7 +131,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.kubelet_ping_extra_tags) } resource "datadog_monitor" "kubelet_syncloop" { @@ -158,7 +158,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.kubelet_syncloop_extra_tags) } resource "datadog_monitor" "unregister_net_device" { @@ -176,7 +176,7 @@ resource "datadog_monitor" "unregister_net_device" { timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:caas", "provider:kubernetes", "resource:kubernetes-node", "team:claranet", "created-by:terraform"], var.unregister_net_device_extra_tags) + tags = concat(local.common_tags, var.tags, var.unregister_net_device_extra_tags) } resource "datadog_monitor" "node_unschedulable" { @@ -205,7 +205,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.node_unschedulable_extra_tags) } resource "datadog_monitor" "volume_space" { @@ -236,7 +236,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.volume_space_extra_tags) } resource "datadog_monitor" "volume_inodes" { @@ -267,5 +267,5 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.volume_inodes_extra_tags) } diff --git a/caas/kubernetes/pod/README.md b/caas/kubernetes/pod/README.md index db7bf97b..3788d344 100644 --- a/caas/kubernetes/pod/README.md +++ b/caas/kubernetes/pod/README.md @@ -55,7 +55,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `any` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [error\_enabled](#input\_error\_enabled) | Flag to enable Pod errors monitor | `string` | `"true"` | no | | [error\_extra\_tags](#input\_error\_extra\_tags) | Extra tags for Pod errors monitor | `list(string)` | `[]` | no | | [error\_message](#input\_error\_message) | Custom message for Pod errors monitor | `string` | `""` | no | @@ -80,6 +80,8 @@ Creates DataDog monitors with the following checks: | [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 | | [pod\_status\_group\_by](#input\_pod\_status\_group\_by) | Select group by element on monitors (phase status) | `list` |
"type:caas",
"provider:kubernetes",
"resource:kubernetes-node"
]
[| no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"namespace",
"kube_cluster_name"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [terminated\_enabled](#input\_terminated\_enabled) | Flag to enable Pod terminated monitor | `string` | `"true"` | no | | [terminated\_extra\_tags](#input\_terminated\_extra\_tags) | Extra tags for Pod terminated monitor | `list(string)` | `[]` | no | | [terminated\_message](#input\_terminated\_message) | Custom message for Pod terminated monitor | `string` | `""` | no | diff --git a/caas/kubernetes/pod/common-inputs.tf b/caas/kubernetes/pod/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/caas/kubernetes/pod/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/pod/common-locals.tf b/caas/kubernetes/pod/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/caas/kubernetes/pod/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/pod/inputs.tf b/caas/kubernetes/pod/inputs.tf index ef742030..70e13f0d 100644 --- a/caas/kubernetes/pod/inputs.tf +++ b/caas/kubernetes/pod/inputs.tf @@ -1,9 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:kubernetes", "resource:kubernetes-pod"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/caas/kubernetes/pod/monitors-k8s-pod.tf b/caas/kubernetes/pod/monitors-k8s-pod.tf index 1986d274..3a1c9a8b 100644 --- a/caas/kubernetes/pod/monitors-k8s-pod.tf +++ b/caas/kubernetes/pod/monitors-k8s-pod.tf @@ -24,7 +24,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.pod_phase_status_extra_tags) } resource "datadog_monitor" "error" { @@ -54,7 +54,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.error_extra_tags) } resource "datadog_monitor" "terminated" { @@ -84,6 +84,6 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.terminated_extra_tags) } diff --git a/caas/kubernetes/velero/README.md b/caas/kubernetes/velero/README.md index 06578a5b..fabfbb98 100644 --- a/caas/kubernetes/velero/README.md +++ b/caas/kubernetes/velero/README.md @@ -58,7 +58,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `any` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -69,6 +69,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:caas",
"provider:kubernetes",
"resource:kubernetes-pod"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [velero\_backup\_deletion\_failure\_enabled](#input\_velero\_backup\_deletion\_failure\_enabled) | Flag to enable Velero backup deletion failure monitor | `string` | `"true"` | no | | [velero\_backup\_deletion\_failure\_extra\_tags](#input\_velero\_backup\_deletion\_failure\_extra\_tags) | Extra tags for Velero backup deletion failure monitor | `list(string)` | `[]` | no | diff --git a/caas/kubernetes/velero/common-inputs.tf b/caas/kubernetes/velero/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/caas/kubernetes/velero/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/velero/common-locals.tf b/caas/kubernetes/velero/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/caas/kubernetes/velero/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/velero/inputs.tf b/caas/kubernetes/velero/inputs.tf index 6e53a525..8480be31 100644 --- a/caas/kubernetes/velero/inputs.tf +++ b/caas/kubernetes/velero/inputs.tf @@ -1,9 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:openmetrics", "resource:velero"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/caas/kubernetes/velero/monitors-velero.tf b/caas/kubernetes/velero/monitors-velero.tf index 6f33982d..34b2dee8 100644 --- a/caas/kubernetes/velero/monitors-velero.tf +++ b/caas/kubernetes/velero/monitors-velero.tf @@ -24,7 +24,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.velero_scheduled_backup_missing_extra_tags) } resource "datadog_monitor" "velero_backup_failure" { @@ -53,7 +53,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.velero_backup_failure_extra_tags) } resource "datadog_monitor" "velero_backup_partial_failure" { @@ -82,7 +82,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.velero_backup_partial_failure_extra_tags) } resource "datadog_monitor" "velero_backup_deletion_failure" { @@ -111,7 +111,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.velero_backup_deletion_failure_extra_tags) } resource "datadog_monitor" "velero_volume_snapshot_failure" { @@ -140,6 +140,6 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.velero_volume_snapshot_failure_extra_tags) } diff --git a/caas/kubernetes/workload/README.md b/caas/kubernetes/workload/README.md index f05167e5..e550adf9 100644 --- a/caas/kubernetes/workload/README.md +++ b/caas/kubernetes/workload/README.md @@ -61,7 +61,7 @@ Creates DataDog monitors with the following checks: | [cronjob\_extra\_tags](#input\_cronjob\_extra\_tags) | Extra tags for Cronjob monitor | `list(string)` | `[]` | no | | [cronjob\_message](#input\_cronjob\_message) | Custom message for Cronjob monitor | `string` | `""` | no | | [cronjob\_threshold\_warning](#input\_cronjob\_threshold\_warning) | Cronjob monitor (warning threshold) | `string` | `3` | no | -| [environment](#input\_environment) | Architecture environment | `any` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -95,6 +95,8 @@ Creates DataDog monitors with the following checks: | [replica\_ready\_threshold\_critical](#input\_replica\_ready\_threshold\_critical) | Ready replica critical threshold | `number` | `1` | no | | [replica\_ready\_time\_aggregator](#input\_replica\_ready\_time\_aggregator) | Monitor aggregator for Ready replica [available values: min, max or avg] | `string` | `"max"` | no | | [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 | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:caas",
"provider:openmetrics",
"resource:velero"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/caas/kubernetes/workload/common-inputs.tf b/caas/kubernetes/workload/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/caas/kubernetes/workload/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/caas/kubernetes/workload/common-locals.tf b/caas/kubernetes/workload/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/caas/kubernetes/workload/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/caas/kubernetes/workload/inputs.tf b/caas/kubernetes/workload/inputs.tf index 99208f67..50da5c7a 100644 --- a/caas/kubernetes/workload/inputs.tf +++ b/caas/kubernetes/workload/inputs.tf @@ -1,9 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" +# Global variables +variable "tags" { + type = list(string) + default = ["type:caas", "provider:kubernetes", "resource:kubernetes-workload"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/caas/kubernetes/workload/monitors-k8s-workload.tf b/caas/kubernetes/workload/monitors-k8s-workload.tf index b07a7ac2..41197ff9 100644 --- a/caas/kubernetes/workload/monitors-k8s-workload.tf +++ b/caas/kubernetes/workload/monitors-k8s-workload.tf @@ -22,7 +22,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.job_extra_tags) } resource "datadog_monitor" "cronjob" { @@ -49,7 +49,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.cronjob_extra_tags) } resource "datadog_monitor" "replica_available" { @@ -79,7 +79,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.replica_available_extra_tags) } resource "datadog_monitor" "replica_ready" { @@ -109,7 +109,7 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.replica_ready_extra_tags) } resource "datadog_monitor" "replica_current" { @@ -139,6 +139,6 @@ EOQ include_tags = true 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) + tags = concat(local.common_tags, var.tags, var.replica_current_extra_tags) } diff --git a/cloud/aws/alb/README.md b/cloud/aws/alb/README.md index 82e7298d..494830e5 100644 --- a/cloud/aws/alb/README.md +++ b/cloud/aws/alb/README.md @@ -67,7 +67,7 @@ Creates DataDog monitors with the following checks: | [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 | | [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 | | [artificial\_requests\_count](#input\_artificial\_requests\_count) | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -113,6 +113,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:caas",
"provider:kubernetes",
"resource:kubernetes-workload"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/alb/common-inputs.tf b/cloud/aws/alb/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/alb/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/alb/common-locals.tf b/cloud/aws/alb/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/alb/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/alb/inputs.tf b/cloud/aws/alb/inputs.tf index eb1ac103..83587b0b 100644 --- a/cloud/aws/alb/inputs.tf +++ b/cloud/aws/alb/inputs.tf @@ -1,10 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:alb"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/aws/alb/monitors-alb.tf b/cloud/aws/alb/monitors-alb.tf index dba960d0..fd2768ef 100644 --- a/cloud/aws/alb/monitors-alb.tf +++ b/cloud/aws/alb/monitors-alb.tf @@ -27,7 +27,7 @@ EOQ timeout_h = var.timeout_h 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) + tags = concat(local.common_tags, var.tags, var.alb_no_healthy_instances_extra_tags) } resource "datadog_monitor" "ALB_latency" { @@ -56,7 +56,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:alb", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } resource "datadog_monitor" "ALB_httpcode_5xx" { @@ -86,7 +86,7 @@ EOQ timeout_h = var.timeout_h 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) + tags = concat(local.common_tags, var.tags, var.httpcode_alb_5xx_extra_tags) } resource "datadog_monitor" "ALB_httpcode_4xx" { @@ -116,7 +116,7 @@ EOQ timeout_h = var.timeout_h 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) + tags = concat(local.common_tags, var.tags, var.httpcode_alb_4xx_extra_tags) } resource "datadog_monitor" "ALB_httpcode_target_5xx" { @@ -146,7 +146,7 @@ EOQ timeout_h = var.timeout_h 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) + tags = concat(local.common_tags, var.tags, var.httpcode_target_5xx_extra_tags) } resource "datadog_monitor" "ALB_httpcode_target_4xx" { @@ -176,6 +176,6 @@ EOQ timeout_h = var.timeout_h 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) + tags = concat(local.common_tags, var.tags, var.httpcode_target_4xx_extra_tags) } diff --git a/cloud/aws/apigateway/README.md b/cloud/aws/apigateway/README.md index 2a469d8f..ca0e7113 100644 --- a/cloud/aws/apigateway/README.md +++ b/cloud/aws/apigateway/README.md @@ -52,7 +52,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [artificial\_requests\_count](#input\_artificial\_requests\_count) | Number of false requests used to mitigate false positive in case of low trafic | `number` | `5` | no | -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [http\_4xx\_requests\_enabled](#input\_http\_4xx\_requests\_enabled) | Flag to enable API Gateway HTTP 4xx requests monitor | `string` | `"true"` | no | @@ -81,6 +81,8 @@ No modules. | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:alb"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/apigateway/common-inputs.tf b/cloud/aws/apigateway/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/apigateway/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/apigateway/common-locals.tf b/cloud/aws/apigateway/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/apigateway/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/apigateway/inputs.tf b/cloud/aws/apigateway/inputs.tf index 710a8df3..085be0b3 100644 --- a/cloud/aws/apigateway/inputs.tf +++ b/cloud/aws/apigateway/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:apigateway"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/aws/apigateway/monitors-api.tf b/cloud/aws/apigateway/monitors-api.tf index 3b933aee..78fd4f2a 100644 --- a/cloud/aws/apigateway/monitors-api.tf +++ b/cloud/aws/apigateway/monitors-api.tf @@ -25,7 +25,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:apigateway", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } # Monitoring API Gateway 5xx errors percent @@ -56,7 +56,7 @@ EOQ timeout_h = 1 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) + tags = concat(local.common_tags, var.tags, var.http_5xx_requests_extra_tags) } # Monitoring API Gateway 4xx errors percent @@ -87,6 +87,6 @@ EOQ timeout_h = 1 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) + tags = concat(local.common_tags, var.tags, var.http_4xx_requests_extra_tags) } diff --git a/cloud/aws/beanstalk/README.md b/cloud/aws/beanstalk/README.md index ad44eba3..e016dd85 100644 --- a/cloud/aws/beanstalk/README.md +++ b/cloud/aws/beanstalk/README.md @@ -96,6 +96,8 @@ Creates DataDog monitors with the following checks: | [root\_filesystem\_usage\_threshold\_warning](#input\_root\_filesystem\_usage\_threshold\_warning) | File system usage warning threshold in percent | `string` | `80` | no | | [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 | | [root\_filesystem\_usage\_timeout\_h](#input\_root\_filesystem\_usage\_timeout\_h) | File system usage auto-resolving state (in hours) | `number` | `0` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:apigateway"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/beanstalk/common-inputs.tf b/cloud/aws/beanstalk/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/beanstalk/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/beanstalk/common-locals.tf b/cloud/aws/beanstalk/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/beanstalk/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/beanstalk/inputs.tf b/cloud/aws/beanstalk/inputs.tf index 620b476e..921aacd9 100644 --- a/cloud/aws/beanstalk/inputs.tf +++ b/cloud/aws/beanstalk/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:beanstalk"] } # Global DataDog diff --git a/cloud/aws/beanstalk/monitors-beanstalk.tf b/cloud/aws/beanstalk/monitors-beanstalk.tf index 4b7750a7..03d017c8 100644 --- a/cloud/aws/beanstalk/monitors-beanstalk.tf +++ b/cloud/aws/beanstalk/monitors-beanstalk.tf @@ -24,7 +24,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.health_extra_tags) + tags = concat(local.common_tags, var.tags, var.health_extra_tags) } resource "datadog_monitor" "application_latency_p90" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.application_latency_p90_extra_tags) + tags = concat(local.common_tags, var.tags, var.application_latency_p90_extra_tags) } resource "datadog_monitor" "application_5xx_error_rate" { @@ -78,7 +78,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.application_5xx_error_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.application_5xx_error_rate_extra_tags) } resource "datadog_monitor" "root_filesystem_usage" { @@ -105,6 +105,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:beanstalk", "team:claranet", "created-by:terraform"], var.root_filesystem_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.root_filesystem_usage_extra_tags) } diff --git a/cloud/aws/ecs/common/README.md b/cloud/aws/ecs/common/README.md index 684e66cd..36f6f651 100644 --- a/cloud/aws/ecs/common/README.md +++ b/cloud/aws/ecs/common/README.md @@ -53,7 +53,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | @@ -86,6 +86,8 @@ Creates DataDog monitors with the following checks: | [service\_missing\_tasks\_threshold\_warning](#input\_service\_missing\_tasks\_threshold\_warning) | Warning threshold for the Service Missing Tasks monitor | `string` | `80` | no | | [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 | | [service\_missing\_tasks\_timeframe](#input\_service\_missing\_tasks\_timeframe) | Timeframe for the Service Missing Tasks monitor | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:beanstalk"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/ecs/common/common-inputs.tf b/cloud/aws/ecs/common/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/ecs/common/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/ecs/common/common-locals.tf b/cloud/aws/ecs/common/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/ecs/common/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/ecs/common/inputs.tf b/cloud/aws/ecs/common/inputs.tf index be799324..a4762ce7 100644 --- a/cloud/aws/ecs/common/inputs.tf +++ b/cloud/aws/ecs/common/inputs.tf @@ -1,11 +1,11 @@ +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:ecs", "category:service"] +} # # Datadog global variables # -variable "environment" { - description = "Architecture environment" - type = string -} - variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/aws/ecs/ec2-cluster/README.md b/cloud/aws/ecs/ec2-cluster/README.md index 1aff69ac..2ff4dd78 100644 --- a/cloud/aws/ecs/ec2-cluster/README.md +++ b/cloud/aws/ecs/ec2-cluster/README.md @@ -72,7 +72,7 @@ Creates DataDog monitors with the following checks: | [cluster\_memory\_reservation\_threshold\_warning](#input\_cluster\_memory\_reservation\_threshold\_warning) | Warning threshold for the Cluster Memory Reservation monitor | `string` | `85` | no | | [cluster\_memory\_reservation\_time\_aggregator](#input\_cluster\_memory\_reservation\_time\_aggregator) | Monitor aggregator for Cluster Memory Reservation [available values: min, max or avg] | `string` | `"min"` | no | | [cluster\_memory\_reservation\_timeframe](#input\_cluster\_memory\_reservation\_timeframe) | Timeframe for the Cluster Memory Reservation monitor | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -82,6 +82,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:ecs",
"category:service"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/ecs/ec2-cluster/common-inputs.tf b/cloud/aws/ecs/ec2-cluster/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/ecs/ec2-cluster/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/ecs/ec2-cluster/common-locals.tf b/cloud/aws/ecs/ec2-cluster/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/ecs/ec2-cluster/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/ecs/ec2-cluster/inputs.tf b/cloud/aws/ecs/ec2-cluster/inputs.tf index b503a15d..0b45c989 100644 --- a/cloud/aws/ecs/ec2-cluster/inputs.tf +++ b/cloud/aws/ecs/ec2-cluster/inputs.tf @@ -1,11 +1,12 @@ +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:ecs", "category:agent"] +} + # # Datadog global variables # -variable "environment" { - description = "Architecture environment" - type = string -} - variable "message" { description = "Message sent when a monitor is triggered" } diff --git a/cloud/aws/ecs/ec2-cluster/monitors-ecs-ec2-cluster.tf b/cloud/aws/ecs/ec2-cluster/monitors-ecs-ec2-cluster.tf index 43f1cbde..b0989a2c 100644 --- a/cloud/aws/ecs/ec2-cluster/monitors-ecs-ec2-cluster.tf +++ b/cloud/aws/ecs/ec2-cluster/monitors-ecs-ec2-cluster.tf @@ -26,7 +26,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:agent"], var.agent_status_extra_tags) + tags = concat(local.common_tags, var.tags, var.agent_status_extra_tags) } resource "datadog_monitor" "cluster_cpu_utilization" { @@ -57,7 +57,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:cluster"], var.cluster_cpu_utilization_extra_tags) + tags = concat(local.common_tags, var.tags, var.cluster_cpu_utilization_extra_tags) } @@ -89,5 +89,5 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs", "team:claranet", "created-by:terraform", "category:cluster"], var.cluster_memory_reservation_extra_tags) + tags = concat(local.common_tags, var.tags, var.cluster_memory_reservation_extra_tags) } diff --git a/cloud/aws/ecs/fargate/README.md b/cloud/aws/ecs/fargate/README.md index 1d97e4be..c3684f4e 100644 --- a/cloud/aws/ecs/fargate/README.md +++ b/cloud/aws/ecs/fargate/README.md @@ -60,7 +60,7 @@ Creates DataDog monitors with the following checks: | [cpu\_utilization\_threshold\_warning](#input\_cpu\_utilization\_threshold\_warning) | Warning threshold for the monitor | `string` | `85` | no | | [cpu\_utilization\_time\_aggregator](#input\_cpu\_utilization\_time\_aggregator) | Monitor aggregator (min, max or avg) | `string` | `"min"` | no | | [cpu\_utilization\_timeframe](#input\_cpu\_utilization\_timeframe) | Timeframe for the monitor | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -84,6 +84,8 @@ Creates DataDog monitors with the following checks: | [service\_check\_no\_data\_timeframe](#input\_service\_check\_no\_data\_timeframe) | No data timeframe in minutes | `number` | `10` | no | | [service\_check\_threshold\_warning](#input\_service\_check\_threshold\_warning) | Warning threshold | `number` | `3` | no | | [service\_group\_by](#input\_service\_group\_by) | Service check grouping by | `string` | `"*"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:ecs",
"category:agent"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/ecs/fargate/common-inputs.tf b/cloud/aws/ecs/fargate/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/ecs/fargate/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/ecs/fargate/common-locals.tf b/cloud/aws/ecs/fargate/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/ecs/fargate/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/ecs/fargate/inputs.tf b/cloud/aws/ecs/fargate/inputs.tf index 80b6e257..6468dbe7 100644 --- a/cloud/aws/ecs/fargate/inputs.tf +++ b/cloud/aws/ecs/fargate/inputs.tf @@ -1,10 +1,10 @@ -# Generics - -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:ecs_fargate", "category:service"] } +# Generics variable "message" { type = string description = "Message sent when a monitor is triggered" diff --git a/cloud/aws/ecs/fargate/monitors-ecs-fargate.tf b/cloud/aws/ecs/fargate/monitors-ecs-fargate.tf index 7084bfcc..58dab26e 100644 --- a/cloud/aws/ecs/fargate/monitors-ecs-fargate.tf +++ b/cloud/aws/ecs/fargate/monitors-ecs-fargate.tf @@ -57,7 +57,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs_fargate", "team:claranet", "created-by:terraform"], var.cpu_utilization_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_utilization_extra_tags) } @@ -91,6 +91,6 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:ecs_fargate", "team:claranet", "created-by:terraform"], var.memory_utilization_extra_tags) + tags = concat(local.common_tags, var.tags, var.memory_utilization_extra_tags) } diff --git a/cloud/aws/elasticache/common/README.md b/cloud/aws/elasticache/common/README.md index db381c3b..a7fbf688 100644 --- a/cloud/aws/elasticache/common/README.md +++ b/cloud/aws/elasticache/common/README.md @@ -60,7 +60,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [elasticache\_max\_connection\_no\_data\_timeframe](#input\_elasticache\_max\_connection\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | -| [environment](#input\_environment) | Infrastructure Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [eviction\_enabled](#input\_eviction\_enabled) | Flag to enable Elasticache eviction monitor | `string` | `"true"` | no | | [eviction\_extra\_tags](#input\_eviction\_extra\_tags) | Extra tags for Elasticache eviction monitor | `list(string)` | `[]` | no | @@ -108,6 +108,8 @@ Creates DataDog monitors with the following checks: | [swap\_threshold\_warning](#input\_swap\_threshold\_warning) | Elasticache swap warning threshold in bytes | `string` | `0` | no | | [swap\_time\_aggregator](#input\_swap\_time\_aggregator) | Monitor aggregator for Elasticache memcached swap [available values: min, max or avg] | `string` | `"min"` | no | | [swap\_timeframe](#input\_swap\_timeframe) | Monitor timeframe for Elasticache swap [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:ecs_fargate",
"category:service"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/elasticache/common/common-inputs.tf b/cloud/aws/elasticache/common/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/elasticache/common/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/elasticache/common/common-locals.tf b/cloud/aws/elasticache/common/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/elasticache/common/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/elasticache/common/inputs.tf b/cloud/aws/elasticache/common/inputs.tf index 3c94d349..3d78b54a 100644 --- a/cloud/aws/elasticache/common/inputs.tf +++ b/cloud/aws/elasticache/common/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Infrastructure Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:elasticache"] } # Global DataDog diff --git a/cloud/aws/elasticache/memcached/README.md b/cloud/aws/elasticache/memcached/README.md index dcb0c0de..51366397 100644 --- a/cloud/aws/elasticache/memcached/README.md +++ b/cloud/aws/elasticache/memcached/README.md @@ -58,7 +58,7 @@ Creates DataDog monitors with the following checks: | [cpu\_high\_threshold\_warning](#input\_cpu\_high\_threshold\_warning) | Elasticache memcached cpu high warning threshold in percentage | `string` | `75` | no | | [cpu\_high\_time\_aggregator](#input\_cpu\_high\_time\_aggregator) | Monitor aggregator for Elasticache memcached cpu high [available values: min, max or avg] | `string` | `"min"` | no | | [cpu\_high\_timeframe](#input\_cpu\_high\_timeframe) | Monitor timeframe for Elasticache memcached cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no | -| [environment](#input\_environment) | Infrastructure Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -76,6 +76,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:elasticache"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/elasticache/memcached/common-inputs.tf b/cloud/aws/elasticache/memcached/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/elasticache/memcached/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/elasticache/memcached/common-locals.tf b/cloud/aws/elasticache/memcached/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/elasticache/memcached/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/elasticache/memcached/inputs.tf b/cloud/aws/elasticache/memcached/inputs.tf index 20178ad5..6fa18546 100644 --- a/cloud/aws/elasticache/memcached/inputs.tf +++ b/cloud/aws/elasticache/memcached/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Infrastructure Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:elasticache-memcached", "engine:memcached"] } # Global DataDog diff --git a/cloud/aws/elasticache/memcached/monitors-memcached.tf b/cloud/aws/elasticache/memcached/monitors-memcached.tf index c8b3b330..0fe8583e 100644 --- a/cloud/aws/elasticache/memcached/monitors-memcached.tf +++ b/cloud/aws/elasticache/memcached/monitors-memcached.tf @@ -27,7 +27,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "engine:memcached"], var.get_hits_extra_tags) + tags = concat(local.common_tags, var.tags, var.get_hits_extra_tags) } resource "datadog_monitor" "memcached_cpu_high" { @@ -58,6 +58,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-memcached", "team:claranet", "created-by:terraform", "engine:memcached"], var.cpu_high_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_high_extra_tags) } diff --git a/cloud/aws/elasticache/redis/README.md b/cloud/aws/elasticache/redis/README.md index 7cfa6f0c..b17d6885 100644 --- a/cloud/aws/elasticache/redis/README.md +++ b/cloud/aws/elasticache/redis/README.md @@ -73,7 +73,7 @@ Creates DataDog monitors with the following checks: | [cpu\_high\_threshold\_warning](#input\_cpu\_high\_threshold\_warning) | Elasticache redis cpu high warning threshold in percentage | `string` | `75` | no | | [cpu\_high\_time\_aggregator](#input\_cpu\_high\_time\_aggregator) | Monitor aggregator for Elasticache redis cpu high [available values: min, max or avg] | `string` | `"min"` | no | | [cpu\_high\_timeframe](#input\_cpu\_high\_timeframe) | Monitor timeframe for Elasticache redis cpu high [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no | -| [environment](#input\_environment) | Infrastructure Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -92,6 +92,8 @@ Creates DataDog monitors with the following checks: | [replication\_lag\_threshold\_warning](#input\_replication\_lag\_threshold\_warning) | Elasticache redis replication lag warning threshold in seconds | `string` | `90` | no | | [replication\_lag\_time\_aggregator](#input\_replication\_lag\_time\_aggregator) | Monitor aggregator for Elasticache redis replication lag [available values: min, max or avg] | `string` | `"min"` | no | | [replication\_lag\_timeframe](#input\_replication\_lag\_timeframe) | Monitor timeframe for Elasticache redis replication lag [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_10m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:elasticache-memcached",
"engine:memcached"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/elasticache/redis/common-inputs.tf b/cloud/aws/elasticache/redis/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/elasticache/redis/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/elasticache/redis/common-locals.tf b/cloud/aws/elasticache/redis/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/elasticache/redis/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/elasticache/redis/inputs.tf b/cloud/aws/elasticache/redis/inputs.tf index b23c2833..7e57c72a 100644 --- a/cloud/aws/elasticache/redis/inputs.tf +++ b/cloud/aws/elasticache/redis/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Infrastructure Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:elasticache-redis", "engine:redis"] } # Global DataDog diff --git a/cloud/aws/elasticache/redis/monitors-redis.tf b/cloud/aws/elasticache/redis/monitors-redis.tf index 80901261..6c204570 100644 --- a/cloud/aws/elasticache/redis/monitors-redis.tf +++ b/cloud/aws/elasticache/redis/monitors-redis.tf @@ -27,7 +27,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.cache_hits_extra_tags) + tags = concat(local.common_tags, var.tags, var.cache_hits_extra_tags) } resource "datadog_monitor" "redis_cpu_high" { @@ -53,7 +53,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.cpu_high_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_high_extra_tags) } resource "datadog_monitor" "redis_replication_lag" { @@ -83,7 +83,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.replication_lag_extra_tags) + tags = concat(local.common_tags, var.tags, var.replication_lag_extra_tags) } resource "datadog_monitor" "redis_commands" { @@ -109,6 +109,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticache-redis", "team:claranet", "created-by:terraform", "engine:redis"], var.commands_extra_tags) + tags = concat(local.common_tags, var.tags, var.commands_extra_tags) } diff --git a/cloud/aws/elasticsearch/README.md b/cloud/aws/elasticsearch/README.md index 6e0af06e..c0d7301c 100644 --- a/cloud/aws/elasticsearch/README.md +++ b/cloud/aws/elasticsearch/README.md @@ -85,6 +85,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:elasticache-redis",
"engine:redis"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/elasticsearch/common-inputs.tf b/cloud/aws/elasticsearch/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/elasticsearch/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/elasticsearch/common-locals.tf b/cloud/aws/elasticsearch/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/elasticsearch/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/elasticsearch/inputs.tf b/cloud/aws/elasticsearch/inputs.tf index d6178114..e3a5d517 100644 --- a/cloud/aws/elasticsearch/inputs.tf +++ b/cloud/aws/elasticsearch/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:elasticsearch"] } # Global DataDog diff --git a/cloud/aws/elasticsearch/monitors-elasticsearch.tf b/cloud/aws/elasticsearch/monitors-elasticsearch.tf index a72ae32e..ff460129 100644 --- a/cloud/aws/elasticsearch/monitors-elasticsearch.tf +++ b/cloud/aws/elasticsearch/monitors-elasticsearch.tf @@ -32,7 +32,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.es_cluster_status_extra_tags) + tags = concat(local.common_tags, var.tags, var.es_cluster_status_extra_tags) } ### Elasticsearch cluster free storage space monitor ### @@ -64,7 +64,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags) + tags = concat(local.common_tags, var.tags, var.diskspace_extra_tags) } ### Elasticsearch cluster CPU monitor ### @@ -95,6 +95,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cpu_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_extra_tags) } diff --git a/cloud/aws/elb/README.md b/cloud/aws/elb/README.md index 9309806f..04ee88a2 100644 --- a/cloud/aws/elb/README.md +++ b/cloud/aws/elb/README.md @@ -108,6 +108,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:elasticsearch"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/elb/common-inputs.tf b/cloud/aws/elb/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/elb/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/elb/common-locals.tf b/cloud/aws/elb/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/elb/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/elb/inputs.tf b/cloud/aws/elb/inputs.tf index e5974833..b1bcd588 100644 --- a/cloud/aws/elb/inputs.tf +++ b/cloud/aws/elb/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:elb"] } # Global DataDog diff --git a/cloud/aws/elb/monitors-elb.tf b/cloud/aws/elb/monitors-elb.tf index 8e04687f..d629a173 100644 --- a/cloud/aws/elb/monitors-elb.tf +++ b/cloud/aws/elb/monitors-elb.tf @@ -28,7 +28,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_no_healthy_instance_extra_tags) + tags = concat(local.common_tags, var.tags, var.elb_no_healthy_instance_extra_tags) } resource "datadog_monitor" "ELB_too_much_4xx" { @@ -59,7 +59,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_4xx_extra_tags) + tags = concat(local.common_tags, var.tags, var.elb_4xx_extra_tags) } resource "datadog_monitor" "ELB_too_much_5xx" { @@ -90,7 +90,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_5xx_extra_tags) + tags = concat(local.common_tags, var.tags, var.elb_5xx_extra_tags) } resource "datadog_monitor" "ELB_too_much_4xx_backend" { @@ -121,7 +121,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_4xx_extra_tags) + tags = concat(local.common_tags, var.tags, var.elb_backend_4xx_extra_tags) } resource "datadog_monitor" "ELB_too_much_5xx_backend" { @@ -152,7 +152,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_5xx_extra_tags) + tags = concat(local.common_tags, var.tags, var.elb_backend_5xx_extra_tags) } resource "datadog_monitor" "ELB_backend_latency" { @@ -182,6 +182,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:elb", "team:claranet", "created-by:terraform"], var.elb_backend_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.elb_backend_latency_extra_tags) } diff --git a/cloud/aws/kinesis-firehose/README.md b/cloud/aws/kinesis-firehose/README.md index 7e3a2f6e..4a038291 100644 --- a/cloud/aws/kinesis-firehose/README.md +++ b/cloud/aws/kinesis-firehose/README.md @@ -49,7 +49,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:elb"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/kinesis-firehose/common-inputs.tf b/cloud/aws/kinesis-firehose/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/kinesis-firehose/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/kinesis-firehose/common-locals.tf b/cloud/aws/kinesis-firehose/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/kinesis-firehose/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/kinesis-firehose/inputs.tf b/cloud/aws/kinesis-firehose/inputs.tf index a3957dad..6cd6e483 100644 --- a/cloud/aws/kinesis-firehose/inputs.tf +++ b/cloud/aws/kinesis-firehose/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:kinesis-firehose"] } # Global DataDog diff --git a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf index e91cbf9b..20ae5e94 100644 --- a/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf +++ b/cloud/aws/kinesis-firehose/monitors-kinesis-firehose.tf @@ -26,6 +26,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:kinesis-firehose", "team:claranet", "created-by:terraform"], var.incoming_records_extra_tags) + tags = concat(local.common_tags, var.tags, var.incoming_records_extra_tags) } diff --git a/cloud/aws/lambda/README.md b/cloud/aws/lambda/README.md index 5f37ff6d..f5eb7732 100644 --- a/cloud/aws/lambda/README.md +++ b/cloud/aws/lambda/README.md @@ -55,7 +55,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [errors\_enabled](#input\_errors\_enabled) | Flag to enable Errors monitor | `string` | `"false"` | no | | [errors\_extra\_tags](#input\_errors\_extra\_tags) | Extra tags for Errors monitor | `list(string)` | `[]` | no | | [errors\_message](#input\_errors\_message) | Custom message for Errors monitor | `string` | `""` | no | @@ -87,6 +87,8 @@ Creates DataDog monitors with the following checks: | [pct\_errors\_time\_aggregator](#input\_pct\_errors\_time\_aggregator) | Monitor aggregator for Percentage of errors [available values: min, max or avg] | `string` | `"sum"` | no | | [pct\_errors\_timeframe](#input\_pct\_errors\_timeframe) | Monitor timeframe for Percentage of errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_1h"` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:kinesis-firehose"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [throttles\_enabled](#input\_throttles\_enabled) | Flag to enable Throttles monitor | `string` | `"true"` | no | | [throttles\_extra\_tags](#input\_throttles\_extra\_tags) | Extra tags for Throttles monitor | `list(string)` | `[]` | no | | [throttles\_message](#input\_throttles\_message) | Custom message for Throttles monitor | `string` | `""` | no | diff --git a/cloud/aws/lambda/common-inputs.tf b/cloud/aws/lambda/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/lambda/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/lambda/common-locals.tf b/cloud/aws/lambda/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/lambda/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/lambda/inputs.tf b/cloud/aws/lambda/inputs.tf index 3f6a51de..31869ea4 100644 --- a/cloud/aws/lambda/inputs.tf +++ b/cloud/aws/lambda/inputs.tf @@ -1,10 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:lambda"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/aws/lambda/monitors-lambda.tf b/cloud/aws/lambda/monitors-lambda.tf index f71cf251..db569ad9 100644 --- a/cloud/aws/lambda/monitors-lambda.tf +++ b/cloud/aws/lambda/monitors-lambda.tf @@ -30,7 +30,7 @@ resource "datadog_monitor" "pct_errors" { timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:lambda", "team:claranet", "created-by:terraform"], var.pct_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.pct_errors_extra_tags) } # Errors Absolute Value @@ -61,7 +61,7 @@ resource "datadog_monitor" "errors" { timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:lambda", "team:claranet", "created-by:terraform"], var.errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.errors_extra_tags) } # Throttles @@ -92,7 +92,7 @@ resource "datadog_monitor" "throttles" { timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:lambda", "team:claranet", "created-by:terraform"], var.throttles_extra_tags) + tags = concat(local.common_tags, var.tags, var.throttles_extra_tags) } # INVOCATIONS @@ -126,5 +126,5 @@ resource "datadog_monitor" "invocations" { - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:lambda", "team:claranet", "created-by:terraform"], var.invocations_extra_tags) + tags = concat(local.common_tags, var.tags, var.invocations_extra_tags) } diff --git a/cloud/aws/nlb/README.md b/cloud/aws/nlb/README.md index e5b4975d..613e4c13 100644 --- a/cloud/aws/nlb/README.md +++ b/cloud/aws/nlb/README.md @@ -49,7 +49,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -66,6 +66,8 @@ Creates DataDog monitors with the following checks: | [nlb\_no\_healthy\_instances\_timeframe](#input\_nlb\_no\_healthy\_instances\_timeframe) | Monitor timeframe for NLB 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 | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:lambda"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/nlb/common-inputs.tf b/cloud/aws/nlb/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/nlb/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/nlb/common-locals.tf b/cloud/aws/nlb/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/nlb/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/nlb/inputs.tf b/cloud/aws/nlb/inputs.tf index 237e9e54..edcd8be1 100644 --- a/cloud/aws/nlb/inputs.tf +++ b/cloud/aws/nlb/inputs.tf @@ -1,10 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:nlb"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/aws/nlb/monitors-nlb.tf b/cloud/aws/nlb/monitors-nlb.tf index a18dcb6f..7c54add2 100644 --- a/cloud/aws/nlb/monitors-nlb.tf +++ b/cloud/aws/nlb/monitors-nlb.tf @@ -27,6 +27,6 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:nlb", "team:claranet", "created-by:terraform"], var.nlb_no_healthy_instances_extra_tags) + tags = concat(local.common_tags, var.tags, var.nlb_no_healthy_instances_extra_tags) } diff --git a/cloud/aws/rds/aurora/mysql/README.md b/cloud/aws/rds/aurora/mysql/README.md index 37d1caaf..24bbccba 100644 --- a/cloud/aws/rds/aurora/mysql/README.md +++ b/cloud/aws/rds/aurora/mysql/README.md @@ -67,6 +67,8 @@ Creates DataDog monitors with the following checks: | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | [rds\_aurora\_mysql\_replica\_lag\_no\_data\_timeframe](#input\_rds\_aurora\_mysql\_replica\_lag\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:nlb"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/rds/aurora/mysql/common-inputs.tf b/cloud/aws/rds/aurora/mysql/common-inputs.tf new file mode 120000 index 00000000..ce228746 --- /dev/null +++ b/cloud/aws/rds/aurora/mysql/common-inputs.tf @@ -0,0 +1 @@ +../../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/rds/aurora/mysql/common-locals.tf b/cloud/aws/rds/aurora/mysql/common-locals.tf new file mode 120000 index 00000000..b27ce90e --- /dev/null +++ b/cloud/aws/rds/aurora/mysql/common-locals.tf @@ -0,0 +1 @@ +../../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/rds/aurora/mysql/inputs.tf b/cloud/aws/rds/aurora/mysql/inputs.tf index 317b2770..1be6bd3e 100644 --- a/cloud/aws/rds/aurora/mysql/inputs.tf +++ b/cloud/aws/rds/aurora/mysql/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:rds-aurora-mysql"] } # Global DataDog diff --git a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf index c9883e48..e1a94a08 100644 --- a/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf +++ b/cloud/aws/rds/aurora/mysql/monitors-rds-aurora-mysql.tf @@ -26,5 +26,5 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds-aurora-mysql", "team:claranet", "created-by:terraform"], var.aurora_replicalag_extra_tags) + tags = concat(local.common_tags, var.tags, var.aurora_replicalag_extra_tags) } diff --git a/cloud/aws/rds/aurora/postgresql/README.md b/cloud/aws/rds/aurora/postgresql/README.md index 19447a8e..22e2945a 100644 --- a/cloud/aws/rds/aurora/postgresql/README.md +++ b/cloud/aws/rds/aurora/postgresql/README.md @@ -67,6 +67,8 @@ Creates DataDog monitors with the following checks: | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | [rds\_aurora\_postgresql\_replica\_lag\_no\_data\_timeframe](#input\_rds\_aurora\_postgresql\_replica\_lag\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:rds-aurora-mysql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/rds/aurora/postgresql/common-inputs.tf b/cloud/aws/rds/aurora/postgresql/common-inputs.tf new file mode 120000 index 00000000..ce228746 --- /dev/null +++ b/cloud/aws/rds/aurora/postgresql/common-inputs.tf @@ -0,0 +1 @@ +../../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/rds/aurora/postgresql/common-locals.tf b/cloud/aws/rds/aurora/postgresql/common-locals.tf new file mode 120000 index 00000000..b27ce90e --- /dev/null +++ b/cloud/aws/rds/aurora/postgresql/common-locals.tf @@ -0,0 +1 @@ +../../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/rds/aurora/postgresql/inputs.tf b/cloud/aws/rds/aurora/postgresql/inputs.tf index 615cdc1c..78eae44e 100644 --- a/cloud/aws/rds/aurora/postgresql/inputs.tf +++ b/cloud/aws/rds/aurora/postgresql/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:rds-aurora-postgresql"] } # Global DataDog diff --git a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf index 2c216c1e..045f531d 100644 --- a/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf +++ b/cloud/aws/rds/aurora/postgresql/monitors-rds-aurora-postgresql.tf @@ -26,5 +26,5 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:rds-aurora-postgresql", "team:claranet", "created-by:terraform"], var.aurora_replicalag_extra_tags) + tags = concat(local.common_tags, var.tags, var.aurora_replicalag_extra_tags) } diff --git a/cloud/aws/rds/common/README.md b/cloud/aws/rds/common/README.md index 05ca2f74..229db0f8 100644 --- a/cloud/aws/rds/common/README.md +++ b/cloud/aws/rds/common/README.md @@ -95,6 +95,8 @@ Creates DataDog monitors with the following checks: | [replicalag\_threshold\_warning](#input\_replicalag\_threshold\_warning) | replica lag in seconds (warning threshold) | `string` | `"200"` | no | | [replicalag\_time\_aggregator](#input\_replicalag\_time\_aggregator) | Monitor aggregator for RDS replica lag [available values: min, max or avg] | `string` | `"min"` | no | | [replicalag\_timeframe](#input\_replicalag\_timeframe) | Monitor timeframe for RDS replica lag monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:rds-aurora-postgresql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/aws/rds/common/common-inputs.tf b/cloud/aws/rds/common/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/aws/rds/common/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/rds/common/common-locals.tf b/cloud/aws/rds/common/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/aws/rds/common/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/rds/common/inputs.tf b/cloud/aws/rds/common/inputs.tf index c0c91edb..66f040e4 100644 --- a/cloud/aws/rds/common/inputs.tf +++ b/cloud/aws/rds/common/inputs.tf @@ -1,7 +1,8 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string + +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:rds"] } # Global DataDog diff --git a/cloud/aws/sqs/README.md b/cloud/aws/sqs/README.md index 943973e8..d85ffc86 100644 --- a/cloud/aws/sqs/README.md +++ b/cloud/aws/sqs/README.md @@ -58,7 +58,7 @@ Creates DataDog monitors with the following checks: | [age\_of\_oldest\_message\_threshold\_warning](#input\_age\_of\_oldest\_message\_threshold\_warning) | Warning threshold in seconds | `number` | `300` | no | | [age\_of\_oldest\_message\_time\_aggregator](#input\_age\_of\_oldest\_message\_time\_aggregator) | Monitor aggregator for Age of Oldest Message [available values: min, max or avg] | `string` | `"min"` | no | | [age\_of\_oldest\_message\_timeframe](#input\_age\_of\_oldest\_message\_timeframe) | Monitor timeframe for Age of Oldest Message [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_30m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -69,6 +69,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:rds"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [visible\_messages\_enabled](#input\_visible\_messages\_enabled) | Flag to enable Number of Visible Messages monitor | `string` | `"false"` | no | | [visible\_messages\_extra\_tags](#input\_visible\_messages\_extra\_tags) | Extra tags for Number of Visible Messages monitor | `list(string)` | `[]` | no | diff --git a/cloud/aws/sqs/common-inputs.tf b/cloud/aws/sqs/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/sqs/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/sqs/common-locals.tf b/cloud/aws/sqs/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/sqs/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/sqs/inputs.tf b/cloud/aws/sqs/inputs.tf index 0efd0ece..6a020d89 100644 --- a/cloud/aws/sqs/inputs.tf +++ b/cloud/aws/sqs/inputs.tf @@ -1,10 +1,10 @@ -# Datadog global variables - -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:sqs"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/aws/sqs/monitors-sqs.tf b/cloud/aws/sqs/monitors-sqs.tf index fd320fdd..06ca31c6 100644 --- a/cloud/aws/sqs/monitors-sqs.tf +++ b/cloud/aws/sqs/monitors-sqs.tf @@ -26,7 +26,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:sqs", "team:claranet", "created-by:terraform"], var.visible_messages_extra_tags) + tags = concat(local.common_tags, var.tags, var.visible_messages_extra_tags) } # Age of the Oldest Message @@ -57,5 +57,5 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:sqs", "team:claranet", "created-by:terraform"], var.age_of_oldest_message_extra_tags) + tags = concat(local.common_tags, var.tags, var.age_of_oldest_message_extra_tags) } diff --git a/cloud/aws/vpn/README.md b/cloud/aws/vpn/README.md index feb6223f..c61dcf20 100644 --- a/cloud/aws/vpn/README.md +++ b/cloud/aws/vpn/README.md @@ -55,6 +55,8 @@ No modules. | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:sqs"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [vpn\_status\_enabled](#input\_vpn\_status\_enabled) | Flag to enable VPN status monitor | `string` | `"true"` | no | | [vpn\_status\_extra\_tags](#input\_vpn\_status\_extra\_tags) | Extra tags for VPN status monitor | `list(string)` | `[]` | no | diff --git a/cloud/aws/vpn/common-inputs.tf b/cloud/aws/vpn/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/aws/vpn/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/aws/vpn/common-locals.tf b/cloud/aws/vpn/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/aws/vpn/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/aws/vpn/inputs.tf b/cloud/aws/vpn/inputs.tf index f9cc8162..96dc5f35 100644 --- a/cloud/aws/vpn/inputs.tf +++ b/cloud/aws/vpn/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:aws", "resource:vpn"] } # Global DataDog diff --git a/cloud/aws/vpn/monitors-vpn.tf b/cloud/aws/vpn/monitors-vpn.tf index 488354b7..28ed82d4 100644 --- a/cloud/aws/vpn/monitors-vpn.tf +++ b/cloud/aws/vpn/monitors-vpn.tf @@ -21,6 +21,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:aws", "resource:vpn", "team:claranet", "created-by:terraform"], var.vpn_status_extra_tags) + tags = concat(local.common_tags, var.tags, var.vpn_status_extra_tags) } diff --git a/cloud/azure/apimanagement/README.md b/cloud/azure/apimanagement/README.md index cde00026..c8af7778 100644 --- a/cloud/azure/apimanagement/README.md +++ b/cloud/azure/apimanagement/README.md @@ -59,7 +59,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [apimgt\_status\_no\_data\_timeframe](#input\_apimgt\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [failed\_requests\_enabled](#input\_failed\_requests\_enabled) | Flag to enable API Management failed requests monitor | `string` | `"true"` | no | | [failed\_requests\_extra\_tags](#input\_failed\_requests\_extra\_tags) | Extra tags for API Management failed requests monitor | `list(string)` | `[]` | no | @@ -96,6 +96,8 @@ Creates DataDog monitors with the following checks: | [successful\_requests\_threshold\_warning](#input\_successful\_requests\_threshold\_warning) | Warning regarding acceptable percent of successful requests | `number` | `30` | no | | [successful\_requests\_time\_aggregator](#input\_successful\_requests\_time\_aggregator) | Monitor aggregator for API Management successful requests [available values: min, max or avg] | `string` | `"max"` | no | | [successful\_requests\_timeframe](#input\_successful\_requests\_timeframe) | Monitor timeframe for API Management successful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:aws",
"resource:vpn"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [unauthorized\_requests\_enabled](#input\_unauthorized\_requests\_enabled) | Flag to enable API Management unauthorized requests monitor | `string` | `"true"` | no | | [unauthorized\_requests\_extra\_tags](#input\_unauthorized\_requests\_extra\_tags) | Extra tags for API Management unauthorized requests monitor | `list(string)` | `[]` | no | diff --git a/cloud/azure/apimanagement/common-inputs.tf b/cloud/azure/apimanagement/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/apimanagement/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/apimanagement/common-locals.tf b/cloud/azure/apimanagement/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/apimanagement/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/apimanagement/inputs.tf b/cloud/azure/apimanagement/inputs.tf index 58ddcd86..e3c9e0cc 100644 --- a/cloud/azure/apimanagement/inputs.tf +++ b/cloud/azure/apimanagement/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:apimanagement"] } # Global DataDog diff --git a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf index 68131b26..d1287fa7 100644 --- a/cloud/azure/apimanagement/monitors-azure-apimanagement.tf +++ b/cloud/azure/apimanagement/monitors-azure-apimanagement.tf @@ -23,7 +23,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "apimgt_failed_requests" { @@ -54,7 +54,7 @@ EOQ require_full_window = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.failed_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_requests_extra_tags) } resource "datadog_monitor" "apimgt_other_requests" { @@ -85,7 +85,7 @@ EOQ require_full_window = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.other_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.other_requests_extra_tags) } resource "datadog_monitor" "apimgt_unauthorized_requests" { @@ -116,7 +116,7 @@ EOQ require_full_window = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.unauthorized_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.unauthorized_requests_extra_tags) } resource "datadog_monitor" "apimgt_successful_requests" { @@ -149,6 +149,6 @@ EOQ require_full_window = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:apimanagement", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.successful_requests_extra_tags) } diff --git a/cloud/azure/app-gateway/README.md b/cloud/azure/app-gateway/README.md index d4b6dda7..c51aca2e 100644 --- a/cloud/azure/app-gateway/README.md +++ b/cloud/azure/app-gateway/README.md @@ -120,7 +120,7 @@ Creates DataDog monitors with the following checks: | [appgateway\_unhealthy\_host\_ratio\_threshold\_warning](#input\_appgateway\_unhealthy\_host\_ratio\_threshold\_warning) | Warning regarding acceptable ratio of unhealthy host | `number` | `50` | no | | [appgateway\_unhealthy\_host\_ratio\_time\_aggregator](#input\_appgateway\_unhealthy\_host\_ratio\_time\_aggregator) | Monitor aggregator for App Gateway unhealthy host ratio [available values: min, max or avg] | `string` | `"max"` | no | | [appgateway\_unhealthy\_host\_ratio\_timeframe](#input\_appgateway\_unhealthy\_host\_ratio\_timeframe) | Monitor timeframe for App Gateway unhealthy host ratio [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -136,6 +136,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for App Gateway status | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for App Gateway status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for App Gateway status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:apimanagement"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [total\_requests\_enabled](#input\_total\_requests\_enabled) | Flag to enable App Gateway current connections monitor | `string` | `"true"` | no | | [total\_requests\_extra\_tags](#input\_total\_requests\_extra\_tags) | Extra tags for App Gateway current connections monitor | `list(string)` | `[]` | no | diff --git a/cloud/azure/app-gateway/common-inputs.tf b/cloud/azure/app-gateway/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/app-gateway/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/app-gateway/common-locals.tf b/cloud/azure/app-gateway/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/app-gateway/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/app-gateway/inputs.tf b/cloud/azure/app-gateway/inputs.tf index 6f6729bf..8eeceff0 100644 --- a/cloud/azure/app-gateway/inputs.tf +++ b/cloud/azure/app-gateway/inputs.tf @@ -1,9 +1,10 @@ -# Azure App Gateway global variables -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:app-gateway"] } +# Azure App Gateway global variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/app-gateway/monitors-app-gateway.tf b/cloud/azure/app-gateway/monitors-app-gateway.tf index 3c954940..cff436af 100644 --- a/cloud/azure/app-gateway/monitors-app-gateway.tf +++ b/cloud/azure/app-gateway/monitors-app-gateway.tf @@ -22,7 +22,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } # Monitoring App Gateway total_requests @@ -47,7 +47,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.total_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.total_requests_extra_tags) } # Monitoring App Gateway backend_connect_time @@ -77,7 +77,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_backend_connect_time_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_backend_connect_time_extra_tags) } # Monitoring App Gateway failed_requests @@ -109,7 +109,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_failed_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_failed_requests_extra_tags) } # Monitoring App Gateway unhealthy_host_ratio @@ -141,7 +141,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_unhealthy_host_ratio_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_unhealthy_host_ratio_extra_tags) } # Monitoring App Gateway response_status 4xx @@ -173,7 +173,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_http_4xx_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_http_4xx_errors_extra_tags) } # Monitoring App Gateway response_status 5xx @@ -204,7 +204,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_http_5xx_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_http_5xx_errors_extra_tags) } # Monitoring App Gateway Backend response_status 4xx @@ -236,7 +236,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_backend_http_4xx_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_backend_http_4xx_errors_extra_tags) } # Monitoring App Gateway Backend response_status 5xx @@ -267,5 +267,5 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-gateway", "team:claranet", "created-by:terraform"], var.appgateway_backend_http_5xx_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.appgateway_backend_http_5xx_errors_extra_tags) } diff --git a/cloud/azure/app-services/README.md b/cloud/azure/app-services/README.md index 695cbf29..fbdb7f59 100644 --- a/cloud/azure/app-services/README.md +++ b/cloud/azure/app-services/README.md @@ -61,7 +61,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [appservices\_status\_no\_data\_timeframe](#input\_appservices\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -112,6 +112,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for App Services status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for App Services status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for App Services status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:app-gateway"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/app-services/common-inputs.tf b/cloud/azure/app-services/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/app-services/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/app-services/common-locals.tf b/cloud/azure/app-services/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/app-services/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/app-services/inputs.tf b/cloud/azure/app-services/inputs.tf index 8de7eb7c..19758aa6 100644 --- a/cloud/azure/app-services/inputs.tf +++ b/cloud/azure/app-services/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:app-services"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/app-services/monitors-app_services.tf b/cloud/azure/app-services/monitors-app_services.tf index 22467831..a9a2e394 100644 --- a/cloud/azure/app-services/monitors-app_services.tf +++ b/cloud/azure/app-services/monitors-app_services.tf @@ -25,7 +25,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.response_time_extra_tags) + tags = concat(local.common_tags, var.tags, var.response_time_extra_tags) } # Monitoring App Services memory usage @@ -55,7 +55,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.memory_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.memory_usage_extra_tags) } # Monitoring App Services 5xx errors percent @@ -86,7 +86,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.http_5xx_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.http_5xx_requests_extra_tags) } # Monitoring App Services 4xx errors percent @@ -117,7 +117,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.http_4xx_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.http_4xx_requests_extra_tags) } # Monitoring App Services HTTP 2xx & 3xx status pages percent @@ -150,7 +150,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:app-services", "team:claranet", "created-by:terraform"], var.http_successful_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.http_successful_requests_extra_tags) } # Monitoring App Services status diff --git a/cloud/azure/azure-search/README.md b/cloud/azure/azure-search/README.md index a35f1211..f7239752 100644 --- a/cloud/azure/azure-search/README.md +++ b/cloud/azure/azure-search/README.md @@ -52,7 +52,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [azure\_search\_latency\_no\_data\_timeframe](#input\_azure\_search\_latency\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -69,6 +69,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:app-services"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [throttled\_queries\_rate\_enabled](#input\_throttled\_queries\_rate\_enabled) | Flag to enable Azure Search throttled queries rate monitor | `string` | `"true"` | no | | [throttled\_queries\_rate\_extra\_tags](#input\_throttled\_queries\_rate\_extra\_tags) | Extra tags for Azure Search throttled queries rate monitor | `list(string)` | `[]` | no | | [throttled\_queries\_rate\_message](#input\_throttled\_queries\_rate\_message) | Custom message for Azure Search throttled queries rate monitor | `string` | `""` | no | diff --git a/cloud/azure/azure-search/common-inputs.tf b/cloud/azure/azure-search/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/azure-search/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/azure-search/common-locals.tf b/cloud/azure/azure-search/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/azure-search/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/azure-search/inputs.tf b/cloud/azure/azure-search/inputs.tf index 95f92b95..af8a1f09 100644 --- a/cloud/azure/azure-search/inputs.tf +++ b/cloud/azure/azure-search/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:azure-search"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/azure-search/monitors-azure-search.tf b/cloud/azure/azure-search/monitors-azure-search.tf index 9bcd9ca0..280bbf69 100644 --- a/cloud/azure/azure-search/monitors-azure-search.tf +++ b/cloud/azure/azure-search/monitors-azure-search.tf @@ -26,7 +26,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure-search", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } # Monitoring Azure Search throttled queries @@ -56,6 +56,6 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure-search", "team:claranet", "created-by:terraform"], var.throttled_queries_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.throttled_queries_rate_extra_tags) } diff --git a/cloud/azure/cosmosdb/README.md b/cloud/azure/cosmosdb/README.md index fd645d0e..57b92601 100644 --- a/cloud/azure/cosmosdb/README.md +++ b/cloud/azure/cosmosdb/README.md @@ -78,7 +78,7 @@ Creates DataDog monitors with the following checks: | [cosmos\_db\_scaling\_time\_aggregator](#input\_cosmos\_db\_scaling\_time\_aggregator) | Monitor aggregator for Cosmos DB scaling [available values: min, max or avg] | `string` | `"min"` | no | | [cosmos\_db\_scaling\_timeframe](#input\_cosmos\_db\_scaling\_timeframe) | Monitor timeframe for Cosmos DB scaling [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | | [cosmos\_db\_status\_no\_data\_timeframe](#input\_cosmos\_db\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -93,6 +93,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Cosmos DB status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Cosmos DB status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Cosmos DB status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:azure-search"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/cosmosdb/common-inputs.tf b/cloud/azure/cosmosdb/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/cosmosdb/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/cosmosdb/common-locals.tf b/cloud/azure/cosmosdb/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/cosmosdb/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/cosmosdb/inputs.tf b/cloud/azure/cosmosdb/inputs.tf index dc15e366..3ffe9cb4 100644 --- a/cloud/azure/cosmosdb/inputs.tf +++ b/cloud/azure/cosmosdb/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:cosmos_db"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/cosmosdb/monitors-cosmosdb.tf b/cloud/azure/cosmosdb/monitors-cosmosdb.tf index ca171ecf..6c1423bb 100644 --- a/cloud/azure/cosmosdb/monitors-cosmosdb.tf +++ b/cloud/azure/cosmosdb/monitors-cosmosdb.tf @@ -25,7 +25,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "cosmos_db_4xx_requests" { @@ -66,7 +66,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_4xx_request_extra_tags) + tags = concat(local.common_tags, var.tags, var.cosmos_db_4xx_request_extra_tags) } resource "datadog_monitor" "cosmos_db_5xx_requests" { @@ -98,7 +98,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_5xx_request_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.cosmos_db_5xx_request_rate_extra_tags) } resource "datadog_monitor" "cosmos_db_scaling" { @@ -130,6 +130,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:cosmos_db", "team:claranet", "created-by:terraform"], var.cosmos_db_scaling_extra_tags) + tags = concat(local.common_tags, var.tags, var.cosmos_db_scaling_extra_tags) } diff --git a/cloud/azure/datalakestore/README.md b/cloud/azure/datalakestore/README.md index ab7de57d..49986c3b 100644 --- a/cloud/azure/datalakestore/README.md +++ b/cloud/azure/datalakestore/README.md @@ -50,7 +50,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| | [datalakestore\_status\_no\_data\_timeframe](#input\_datalakestore\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -65,6 +65,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Datalake Store status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Datalake Store status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Datalake Store status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:cosmos_db"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/datalakestore/common-inputs.tf b/cloud/azure/datalakestore/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/datalakestore/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/datalakestore/common-locals.tf b/cloud/azure/datalakestore/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/datalakestore/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/datalakestore/inputs.tf b/cloud/azure/datalakestore/inputs.tf index cf67f79c..b27c686e 100644 --- a/cloud/azure/datalakestore/inputs.tf +++ b/cloud/azure/datalakestore/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:datalakestore"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/datalakestore/monitors-datalakestore.tf b/cloud/azure/datalakestore/monitors-datalakestore.tf index 8410b8d5..628739dc 100644 --- a/cloud/azure/datalakestore/monitors-datalakestore.tf +++ b/cloud/azure/datalakestore/monitors-datalakestore.tf @@ -21,6 +21,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:datalakestore", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } diff --git a/cloud/azure/eventgrid/README.md b/cloud/azure/eventgrid/README.md index 3d7c25e0..f6c8f4cc 100644 --- a/cloud/azure/eventgrid/README.md +++ b/cloud/azure/eventgrid/README.md @@ -53,7 +53,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [eventgrid\_no\_successful\_message\_no\_data\_timeframe](#input\_eventgrid\_no\_successful\_message\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [failed\_messages\_rate\_enabled](#input\_failed\_messages\_rate\_enabled) | Flag to enable Event Grid failed messages monitor | `string` | `"true"` | no | @@ -76,6 +76,8 @@ Creates DataDog monitors with the following checks: | [no\_successful\_message\_rate\_timeframe](#input\_no\_successful\_message\_rate\_timeframe) | Monitor timeframe for Event Grid no successful message [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:datalakestore"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [unmatched\_events\_rate\_enabled](#input\_unmatched\_events\_rate\_enabled) | Flag to enable Event Grid unmatched events monitor | `string` | `"true"` | no | | [unmatched\_events\_rate\_extra\_tags](#input\_unmatched\_events\_rate\_extra\_tags) | Extra tags for Event Grid unmatched events monitor | `list(string)` | `[]` | no | diff --git a/cloud/azure/eventgrid/common-inputs.tf b/cloud/azure/eventgrid/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/eventgrid/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/eventgrid/common-locals.tf b/cloud/azure/eventgrid/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/eventgrid/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/eventgrid/inputs.tf b/cloud/azure/eventgrid/inputs.tf index 2eb86956..a19305f2 100644 --- a/cloud/azure/eventgrid/inputs.tf +++ b/cloud/azure/eventgrid/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:eventgrid"] } # Global DataDog diff --git a/cloud/azure/eventgrid/monitors-eventgrid.tf b/cloud/azure/eventgrid/monitors-eventgrid.tf index f265132d..d2826a6b 100644 --- a/cloud/azure/eventgrid/monitors-eventgrid.tf +++ b/cloud/azure/eventgrid/monitors-eventgrid.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.no_successful_message_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.no_successful_message_rate_extra_tags) } resource "datadog_monitor" "eventgrid_failed_messages" { @@ -55,7 +55,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.failed_messages_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_messages_rate_extra_tags) } resource "datadog_monitor" "eventgrid_unmatched_events" { @@ -89,6 +89,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventgrid", "team:claranet", "created-by:terraform"], var.unmatched_events_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.unmatched_events_rate_extra_tags) } diff --git a/cloud/azure/eventhub/README.md b/cloud/azure/eventhub/README.md index 7862a61b..f93cbdd2 100644 --- a/cloud/azure/eventhub/README.md +++ b/cloud/azure/eventhub/README.md @@ -54,7 +54,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [errors\_rate\_enabled](#input\_errors\_rate\_enabled) | Flag to enable Event Hub errors monitor | `string` | `"true"` | no | | [errors\_rate\_extra\_tags](#input\_errors\_rate\_extra\_tags) | Extra tags for Event Hub errors monitor | `list(string)` | `[]` | no | | [errors\_rate\_message](#input\_errors\_rate\_message) | Custom message for Event Hub errors monitor | `string` | `""` | no | @@ -84,6 +84,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Event Hub status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Event Hub status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Event Hub status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:eventgrid"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/eventhub/common-inputs.tf b/cloud/azure/eventhub/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/eventhub/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/eventhub/common-locals.tf b/cloud/azure/eventhub/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/eventhub/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/eventhub/inputs.tf b/cloud/azure/eventhub/inputs.tf index d0ad18a5..f14d0f26 100644 --- a/cloud/azure/eventhub/inputs.tf +++ b/cloud/azure/eventhub/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:eventhub"] } # Global DataDog diff --git a/cloud/azure/eventhub/monitors-eventhub.tf b/cloud/azure/eventhub/monitors-eventhub.tf index ccdf1edb..7d998e36 100644 --- a/cloud/azure/eventhub/monitors-eventhub.tf +++ b/cloud/azure/eventhub/monitors-eventhub.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "eventhub_failed_requests" { @@ -52,7 +52,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.failed_requests_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_requests_rate_extra_tags) } resource "datadog_monitor" "eventhub_errors" { @@ -85,6 +85,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:eventhub", "team:claranet", "created-by:terraform"], var.errors_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.errors_rate_extra_tags) } diff --git a/cloud/azure/functions/README.md b/cloud/azure/functions/README.md index c0303a21..911a69c9 100644 --- a/cloud/azure/functions/README.md +++ b/cloud/azure/functions/README.md @@ -53,7 +53,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -84,6 +84,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:eventhub"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/functions/common-inputs.tf b/cloud/azure/functions/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/functions/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/functions/common-locals.tf b/cloud/azure/functions/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/functions/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/functions/inputs.tf b/cloud/azure/functions/inputs.tf index 26946326..8b27784a 100644 --- a/cloud/azure/functions/inputs.tf +++ b/cloud/azure/functions/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:azure_functions"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/functions/monitors-functions.tf b/cloud/azure/functions/monitors-functions.tf index 2112dbb5..739a12ba 100644 --- a/cloud/azure/functions/monitors-functions.tf +++ b/cloud/azure/functions/monitors-functions.tf @@ -25,7 +25,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.http_5xx_errors_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.http_5xx_errors_rate_extra_tags) } resource "datadog_monitor" "function_high_connections_count" { @@ -54,7 +54,7 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.high_connections_count_extra_tags) + tags = concat(local.common_tags, var.tags, var.high_connections_count_extra_tags) } resource "datadog_monitor" "function_high_threads_count" { @@ -83,6 +83,6 @@ EOQ timeout_h = 1 include_tags = true - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:azure_functions", "team:claranet", "created-by:terraform"], var.high_threads_count_extra_tags) + tags = concat(local.common_tags, var.tags, var.high_threads_count_extra_tags) } diff --git a/cloud/azure/iothubs/README.md b/cloud/azure/iothubs/README.md index 0bb8ab0c..3dd67d78 100644 --- a/cloud/azure/iothubs/README.md +++ b/cloud/azure/iothubs/README.md @@ -168,6 +168,8 @@ Creates DataDog monitors with the following checks: | [status\_no\_data\_timeframe](#input\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for IoT Hub status [available values: min, max, sum or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for IoT Hub status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:azure_functions"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [too\_many\_d2c\_telemetry\_ingress\_nosent\_enabled](#input\_too\_many\_d2c\_telemetry\_ingress\_nosent\_enabled) | Flag to enable IoT Hub unsent d2c telemetry monitor | `string` | `"true"` | no | | [too\_many\_d2c\_telemetry\_ingress\_nosent\_extra\_tags](#input\_too\_many\_d2c\_telemetry\_ingress\_nosent\_extra\_tags) | Extra tags for IoT Hub unsent d2c telemetry monitor | `list(string)` | `[]` | no | diff --git a/cloud/azure/iothubs/common-inputs.tf b/cloud/azure/iothubs/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/iothubs/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/iothubs/common-locals.tf b/cloud/azure/iothubs/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/iothubs/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/iothubs/inputs.tf b/cloud/azure/iothubs/inputs.tf index 3f02302f..2057bd6d 100644 --- a/cloud/azure/iothubs/inputs.tf +++ b/cloud/azure/iothubs/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:iothubs"] } # Global DataDog diff --git a/cloud/azure/iothubs/monitors-iothubs.tf b/cloud/azure/iothubs/monitors-iothubs.tf index 8d22788e..d8bf3feb 100644 --- a/cloud/azure/iothubs/monitors-iothubs.tf +++ b/cloud/azure/iothubs/monitors-iothubs.tf @@ -28,7 +28,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_jobs_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_jobs_rate_extra_tags) } resource "datadog_monitor" "too_many_list_jobs_failed" { @@ -61,7 +61,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_listjobs_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_listjobs_rate_extra_tags) } resource "datadog_monitor" "too_many_query_jobs_failed" { @@ -94,7 +94,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_queryjobs_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_queryjobs_rate_extra_tags) } resource "datadog_monitor" "status" { @@ -120,7 +120,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "total_devices" { @@ -145,7 +145,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.total_devices_extra_tags) + tags = concat(local.common_tags, var.tags, var.total_devices_extra_tags) } resource "datadog_monitor" "too_many_c2d_methods_failed" { @@ -178,7 +178,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_methods_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_c2d_methods_rate_extra_tags) } resource "datadog_monitor" "too_many_c2d_twin_read_failed" { @@ -211,7 +211,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_twin_read_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_c2d_twin_read_rate_extra_tags) } resource "datadog_monitor" "too_many_c2d_twin_update_failed" { @@ -244,7 +244,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_c2d_twin_update_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_c2d_twin_update_rate_extra_tags) } resource "datadog_monitor" "too_many_d2c_twin_read_failed" { @@ -277,7 +277,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_d2c_twin_read_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_d2c_twin_read_rate_extra_tags) } resource "datadog_monitor" "too_many_d2c_twin_update_failed" { @@ -310,7 +310,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.failed_d2c_twin_update_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_d2c_twin_update_rate_extra_tags) } resource "datadog_monitor" "too_many_d2c_telemetry_egress_dropped" { @@ -345,7 +345,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.dropped_d2c_telemetry_egress_extra_tags) + tags = concat(local.common_tags, var.tags, var.dropped_d2c_telemetry_egress_extra_tags) } resource "datadog_monitor" "too_many_d2c_telemetry_egress_orphaned" { @@ -380,7 +380,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.orphaned_d2c_telemetry_egress_extra_tags) + tags = concat(local.common_tags, var.tags, var.orphaned_d2c_telemetry_egress_extra_tags) } resource "datadog_monitor" "too_many_d2c_telemetry_egress_invalid" { @@ -415,7 +415,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.invalid_d2c_telemetry_egress_extra_tags) + tags = concat(local.common_tags, var.tags, var.invalid_d2c_telemetry_egress_extra_tags) } resource "datadog_monitor" "too_many_d2c_telemetry_ingress_nosent" { @@ -447,5 +447,5 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:iothubs", "team:claranet", "created-by:terraform"], var.too_many_d2c_telemetry_ingress_nosent_extra_tags) + tags = concat(local.common_tags, var.tags, var.too_many_d2c_telemetry_ingress_nosent_extra_tags) } diff --git a/cloud/azure/keyvault/README.md b/cloud/azure/keyvault/README.md index b5d5dd65..58b7d101 100644 --- a/cloud/azure/keyvault/README.md +++ b/cloud/azure/keyvault/README.md @@ -70,7 +70,7 @@ Creates DataDog monitors with the following checks: | [api\_result\_threshold\_warning](#input\_api\_result\_threshold\_warning) | Warning threshold for Key Vault API result rate | `number` | `30` | no | | [api\_result\_time\_aggregator](#input\_api\_result\_time\_aggregator) | Monitor aggregator for Key Vault API result [available values: min, max or avg] | `string` | `"max"` | no | | [api\_result\_timeframe](#input\_api\_result\_timeframe) | Monitor timeframe for Key Vault API result [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -86,6 +86,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Key Vault status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Key Vault status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Key Vault status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:iothubs"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/keyvault/common-inputs.tf b/cloud/azure/keyvault/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/keyvault/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/keyvault/common-locals.tf b/cloud/azure/keyvault/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/keyvault/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/keyvault/inputs.tf b/cloud/azure/keyvault/inputs.tf index 4d38549c..552df518 100644 --- a/cloud/azure/keyvault/inputs.tf +++ b/cloud/azure/keyvault/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:keyvault"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/keyvault/monitors-keyvault.tf b/cloud/azure/keyvault/monitors-keyvault.tf index b11b181a..9547e1ba 100644 --- a/cloud/azure/keyvault/monitors-keyvault.tf +++ b/cloud/azure/keyvault/monitors-keyvault.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "keyvault_api_result" { @@ -54,7 +54,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_result_extra_tags) + tags = concat(local.common_tags, var.tags, var.api_result_extra_tags) } resource "datadog_monitor" "keyvault_api_latency" { @@ -84,6 +84,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:keyvault", "team:claranet", "created-by:terraform"], var.api_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.api_latency_extra_tags) } diff --git a/cloud/azure/load-balancer/README.md b/cloud/azure/load-balancer/README.md index b0284443..a7231bef 100644 --- a/cloud/azure/load-balancer/README.md +++ b/cloud/azure/load-balancer/README.md @@ -49,7 +49,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -65,6 +65,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Load Balancer status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Load Balancer status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Load Balancer status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:keyvault"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/load-balancer/common-inputs.tf b/cloud/azure/load-balancer/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/load-balancer/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/load-balancer/common-locals.tf b/cloud/azure/load-balancer/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/load-balancer/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/load-balancer/inputs.tf b/cloud/azure/load-balancer/inputs.tf index 3f40e907..77983aba 100644 --- a/cloud/azure/load-balancer/inputs.tf +++ b/cloud/azure/load-balancer/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:load-balancer"] } +# Datadog variables variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/cloud/azure/load-balancer/monitors-load-balancer.tf b/cloud/azure/load-balancer/monitors-load-balancer.tf index dd18f549..232707c7 100644 --- a/cloud/azure/load-balancer/monitors-load-balancer.tf +++ b/cloud/azure/load-balancer/monitors-load-balancer.tf @@ -21,6 +21,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:load-balancer", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } diff --git a/cloud/azure/mysql/README.md b/cloud/azure/mysql/README.md index de8fca52..d75f9f59 100644 --- a/cloud/azure/mysql/README.md +++ b/cloud/azure/mysql/README.md @@ -62,7 +62,7 @@ Creates DataDog monitors with the following checks: | [cpu\_usage\_threshold\_warning](#input\_cpu\_usage\_threshold\_warning) | Mysql CPU usage in percent (warning threshold) | `string` | `"80"` | no | | [cpu\_usage\_time\_aggregator](#input\_cpu\_usage\_time\_aggregator) | Monitor aggregator for Mysql CPU [available values: min, max or avg] | `string` | `"min"` | no | | [cpu\_usage\_timeframe](#input\_cpu\_usage\_timeframe) | Monitor timeframe for Mysql CPU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no | @@ -93,6 +93,8 @@ Creates DataDog monitors with the following checks: | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | [server\_type](#input\_server\_type) | Mysql Server Type on Azure [available values: single, flexible] | `string` | `"single"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:load-balancer"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/mysql/common-inputs.tf b/cloud/azure/mysql/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/mysql/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/mysql/common-locals.tf b/cloud/azure/mysql/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/mysql/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/mysql/inputs.tf b/cloud/azure/mysql/inputs.tf index 69e5688a..cb9a6dec 100644 --- a/cloud/azure/mysql/inputs.tf +++ b/cloud/azure/mysql/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:mysql"] } # Global DataDog diff --git a/cloud/azure/mysql/monitors-mysql.tf b/cloud/azure/mysql/monitors-mysql.tf index 2d8e1946..e40ce5ec 100644 --- a/cloud/azure/mysql/monitors-mysql.tf +++ b/cloud/azure/mysql/monitors-mysql.tf @@ -25,7 +25,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_usage_extra_tags) } resource "datadog_monitor" "mysql_free_storage" { @@ -55,7 +55,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.free_storage_extra_tags) + tags = concat(local.common_tags, var.tags, var.free_storage_extra_tags) } resource "datadog_monitor" "mysql_io_consumption" { @@ -85,7 +85,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.io_consumption_extra_tags) + tags = concat(local.common_tags, var.tags, var.io_consumption_extra_tags) } resource "datadog_monitor" "mysql_memory_usage" { @@ -115,6 +115,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:mysql", "team:claranet", "created-by:terraform"], var.memory_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.memory_usage_extra_tags) } diff --git a/cloud/azure/postgresql/README.md b/cloud/azure/postgresql/README.md index 6bbdbbbd..3ce69373 100644 --- a/cloud/azure/postgresql/README.md +++ b/cloud/azure/postgresql/README.md @@ -64,7 +64,7 @@ Creates DataDog monitors with the following checks: | [cpu\_usage\_threshold\_warning](#input\_cpu\_usage\_threshold\_warning) | PostgreSQL CPU usage in percent (warning threshold) | `string` | `"80"` | no | | [cpu\_usage\_time\_aggregator](#input\_cpu\_usage\_time\_aggregator) | Monitor aggregator for PostgreSQL CPU [available values: min, max or avg] | `string` | `"min"` | no | | [cpu\_usage\_timeframe](#input\_cpu\_usage\_timeframe) | Monitor timeframe for PostgreSQL CPU [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no | @@ -101,6 +101,8 @@ Creates DataDog monitors with the following checks: | [postgresql\_no\_connection\_no\_data\_timeframe](#input\_postgresql\_no\_connection\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | [server\_type](#input\_server\_type) | PostgreSQL Server Type on Azure [available values: single, flexible] | `string` | `"single"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:mysql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/postgresql/common-inputs.tf b/cloud/azure/postgresql/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/postgresql/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/postgresql/common-locals.tf b/cloud/azure/postgresql/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/postgresql/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/postgresql/inputs.tf b/cloud/azure/postgresql/inputs.tf index 6d947e06..e1bc9f66 100644 --- a/cloud/azure/postgresql/inputs.tf +++ b/cloud/azure/postgresql/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:postgresql"] } # Global DataDog diff --git a/cloud/azure/postgresql/monitors-postgresql.tf b/cloud/azure/postgresql/monitors-postgresql.tf index 8c147c4f..449b03f8 100644 --- a/cloud/azure/postgresql/monitors-postgresql.tf +++ b/cloud/azure/postgresql/monitors-postgresql.tf @@ -25,7 +25,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_usage_extra_tags) } resource "datadog_monitor" "postgresql_no_connection" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.no_connection_extra_tags) + tags = concat(local.common_tags, var.tags, var.no_connection_extra_tags) } resource "datadog_monitor" "postgresql_free_storage" { @@ -81,7 +81,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.free_storage_extra_tags) + tags = concat(local.common_tags, var.tags, var.free_storage_extra_tags) } resource "datadog_monitor" "postgresql_io_consumption" { @@ -111,7 +111,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.io_consumption_extra_tags) + tags = concat(local.common_tags, var.tags, var.io_consumption_extra_tags) } resource "datadog_monitor" "postgresql_memory_usage" { @@ -141,6 +141,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:postgresql", "team:claranet", "created-by:terraform"], var.memory_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.memory_usage_extra_tags) } diff --git a/cloud/azure/redis/README.md b/cloud/azure/redis/README.md index 89751e7f..23d3f25f 100644 --- a/cloud/azure/redis/README.md +++ b/cloud/azure/redis/README.md @@ -55,7 +55,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [evictedkeys\_limit\_enabled](#input\_evictedkeys\_limit\_enabled) | Flag to enable Redis evicted keys monitor | `string` | `"true"` | no | | [evictedkeys\_limit\_extra\_tags](#input\_evictedkeys\_limit\_extra\_tags) | Extra tags for Redis evicted keys monitor | `list(string)` | `[]` | no | @@ -92,6 +92,8 @@ Creates DataDog monitors with the following checks: | [status\_no\_data\_timeframe](#input\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Redis status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Redis status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:postgresql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/redis/common-inputs.tf b/cloud/azure/redis/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/redis/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/redis/common-locals.tf b/cloud/azure/redis/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/redis/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/redis/inputs.tf b/cloud/azure/redis/inputs.tf index 2839a33f..87ffc662 100644 --- a/cloud/azure/redis/inputs.tf +++ b/cloud/azure/redis/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:redis"] } # Global DataDog diff --git a/cloud/azure/redis/monitors-azure-redis.tf b/cloud/azure/redis/monitors-azure-redis.tf index df1959a6..5e43e31b 100644 --- a/cloud/azure/redis/monitors-azure-redis.tf +++ b/cloud/azure/redis/monitors-azure-redis.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "evictedkeys" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.evictedkeys_limit_extra_tags) + tags = concat(local.common_tags, var.tags, var.evictedkeys_limit_extra_tags) } resource "datadog_monitor" "percent_processor_time" { @@ -81,7 +81,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.percent_processor_time_extra_tags) + tags = concat(local.common_tags, var.tags, var.percent_processor_time_extra_tags) } resource "datadog_monitor" "server_load" { @@ -111,6 +111,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:redis", "team:claranet", "created-by:terraform"], var.server_load_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.server_load_rate_extra_tags) } diff --git a/cloud/azure/serverfarms/README.md b/cloud/azure/serverfarms/README.md index 0d9166a3..df189eea 100644 --- a/cloud/azure/serverfarms/README.md +++ b/cloud/azure/serverfarms/README.md @@ -61,7 +61,7 @@ Creates DataDog monitors with the following checks: | [cpu\_percentage\_threshold\_warning](#input\_cpu\_percentage\_threshold\_warning) | CPU percentage (warning threshold) | `number` | `90` | no | | [cpu\_percentage\_time\_aggregator](#input\_cpu\_percentage\_time\_aggregator) | Monitor aggregator for serverfarms cpu\_percentage [available values: min, max or avg] | `string` | `"min"` | no | | [cpu\_percentage\_timeframe](#input\_cpu\_percentage\_timeframe) | Monitor timeframe for serverfarms cpu\_percentage [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_10m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_use\_defaults](#input\_filter\_tags\_use\_defaults) | Use default filter tags convention | `string` | `"true"` | no | @@ -83,6 +83,8 @@ Creates DataDog monitors with the following checks: | [status\_no\_data\_timeframe](#input\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for serverfarms status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for serverfarms status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:redis"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/serverfarms/common-inputs.tf b/cloud/azure/serverfarms/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/serverfarms/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/serverfarms/common-locals.tf b/cloud/azure/serverfarms/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/serverfarms/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/serverfarms/inputs.tf b/cloud/azure/serverfarms/inputs.tf index 68c518ec..815de086 100644 --- a/cloud/azure/serverfarms/inputs.tf +++ b/cloud/azure/serverfarms/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:serverfarms"] } # Global DataDog diff --git a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf index 09a75f62..54a8e50e 100644 --- a/cloud/azure/serverfarms/monitors-azure-serverfarms.tf +++ b/cloud/azure/serverfarms/monitors-azure-serverfarms.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "cpu_percentage" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.cpu_percentage_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_percentage_extra_tags) } resource "datadog_monitor" "memory_percentage" { @@ -81,6 +81,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:serverfarms", "team:claranet", "created-by:terraform"], var.memory_percentage_extra_tags) + tags = concat(local.common_tags, var.tags, var.memory_percentage_extra_tags) } diff --git a/cloud/azure/servicebus/README.md b/cloud/azure/servicebus/README.md index c6321857..0015884b 100644 --- a/cloud/azure/servicebus/README.md +++ b/cloud/azure/servicebus/README.md @@ -84,6 +84,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Service Bus status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Service Bus status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Service Bus status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:serverfarms"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [user\_errors\_enabled](#input\_user\_errors\_enabled) | Flag to enable Service Bus user errors monitor | `string` | `"true"` | no | | [user\_errors\_extra\_tags](#input\_user\_errors\_extra\_tags) | Extra tags for Service Bus user errors monitor | `list(string)` | `[]` | no | diff --git a/cloud/azure/servicebus/common-inputs.tf b/cloud/azure/servicebus/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/servicebus/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/servicebus/common-locals.tf b/cloud/azure/servicebus/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/servicebus/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/servicebus/inputs.tf b/cloud/azure/servicebus/inputs.tf index ddb4ec3c..dabb857d 100644 --- a/cloud/azure/servicebus/inputs.tf +++ b/cloud/azure/servicebus/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:servicebus"] } # Global DataDog diff --git a/cloud/azure/servicebus/monitors-service-bus.tf b/cloud/azure/servicebus/monitors-service-bus.tf index 61ce3985..5c7117f7 100644 --- a/cloud/azure/servicebus/monitors-service-bus.tf +++ b/cloud/azure/servicebus/monitors-service-bus.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "service_bus_no_active_connections" { @@ -46,7 +46,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.no_active_connections_extra_tags) + tags = concat(local.common_tags, var.tags, var.no_active_connections_extra_tags) } resource "datadog_monitor" "service_bus_user_errors" { @@ -77,7 +77,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.user_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.user_errors_extra_tags) } resource "datadog_monitor" "service_bus_server_errors" { @@ -108,6 +108,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:servicebus", "team:claranet", "created-by:terraform"], var.server_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.server_errors_extra_tags) } diff --git a/cloud/azure/sql-database/README.md b/cloud/azure/sql-database/README.md index 7b404767..976be81e 100644 --- a/cloud/azure/sql-database/README.md +++ b/cloud/azure/sql-database/README.md @@ -99,6 +99,8 @@ Creates DataDog monitors with the following checks: | [status\_no\_data\_timeframe](#input\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Redis status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Redis status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:servicebus"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/sql-database/common-inputs.tf b/cloud/azure/sql-database/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/sql-database/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/sql-database/common-locals.tf b/cloud/azure/sql-database/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/sql-database/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/sql-database/inputs.tf b/cloud/azure/sql-database/inputs.tf index d407dcf8..ab299d84 100644 --- a/cloud/azure/sql-database/inputs.tf +++ b/cloud/azure/sql-database/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:sql-database"] } # Global DataDog diff --git a/cloud/azure/sql-database/monitors-sql-database.tf b/cloud/azure/sql-database/monitors-sql-database.tf index 2c8bf2a4..8c5daf00 100644 --- a/cloud/azure/sql-database/monitors-sql-database.tf +++ b/cloud/azure/sql-database/monitors-sql-database.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "sql-database_cpu" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.cpu_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_extra_tags) } resource "datadog_monitor" "sql-database_free_space_low" { @@ -81,7 +81,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags) + tags = concat(local.common_tags, var.tags, var.diskspace_extra_tags) } resource "datadog_monitor" "sql-database_dtu_consumption_high" { @@ -111,7 +111,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.dtu_extra_tags) + tags = concat(local.common_tags, var.tags, var.dtu_extra_tags) } resource "datadog_monitor" "sql-database_deadlocks_count" { @@ -140,6 +140,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-database", "team:claranet", "created-by:terraform"], var.deadlock_extra_tags) + tags = concat(local.common_tags, var.tags, var.deadlock_extra_tags) } diff --git a/cloud/azure/sql-elasticpool/README.md b/cloud/azure/sql-elasticpool/README.md index 5cacdfea..0bb3c3c1 100644 --- a/cloud/azure/sql-elasticpool/README.md +++ b/cloud/azure/sql-elasticpool/README.md @@ -85,6 +85,8 @@ Creates DataDog monitors with the following checks: | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | | [sql\_elasticpool\_cpu\_no\_data\_timeframe](#input\_sql\_elasticpool\_cpu\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `30` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:sql-database"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/sql-elasticpool/common-inputs.tf b/cloud/azure/sql-elasticpool/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/sql-elasticpool/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/sql-elasticpool/common-locals.tf b/cloud/azure/sql-elasticpool/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/sql-elasticpool/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/sql-elasticpool/inputs.tf b/cloud/azure/sql-elasticpool/inputs.tf index 800eb77f..b289bd9b 100644 --- a/cloud/azure/sql-elasticpool/inputs.tf +++ b/cloud/azure/sql-elasticpool/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:sql-elasticpool"] } # Global DataDog diff --git a/cloud/azure/sql-elasticpool/monitors-sql-elasticpool.tf b/cloud/azure/sql-elasticpool/monitors-sql-elasticpool.tf index efc46fa4..8da78e90 100644 --- a/cloud/azure/sql-elasticpool/monitors-sql-elasticpool.tf +++ b/cloud/azure/sql-elasticpool/monitors-sql-elasticpool.tf @@ -26,7 +26,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.cpu_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_extra_tags) } resource "datadog_monitor" "sql_elasticpool_free_space_low" { @@ -56,7 +56,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.diskspace_extra_tags) + tags = concat(local.common_tags, var.tags, var.diskspace_extra_tags) } resource "datadog_monitor" "sql_elasticpool_dtu_consumption_high" { @@ -86,6 +86,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:sql-elasticpool", "team:claranet", "created-by:terraform"], var.dtu_extra_tags) + tags = concat(local.common_tags, var.tags, var.dtu_extra_tags) } diff --git a/cloud/azure/storage/README.md b/cloud/azure/storage/README.md index bbce5b47..4eb575d1 100644 --- a/cloud/azure/storage/README.md +++ b/cloud/azure/storage/README.md @@ -145,7 +145,7 @@ Creates DataDog monitors with the following checks: | [client\_other\_error\_requests\_threshold\_warning](#input\_client\_other\_error\_requests\_threshold\_warning) | Warning regarding acceptable percent of client other error requests for a storage | `number` | `50` | no | | [client\_other\_error\_requests\_time\_aggregator](#input\_client\_other\_error\_requests\_time\_aggregator) | Monitor aggregator for Storage other errors [available values: min, max or avg] | `string` | `"min"` | no | | [client\_other\_error\_requests\_timeframe](#input\_client\_other\_error\_requests\_timeframe) | Monitor timeframe for Storage other errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -190,6 +190,8 @@ Creates DataDog monitors with the following checks: | [successful\_requests\_timeframe](#input\_successful\_requests\_timeframe) | Monitor timeframe for Storage sucessful requests [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | | [successful\_storage\_requests\_threshold\_critical](#input\_successful\_storage\_requests\_threshold\_critical) | Minimum acceptable percent of successful requests for a storage | `number` | `90` | no | | [successful\_storage\_requests\_threshold\_warning](#input\_successful\_storage\_requests\_threshold\_warning) | Warning regarding acceptable percent of successful requests for a storage | `number` | `70` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:sql-elasticpool"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [throttling\_error\_requests\_enabled](#input\_throttling\_error\_requests\_enabled) | Flag to enable Storage throttling error monitor | `string` | `"true"` | no | | [throttling\_error\_requests\_extra\_tags](#input\_throttling\_error\_requests\_extra\_tags) | Extra tags for Storage throttling error monitor | `list(string)` | `[]` | no | | [throttling\_error\_requests\_message](#input\_throttling\_error\_requests\_message) | Custom message for Storage throttling error monitor | `string` | `""` | no | diff --git a/cloud/azure/storage/common-inputs.tf b/cloud/azure/storage/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/storage/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/storage/common-locals.tf b/cloud/azure/storage/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/storage/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/storage/inputs.tf b/cloud/azure/storage/inputs.tf index 4d150be0..a6b09284 100644 --- a/cloud/azure/storage/inputs.tf +++ b/cloud/azure/storage/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:storage"] } # Global DataDog diff --git a/cloud/azure/storage/monitors-azure-storage.tf b/cloud/azure/storage/monitors-azure-storage.tf index 8ea6d410..9e1b395c 100644 --- a/cloud/azure/storage/monitors-azure-storage.tf +++ b/cloud/azure/storage/monitors-azure-storage.tf @@ -24,7 +24,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "blobservices_requests_error" { @@ -56,7 +56,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.successful_requests_extra_tags) } resource "datadog_monitor" "fileservices_requests_error" { @@ -87,7 +87,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.successful_requests_extra_tags) } resource "datadog_monitor" "queueservices_requests_error" { @@ -119,7 +119,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.successful_requests_extra_tags) } resource "datadog_monitor" "tableservices_requests_error" { @@ -151,7 +151,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.successful_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.successful_requests_extra_tags) } resource "datadog_monitor" "blobservices_latency" { @@ -182,7 +182,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } resource "datadog_monitor" "fileservices_latency" { @@ -213,7 +213,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } resource "datadog_monitor" "queueservices_latency" { @@ -244,7 +244,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } resource "datadog_monitor" "tableservices_latency" { @@ -275,7 +275,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } resource "datadog_monitor" "blob_timeout_error_requests" { @@ -306,7 +306,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.timeout_error_requests_extra_tags) } resource "datadog_monitor" "file_timeout_error_requests" { @@ -337,7 +337,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.timeout_error_requests_extra_tags) } resource "datadog_monitor" "queue_timeout_error_requests" { @@ -369,7 +369,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.timeout_error_requests_extra_tags) } resource "datadog_monitor" "table_timeout_error_requests" { @@ -401,7 +401,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.timeout_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.timeout_error_requests_extra_tags) } resource "datadog_monitor" "blob_network_error_requests" { @@ -433,7 +433,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.network_error_requests_extra_tags) } resource "datadog_monitor" "file_network_error_requests" { @@ -465,7 +465,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.network_error_requests_extra_tags) } resource "datadog_monitor" "queue_network_error_requests" { @@ -497,7 +497,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.network_error_requests_extra_tags) } resource "datadog_monitor" "table_network_error_requests" { @@ -529,7 +529,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.network_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.network_error_requests_extra_tags) } resource "datadog_monitor" "blob_throttling_error_requests" { @@ -561,7 +561,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.throttling_error_requests_extra_tags) } resource "datadog_monitor" "file_throttling_error_requests" { @@ -593,7 +593,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.throttling_error_requests_extra_tags) } resource "datadog_monitor" "queue_throttling_error_requests" { @@ -625,7 +625,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.throttling_error_requests_extra_tags) } resource "datadog_monitor" "table_throttling_error_requests" { @@ -657,7 +657,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.throttling_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.throttling_error_requests_extra_tags) } resource "datadog_monitor" "blob_server_other_error_requests" { @@ -689,7 +689,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.server_other_error_requests_extra_tags) } resource "datadog_monitor" "file_server_other_error_requests" { @@ -721,7 +721,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.server_other_error_requests_extra_tags) } resource "datadog_monitor" "queue_server_other_error_requests" { @@ -753,7 +753,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.server_other_error_requests_extra_tags) } resource "datadog_monitor" "table_server_other_error_requests" { @@ -785,7 +785,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.server_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.server_other_error_requests_extra_tags) } resource "datadog_monitor" "blob_client_other_error_requests" { @@ -816,7 +816,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.client_other_error_requests_extra_tags) } resource "datadog_monitor" "file_client_other_error_requests" { @@ -848,7 +848,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.client_other_error_requests_extra_tags) } resource "datadog_monitor" "queue_client_other_error_requests" { @@ -880,7 +880,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.client_other_error_requests_extra_tags) } resource "datadog_monitor" "table_client_other_error_requests" { @@ -912,7 +912,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.client_other_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.client_other_error_requests_extra_tags) } resource "datadog_monitor" "blob_authorization_error_requests" { @@ -944,7 +944,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.authorization_error_requests_extra_tags) } resource "datadog_monitor" "file_authorization_error_requests" { @@ -976,7 +976,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.authorization_error_requests_extra_tags) } resource "datadog_monitor" "queue_authorization_error_requests" { @@ -1008,7 +1008,7 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.authorization_error_requests_extra_tags) } resource "datadog_monitor" "table_authorization_error_requests" { @@ -1040,5 +1040,5 @@ EOQ evaluation_delay = var.evaluation_delay renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:storage", "team:claranet", "created-by:terraform"], var.authorization_error_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.authorization_error_requests_extra_tags) } diff --git a/cloud/azure/stream-analytics/README.md b/cloud/azure/stream-analytics/README.md index 5d43880a..2917352d 100644 --- a/cloud/azure/stream-analytics/README.md +++ b/cloud/azure/stream-analytics/README.md @@ -64,7 +64,7 @@ Creates DataDog monitors with the following checks: | [conversion\_errors\_threshold\_warning](#input\_conversion\_errors\_threshold\_warning) | Conversion errors limit (warning threshold) | `number` | `0` | no | | [conversion\_errors\_time\_aggregator](#input\_conversion\_errors\_time\_aggregator) | Monitor aggregator for Stream Analytics conversion errors [available values: min, max or avg] | `string` | `"min"` | no | | [conversion\_errors\_timeframe](#input\_conversion\_errors\_timeframe) | Monitor timeframe for Stream Analytics conversion errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [failed\_function\_requests\_enabled](#input\_failed\_function\_requests\_enabled) | Flag to enable Stream Analytics failed requests monitor | `string` | `"true"` | no | | [failed\_function\_requests\_extra\_tags](#input\_failed\_function\_requests\_extra\_tags) | Extra tags for Stream Analytics failed requests monitor | `list(string)` | `[]` | no | @@ -101,6 +101,8 @@ Creates DataDog monitors with the following checks: | [su\_utilization\_threshold\_warning](#input\_su\_utilization\_threshold\_warning) | Streaming Unit utilization rate limit (warning threshold) | `number` | `80` | no | | [su\_utilization\_time\_aggregator](#input\_su\_utilization\_time\_aggregator) | Monitor aggregator for Stream Analytics utilization [available values: min, max or avg] | `string` | `"min"` | no | | [su\_utilization\_timeframe](#input\_su\_utilization\_timeframe) | Monitor timeframe for Stream Analytics utilization [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:storage"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/azure/stream-analytics/common-inputs.tf b/cloud/azure/stream-analytics/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/stream-analytics/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/stream-analytics/common-locals.tf b/cloud/azure/stream-analytics/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/stream-analytics/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/stream-analytics/inputs.tf b/cloud/azure/stream-analytics/inputs.tf index beeba08e..ea6b4ff3 100644 --- a/cloud/azure/stream-analytics/inputs.tf +++ b/cloud/azure/stream-analytics/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:stream-analytics"] } # Global DataDog diff --git a/cloud/azure/stream-analytics/monitors-stream-analytics.tf b/cloud/azure/stream-analytics/monitors-stream-analytics.tf index 5c03bac4..1e8fa70a 100644 --- a/cloud/azure/stream-analytics/monitors-stream-analytics.tf +++ b/cloud/azure/stream-analytics/monitors-stream-analytics.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "su_utilization" { @@ -51,7 +51,7 @@ EOQ critical = var.su_utilization_threshold_critical } - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.su_utilization_extra_tags) + tags = concat(local.common_tags, var.tags, var.su_utilization_extra_tags) } resource "datadog_monitor" "failed_function_requests" { @@ -82,7 +82,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.failed_function_requests_extra_tags) + tags = concat(local.common_tags, var.tags, var.failed_function_requests_extra_tags) } resource "datadog_monitor" "conversion_errors" { @@ -112,7 +112,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.conversion_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.conversion_errors_extra_tags) } resource "datadog_monitor" "runtime_errors" { @@ -142,6 +142,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:stream-analytics", "team:claranet", "created-by:terraform"], var.runtime_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.runtime_errors_extra_tags) } diff --git a/cloud/azure/virtual-machine/README.md b/cloud/azure/virtual-machine/README.md index 2be092f5..c10a589f 100644 --- a/cloud/azure/virtual-machine/README.md +++ b/cloud/azure/virtual-machine/README.md @@ -80,7 +80,7 @@ Creates DataDog monitors with the following checks: | [disk\_space\_threshold\_warning](#input\_disk\_space\_threshold\_warning) | Virtual Machine free disk space in percent (warning threshold) | `string` | `"90"` | no | | [disk\_space\_time\_aggregator](#input\_disk\_space\_time\_aggregator) | Monitor aggregator for Virtual Machine free disk space [available values: min, max or avg] | `string` | `"max"` | no | | [disk\_space\_timeframe](#input\_disk\_space\_timeframe) | Monitor timeframe for Virtual Machine free disk space too low [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -109,6 +109,8 @@ Creates DataDog monitors with the following checks: | [status\_message](#input\_status\_message) | Custom message for Virtual Machine status monitor | `string` | `""` | no | | [status\_time\_aggregator](#input\_status\_time\_aggregator) | Monitor aggregator for Virtual Machine status [available values: min, max or avg] | `string` | `"max"` | no | | [status\_timeframe](#input\_status\_timeframe) | Monitor timeframe for Virtual Machine status [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:stream-analytics"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [virtualmachine\_status\_no\_data\_timeframe](#input\_virtualmachine\_status\_no\_data\_timeframe) | Number of minutes before reporting no data | `string` | `10` | no | diff --git a/cloud/azure/virtual-machine/common-inputs.tf b/cloud/azure/virtual-machine/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/azure/virtual-machine/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/azure/virtual-machine/common-locals.tf b/cloud/azure/virtual-machine/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/azure/virtual-machine/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/azure/virtual-machine/inputs.tf b/cloud/azure/virtual-machine/inputs.tf index ec089d7a..095e63a2 100644 --- a/cloud/azure/virtual-machine/inputs.tf +++ b/cloud/azure/virtual-machine/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:azure", "resource:virtualmachine"] } # Global DataDog diff --git a/cloud/azure/virtual-machine/monitors-virtual-machine.tf b/cloud/azure/virtual-machine/monitors-virtual-machine.tf index 98a3c79b..7029e89f 100644 --- a/cloud/azure/virtual-machine/monitors-virtual-machine.tf +++ b/cloud/azure/virtual-machine/monitors-virtual-machine.tf @@ -21,7 +21,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.status_extra_tags) + tags = concat(local.common_tags, var.tags, var.status_extra_tags) } resource "datadog_monitor" "virtualmachine_cpu_usage" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_usage_extra_tags) } resource "datadog_monitor" "virtualmachine_credit_cpu_remaining_too_low" { @@ -84,7 +84,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.cpu_remaining_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_remaining_rate_extra_tags) } resource "datadog_monitor" "virtualmachine_ram_reserved" { @@ -116,7 +116,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.ram_reserved_extra_tags) + tags = concat(local.common_tags, var.tags, var.ram_reserved_extra_tags) } resource "datadog_monitor" "virtualmachine_disk_space" { @@ -146,7 +146,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.disk_space_extra_tags) + tags = concat(local.common_tags, var.tags, var.disk_space_extra_tags) } resource "datadog_monitor" "virtualmachine_requests_failed" { @@ -179,5 +179,5 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:cloud", "provider:azure", "resource:virtualmachine", "team:claranet", "created-by:terraform"], var.requests_failed_extra_tags) + tags = concat(local.common_tags, var.tags, var.requests_failed_extra_tags) } diff --git a/cloud/gcp/big-query/README.md b/cloud/gcp/big-query/README.md index 648d514b..9361c93d 100644 --- a/cloud/gcp/big-query/README.md +++ b/cloud/gcp/big-query/README.md @@ -75,7 +75,7 @@ No modules. | [concurrent\_queries\_threshold\_critical](#input\_concurrent\_queries\_threshold\_critical) | Concurrent Queries (critical threshold) (hard limit 50) | `string` | `45` | no | | [concurrent\_queries\_threshold\_warning](#input\_concurrent\_queries\_threshold\_warning) | Concurrent Queries (warning threshold) (hard limit 50) | `string` | `40` | no | | [concurrent\_queries\_timeframe](#input\_concurrent\_queries\_timeframe) | Timeframe for the Concurrent Queries monitor | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [execution\_time\_enabled](#input\_execution\_time\_enabled) | Flag to enable GCP Big Query Execution Time monitor | `string` | `"true"` | no | | [execution\_time\_extra\_tags](#input\_execution\_time\_extra\_tags) | Extra tags for GCP Big Query Execution Time monitor | `list(string)` | `[]` | no | @@ -113,6 +113,8 @@ No modules. | [table\_count\_threshold\_critical](#input\_table\_count\_threshold\_critical) | Table Count (critical threshold) | `string` | `1` | no | | [table\_count\_threshold\_warning](#input\_table\_count\_threshold\_warning) | Table Count (warning threshold) | `string` | `0` | no | | [table\_count\_timeframe](#input\_table\_count\_timeframe) | Timeframe for the Table Count monitor | `string` | `"last_4h"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:azure",
"resource:virtualmachine"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [uploaded\_bytes\_billed\_enabled](#input\_uploaded\_bytes\_billed\_enabled) | Flag to enable GCP Big Query Uploaded Bytes Billed monitor | `string` | `"true"` | no | | [uploaded\_bytes\_billed\_extra\_tags](#input\_uploaded\_bytes\_billed\_extra\_tags) | Extra tags for GCP Big Query Scanned Bytes monitor | `list(string)` | `[]` | no | diff --git a/cloud/gcp/big-query/common-inputs.tf b/cloud/gcp/big-query/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/gcp/big-query/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/big-query/common-locals.tf b/cloud/gcp/big-query/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/gcp/big-query/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/big-query/inputs.tf b/cloud/gcp/big-query/inputs.tf index 96b910b1..0cb1dfd4 100644 --- a/cloud/gcp/big-query/inputs.tf +++ b/cloud/gcp/big-query/inputs.tf @@ -1,12 +1,10 @@ -# -# Datadog global variables -# - -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:big-query"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/big-query/monitors-big-query.tf b/cloud/gcp/big-query/monitors-big-query.tf index 1979eac2..d16c53d0 100644 --- a/cloud/gcp/big-query/monitors-big-query.tf +++ b/cloud/gcp/big-query/monitors-big-query.tf @@ -28,7 +28,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.concurrent_queries_extra_tags) + tags = concat(local.common_tags, var.tags, var.concurrent_queries_extra_tags) } # @@ -61,7 +61,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.execution_time_extra_tags) + tags = concat(local.common_tags, var.tags, var.execution_time_extra_tags) } # @@ -94,7 +94,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.scanned_bytes_extra_tags) + tags = concat(local.common_tags, var.tags, var.scanned_bytes_extra_tags) } # @@ -127,7 +127,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.scanned_bytes_billed_extra_tags) + tags = concat(local.common_tags, var.tags, var.scanned_bytes_billed_extra_tags) } # @@ -160,7 +160,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.available_slots_extra_tags) + tags = concat(local.common_tags, var.tags, var.available_slots_extra_tags) } # @@ -193,7 +193,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.stored_bytes_extra_tags) + tags = concat(local.common_tags, var.tags, var.stored_bytes_extra_tags) } # @@ -226,7 +226,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.table_count_extra_tags) + tags = concat(local.common_tags, var.tags, var.table_count_extra_tags) } # @@ -259,7 +259,7 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.uploaded_bytes_extra_tags) + tags = concat(local.common_tags, var.tags, var.uploaded_bytes_extra_tags) } # @@ -292,6 +292,6 @@ EOQ notify_audit = false timeout_h = var.timeout_h - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:big-query", "team:claranet", "created-by:terraform"], var.uploaded_bytes_billed_extra_tags) + tags = concat(local.common_tags, var.tags, var.uploaded_bytes_billed_extra_tags) } diff --git a/cloud/gcp/cloud-sql/common/README.md b/cloud/gcp/cloud-sql/common/README.md index fb7fb95a..5c43313f 100644 --- a/cloud/gcp/cloud-sql/common/README.md +++ b/cloud/gcp/cloud-sql/common/README.md @@ -85,7 +85,7 @@ No modules. | [disk\_utilization\_threshold\_warning](#input\_disk\_utilization\_threshold\_warning) | Disk Utilization in percentage (warning threshold) | `string` | `80` | no | | [disk\_utilization\_time\_aggregator](#input\_disk\_utilization\_time\_aggregator) | Time aggregator for the Disk Utilization monitor | `string` | `"avg"` | no | | [disk\_utilization\_timeframe](#input\_disk\_utilization\_timeframe) | Timeframe for the Disk Utilization monitor | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [failover\_unavailable\_enabled](#input\_failover\_unavailable\_enabled) | Flag to enable GCP Cloud SQL Failover Unavailable monitor | `string` | `"true"` | no | | [failover\_unavailable\_extra\_tags](#input\_failover\_unavailable\_extra\_tags) | Extra tags for GCP Cloud SQL Failover Unavailable monitor | `list(string)` | `[]` | no | @@ -120,6 +120,8 @@ No modules. | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds for the new host evaluation | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:big-query"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/gcp/cloud-sql/common/common-inputs.tf b/cloud/gcp/cloud-sql/common/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/gcp/cloud-sql/common/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/cloud-sql/common/common-locals.tf b/cloud/gcp/cloud-sql/common/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/gcp/cloud-sql/common/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/cloud-sql/common/inputs.tf b/cloud/gcp/cloud-sql/common/inputs.tf index 04ae2eaf..3275c83e 100644 --- a/cloud/gcp/cloud-sql/common/inputs.tf +++ b/cloud/gcp/cloud-sql/common/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:cloud-sql"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/cloud-sql/mysql/README.md b/cloud/gcp/cloud-sql/mysql/README.md index dd13542b..cc187ee0 100644 --- a/cloud/gcp/cloud-sql/mysql/README.md +++ b/cloud/gcp/cloud-sql/mysql/README.md @@ -47,7 +47,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes | @@ -63,6 +63,8 @@ No modules. | [replication\_lag\_threshold\_warning](#input\_replication\_lag\_threshold\_warning) | Seconds behind the master (warning threshold) | `string` | `90` | no | | [replication\_lag\_time\_aggregator](#input\_replication\_lag\_time\_aggregator) | Time aggregator for the Replication Lag monitor | `string` | `"min"` | no | | [replication\_lag\_timeframe](#input\_replication\_lag\_timeframe) | Timeframe for the Replication Lag monitor | `string` | `"last_10m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:cloud-sql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/gcp/cloud-sql/mysql/common-inputs.tf b/cloud/gcp/cloud-sql/mysql/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/gcp/cloud-sql/mysql/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/cloud-sql/mysql/common-locals.tf b/cloud/gcp/cloud-sql/mysql/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/gcp/cloud-sql/mysql/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/cloud-sql/mysql/inputs.tf b/cloud/gcp/cloud-sql/mysql/inputs.tf index 6e79eabb..3c807740 100644 --- a/cloud/gcp/cloud-sql/mysql/inputs.tf +++ b/cloud/gcp/cloud-sql/mysql/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:cloud-sql", "engine:mysql"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf index 281241f0..e0069a48 100644 --- a/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf +++ b/cloud/gcp/cloud-sql/mysql/monitors-cloudsql-mysql.tf @@ -29,6 +29,6 @@ EOQ no_data_timeframe = var.replication_lag_no_data_timeframe renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:cloud-sql", "team:claranet", "created-by:terraform", "engine:mysql"], var.replication_lag_extra_tags) + tags = concat(local.common_tags, var.tags, var.replication_lag_extra_tags) } diff --git a/cloud/gcp/gce/instance/README.md b/cloud/gcp/gce/instance/README.md index 567d8527..f9a068b0 100644 --- a/cloud/gcp/gce/instance/README.md +++ b/cloud/gcp/gce/instance/README.md @@ -73,7 +73,7 @@ No modules. | [disk\_throttled\_ops\_threshold\_warning](#input\_disk\_throttled\_ops\_threshold\_warning) | Disk Throttled OPS in percentage (warning threshold) | `string` | `30` | no | | [disk\_throttled\_ops\_time\_aggregator](#input\_disk\_throttled\_ops\_time\_aggregator) | Time aggregator for the Disk Throttled OPS monitor | `string` | `"min"` | no | | [disk\_throttled\_ops\_timeframe](#input\_disk\_throttled\_ops\_timeframe) | Timeframe for the Disk Throttled OPS monitor | `string` | `"last_15m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes | @@ -81,6 +81,8 @@ No modules. | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds for the new host evaluation | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:cloud-sql",
"engine:mysql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/gcp/gce/instance/common-inputs.tf b/cloud/gcp/gce/instance/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/gcp/gce/instance/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/gce/instance/common-locals.tf b/cloud/gcp/gce/instance/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/gcp/gce/instance/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/gce/instance/inputs.tf b/cloud/gcp/gce/instance/inputs.tf index db3ce39b..0ee62d30 100644 --- a/cloud/gcp/gce/instance/inputs.tf +++ b/cloud/gcp/gce/instance/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:gce-instance"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/gce/instance/monitors-gce-instance.tf b/cloud/gcp/gce/instance/monitors-gce-instance.tf index d10f7c6f..eed0a4d4 100644 --- a/cloud/gcp/gce/instance/monitors-gce-instance.tf +++ b/cloud/gcp/gce/instance/monitors-gce-instance.tf @@ -29,7 +29,7 @@ EOQ no_data_timeframe = var.cpu_utilization_no_data_timeframe renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.cpu_utilization_extra_tags) + tags = concat(local.common_tags, var.tags, var.cpu_utilization_extra_tags) } # @@ -68,7 +68,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.disk_throttled_bps_extra_tags) + tags = concat(local.common_tags, var.tags, var.disk_throttled_bps_extra_tags) } # @@ -107,6 +107,6 @@ EOQ require_full_window = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:gce-instance", "team:claranet", "created-by:terraform"], var.disk_throttled_ops_extra_tags) + tags = concat(local.common_tags, var.tags, var.disk_throttled_ops_extra_tags) } diff --git a/cloud/gcp/lb/README.md b/cloud/gcp/lb/README.md index bddae9e1..b4e88493 100644 --- a/cloud/gcp/lb/README.md +++ b/cloud/gcp/lb/README.md @@ -69,7 +69,7 @@ No modules. | [backend\_latency\_service\_threshold\_warning](#input\_backend\_latency\_service\_threshold\_warning) | Latency in milliseconds (warning threshold) | `string` | `1000` | no | | [backend\_latency\_service\_time\_aggregator](#input\_backend\_latency\_service\_time\_aggregator) | Timeframe for the GCP LB Backend Latency monitor | `string` | `"min"` | no | | [backend\_latency\_service\_timeframe](#input\_backend\_latency\_service\_timeframe) | Timeframe for the GCP LB Backend Latency monitor | `string` | `"last_10m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [error\_rate\_4xx\_artificial\_request](#input\_error\_rate\_4xx\_artificial\_request) | Divisor Delta for the GCP LB 4XX Errors monitor | `string` | `5` | no | | [error\_rate\_4xx\_enabled](#input\_error\_rate\_4xx\_enabled) | Flag to enable GCP LB 4XX Errors monitor | `string` | `"true"` | no | | [error\_rate\_4xx\_extra\_tags](#input\_error\_rate\_4xx\_extra\_tags) | Extra tags for GCP LB 4XX Errors monitor | `list(string)` | `[]` | no | @@ -101,6 +101,8 @@ No modules. | [request\_count\_time\_aggregator](#input\_request\_count\_time\_aggregator) | Timeframe for the GCP LB Request Count monitor | `string` | `"sum"` | no | | [request\_count\_timeframe](#input\_request\_count\_timeframe) | Timeframe for the GCP LB Request Count monitor | `string` | `"last_5m"` | no | | [request\_count\_timeshift](#input\_request\_count\_timeshift) | Timeshift for the GCP LB Request Count monitor | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:gce-instance"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/gcp/lb/common-inputs.tf b/cloud/gcp/lb/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/cloud/gcp/lb/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/lb/common-locals.tf b/cloud/gcp/lb/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/cloud/gcp/lb/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/lb/inputs.tf b/cloud/gcp/lb/inputs.tf index 7ef2b7d7..f3535a57 100644 --- a/cloud/gcp/lb/inputs.tf +++ b/cloud/gcp/lb/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:lb"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/lb/monitors-lb.tf b/cloud/gcp/lb/monitors-lb.tf index c9ae4f3a..bc93de83 100644 --- a/cloud/gcp/lb/monitors-lb.tf +++ b/cloud/gcp/lb/monitors-lb.tf @@ -29,7 +29,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.error_rate_4xx_extra_tags) + tags = concat(local.common_tags, var.tags, var.error_rate_4xx_extra_tags) } # @@ -63,7 +63,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.error_rate_5xx_extra_tags) + tags = concat(local.common_tags, var.tags, var.error_rate_5xx_extra_tags) } # @@ -96,7 +96,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.backend_latency_service_extra_tags) + tags = concat(local.common_tags, var.tags, var.backend_latency_service_extra_tags) } # @@ -129,7 +129,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.backend_latency_bucket_extra_tags) + tags = concat(local.common_tags, var.tags, var.backend_latency_bucket_extra_tags) } # @@ -162,6 +162,6 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:lb", "team:claranet", "created-by:terraform"], var.request_count_extra_tags) + tags = concat(local.common_tags, var.tags, var.request_count_extra_tags) } diff --git a/cloud/gcp/memorystore/redis/README.md b/cloud/gcp/memorystore/redis/README.md index 65b640b5..cf766fdf 100644 --- a/cloud/gcp/memorystore/redis/README.md +++ b/cloud/gcp/memorystore/redis/README.md @@ -47,7 +47,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes | @@ -63,6 +63,8 @@ No modules. | [system\_memory\_usage\_ratio\_threshold\_warning](#input\_system\_memory\_usage\_ratio\_threshold\_warning) | Memorystore Redis System memory usage ratio warning threshold | `string` | `80` | no | | [system\_memory\_usage\_ratio\_time\_aggregator](#input\_system\_memory\_usage\_ratio\_time\_aggregator) | Time aggregator for Memorystore Redis System memory usage ratio monitor | `string` | `"min"` | no | | [system\_memory\_usage\_ratio\_timeframe](#input\_system\_memory\_usage\_ratio\_timeframe) | Timeframe for Memorystore Redis System memory usage ratio monitor | `string` | `"last_10m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:lb"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/gcp/memorystore/redis/common-inputs.tf b/cloud/gcp/memorystore/redis/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/gcp/memorystore/redis/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/memorystore/redis/common-locals.tf b/cloud/gcp/memorystore/redis/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/gcp/memorystore/redis/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/memorystore/redis/inputs.tf b/cloud/gcp/memorystore/redis/inputs.tf index 61c3aa0d..7deaa252 100644 --- a/cloud/gcp/memorystore/redis/inputs.tf +++ b/cloud/gcp/memorystore/redis/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:memorystore", "engine:redis"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/memorystore/redis/monitors-memorystore-redis.tf b/cloud/gcp/memorystore/redis/monitors-memorystore-redis.tf index 7e4c5aa1..3d2ad20c 100644 --- a/cloud/gcp/memorystore/redis/monitors-memorystore-redis.tf +++ b/cloud/gcp/memorystore/redis/monitors-memorystore-redis.tf @@ -29,5 +29,5 @@ EOQ no_data_timeframe = var.system_memory_usage_ratio_no_data_timeframe renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:memorystore", "team:claranet", "created-by:terraform", "engine:redis"], var.system_memory_usage_ratio_extra_tags) + tags = concat(local.common_tags, var.tags, var.system_memory_usage_ratio_extra_tags) } diff --git a/cloud/gcp/pubsub/subscription/README.md b/cloud/gcp/pubsub/subscription/README.md index c74ec493..83a7d248 100644 --- a/cloud/gcp/pubsub/subscription/README.md +++ b/cloud/gcp/pubsub/subscription/README.md @@ -51,7 +51,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes | @@ -86,6 +86,8 @@ No modules. | [subscription\_push\_latency\_threshold\_warning](#input\_subscription\_push\_latency\_threshold\_warning) | GCP Pub/Sub Subscription Push Latency High warning threshold | `string` | `1000` | no | | [subscription\_push\_latency\_time\_aggregator](#input\_subscription\_push\_latency\_time\_aggregator) | Time aggregator for the GCP Pub/Sub Subscription Push Latency High monitor | `string` | `"avg"` | no | | [subscription\_push\_latency\_timeframe](#input\_subscription\_push\_latency\_timeframe) | Timeframe for the GCP Pub/Sub Subscription Push Latency High monitor | `string` | `"last_10m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:memorystore",
"engine:redis"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/cloud/gcp/pubsub/subscription/common-inputs.tf b/cloud/gcp/pubsub/subscription/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/gcp/pubsub/subscription/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/pubsub/subscription/common-locals.tf b/cloud/gcp/pubsub/subscription/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/gcp/pubsub/subscription/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/pubsub/subscription/inputs.tf b/cloud/gcp/pubsub/subscription/inputs.tf index 57a100b9..32f5b12b 100644 --- a/cloud/gcp/pubsub/subscription/inputs.tf +++ b/cloud/gcp/pubsub/subscription/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:pubsub", "category:subscription"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/pubsub/subscription/monitors-subscription.tf b/cloud/gcp/pubsub/subscription/monitors-subscription.tf index ccd2a65a..203f719f 100644 --- a/cloud/gcp/pubsub/subscription/monitors-subscription.tf +++ b/cloud/gcp/pubsub/subscription/monitors-subscription.tf @@ -32,7 +32,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "category:subscription", "team:claranet", "created-by:terraform"], var.oldest_unacked_message_age_extra_tags) + tags = concat(local.common_tags, var.tags, var.oldest_unacked_message_age_extra_tags) } ###################### @@ -69,7 +69,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "category:subscription", "team:claranet", "created-by:terraform"], var.subscription_push_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.subscription_push_latency_extra_tags) } # @@ -112,5 +112,5 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "category:subscription", "team:claranet", "created-by:terraform"], var.subscription_push_latency_anomaly_extra_tags) + tags = concat(local.common_tags, var.tags, var.subscription_push_latency_anomaly_extra_tags) } \ No newline at end of file diff --git a/cloud/gcp/pubsub/topic/README.md b/cloud/gcp/pubsub/topic/README.md index 095470da..074092ab 100644 --- a/cloud/gcp/pubsub/topic/README.md +++ b/cloud/gcp/pubsub/topic/README.md @@ -51,7 +51,7 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `900` | no | | [filter\_tags](#input\_filter\_tags) | Tags used for filtering | `string` | `"*"` | no | | [message](#input\_message) | Message sent when a monitor is triggered | `any` | n/a | yes | @@ -65,6 +65,8 @@ No modules. | [sending\_operations\_count\_threshold\_critical](#input\_sending\_operations\_count\_threshold\_critical) | Critical threshold for the number of sending operations. | `string` | `0` | no | | [sending\_operations\_count\_time\_aggregator](#input\_sending\_operations\_count\_time\_aggregator) | Timeframe for the GCP Pub/Sub Sending Operations Count monitor | `string` | `"sum"` | no | | [sending\_operations\_count\_timeframe](#input\_sending\_operations\_count\_timeframe) | Timeframe for the GCP Pub/Sub Sending Operations Count monitor | `string` | `"last_30m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:pubsub",
"category:subscription"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [unavailable\_sending\_operations\_count\_enabled](#input\_unavailable\_sending\_operations\_count\_enabled) | Flag to enable GCP Pub/Sub Unavailable Sending Operations Count monitor | `string` | `"false"` | no | | [unavailable\_sending\_operations\_count\_extra\_tags](#input\_unavailable\_sending\_operations\_count\_extra\_tags) | Extra tags for GCP Pub/Sub Unavailable Sending Operations Count monitor | `list(string)` | `[]` | no | diff --git a/cloud/gcp/pubsub/topic/common-inputs.tf b/cloud/gcp/pubsub/topic/common-inputs.tf new file mode 120000 index 00000000..11335bd4 --- /dev/null +++ b/cloud/gcp/pubsub/topic/common-inputs.tf @@ -0,0 +1 @@ +../../../../common/module/inputs.tf \ No newline at end of file diff --git a/cloud/gcp/pubsub/topic/common-locals.tf b/cloud/gcp/pubsub/topic/common-locals.tf new file mode 120000 index 00000000..30e51fcc --- /dev/null +++ b/cloud/gcp/pubsub/topic/common-locals.tf @@ -0,0 +1 @@ +../../../../common/module/locals.tf \ No newline at end of file diff --git a/cloud/gcp/pubsub/topic/inputs.tf b/cloud/gcp/pubsub/topic/inputs.tf index e786759e..0de75b64 100644 --- a/cloud/gcp/pubsub/topic/inputs.tf +++ b/cloud/gcp/pubsub/topic/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:cloud", "provider:gcp", "resource:pubsub", "category:topic"] } +# Global DataDog variable "filter_tags" { description = "Tags used for filtering" default = "*" diff --git a/cloud/gcp/pubsub/topic/monitors-topics.tf b/cloud/gcp/pubsub/topic/monitors-topics.tf index 167b551e..66e831b3 100644 --- a/cloud/gcp/pubsub/topic/monitors-topics.tf +++ b/cloud/gcp/pubsub/topic/monitors-topics.tf @@ -27,7 +27,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "category:topic", "team:claranet", "created-by:terraform"], var.sending_operations_count_extra_tags) + tags = concat(local.common_tags, var.tags, var.sending_operations_count_extra_tags) } # @@ -60,7 +60,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "category:topic", "team:claranet", "created-by:terraform"], var.unavailable_sending_operations_count_extra_tags) + tags = concat(local.common_tags, var.tags, var.unavailable_sending_operations_count_extra_tags) } # @@ -95,5 +95,5 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:cloud", "provider:gcp", "resource:pubsub", "category:topic", "team:claranet", "created-by:terraform"], var.unavailable_sending_operations_ratio_extra_tags) + tags = concat(local.common_tags, var.tags, var.unavailable_sending_operations_ratio_extra_tags) } diff --git a/common/module/inputs.tf b/common/module/inputs.tf new file mode 100644 index 00000000..71b60fcc --- /dev/null +++ b/common/module/inputs.tf @@ -0,0 +1,9 @@ +variable "environment" { + description = "Architecture Environment" + type = string +} + +variable "team" { + type = string + default = "claranet" +} diff --git a/common/module/locals.tf b/common/module/locals.tf new file mode 100644 index 00000000..a708ca88 --- /dev/null +++ b/common/module/locals.tf @@ -0,0 +1,3 @@ +locals { + common_tags = ["env:${var.environment}", "team:${var.team}", "created-by:terraform"] +} diff --git a/database/elasticsearch/README.md b/database/elasticsearch/README.md index 8f183233..bea1e44c 100644 --- a/database/elasticsearch/README.md +++ b/database/elasticsearch/README.md @@ -119,7 +119,7 @@ Creates DataDog monitors with the following checks: | [cluster\_unassigned\_shards\_threshold\_warning](#input\_cluster\_unassigned\_shards\_threshold\_warning) | Cluster Status warning threshold | `string` | `1` | no | | [cluster\_unassigned\_shards\_time\_aggregator](#input\_cluster\_unassigned\_shards\_time\_aggregator) | Time aggregator for the Cluster Status monitor | `string` | `"avg"` | no | | [cluster\_unassigned\_shards\_timeframe](#input\_cluster\_unassigned\_shards\_timeframe) | Timeframe for the Cluster Status monitor | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [fetch\_change\_enabled](#input\_fetch\_change\_enabled) | Flag to enable Cluster Status monitor | `string` | `"true"` | no | | [fetch\_change\_extra\_tags](#input\_fetch\_change\_extra\_tags) | Extra tags for Cluster Status monitor | `list(string)` | `[]` | no | @@ -258,6 +258,7 @@ Creates DataDog monitors with the following checks: | [search\_query\_latency\_threshold\_warning](#input\_search\_query\_latency\_threshold\_warning) | Cluster Status warning threshold | `string` | `10` | no | | [search\_query\_latency\_time\_aggregator](#input\_search\_query\_latency\_time\_aggregator) | Time aggregator for the Cluster Status monitor | `string` | `"avg"` | no | | [search\_query\_latency\_timeframe](#input\_search\_query\_latency\_timeframe) | Timeframe for the Cluster Status monitor | `string` | `"last_15m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:cloud",
"provider:gcp",
"resource:pubsub",
"category:topic"
]
[| no | | [task\_time\_in\_queue\_change\_enabled](#input\_task\_time\_in\_queue\_change\_enabled) | Flag to enable Cluster Status monitor | `string` | `"true"` | no | | [task\_time\_in\_queue\_change\_extra\_tags](#input\_task\_time\_in\_queue\_change\_extra\_tags) | Extra tags for Cluster Status monitor | `list(string)` | `[]` | no | | [task\_time\_in\_queue\_change\_message](#input\_task\_time\_in\_queue\_change\_message) | Custom message for the Cluster Status monitor | `string` | `""` | no | @@ -266,6 +267,7 @@ Creates DataDog monitors with the following checks: | [task\_time\_in\_queue\_change\_time\_aggregator](#input\_task\_time\_in\_queue\_change\_time\_aggregator) | Time aggregator for the Cluster Status monitor | `string` | `"avg"` | no | | [task\_time\_in\_queue\_change\_timeframe](#input\_task\_time\_in\_queue\_change\_timeframe) | Timeframe for the Cluster Status monitor | `string` | `"last_10m"` | no | | [task\_time\_in\_queue\_change\_timeshift](#input\_task\_time\_in\_queue\_change\_timeshift) | Timeshift for the Cluster Status monitor | `string` | `"last_10m"` | no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/elasticsearch/common-inputs.tf b/database/elasticsearch/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/elasticsearch/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/elasticsearch/common-locals.tf b/database/elasticsearch/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/elasticsearch/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/elasticsearch/inputs.tf b/database/elasticsearch/inputs.tf index ba9f34a1..5a0390b1 100644 --- a/database/elasticsearch/inputs.tf +++ b/database/elasticsearch/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:elasticsearch", "resource:elasticsearch"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/database/elasticsearch/monitors-elasticsearch.tf b/database/elasticsearch/monitors-elasticsearch.tf index afb9c970..ef2c6b13 100644 --- a/database/elasticsearch/monitors-elasticsearch.tf +++ b/database/elasticsearch/monitors-elasticsearch.tf @@ -26,7 +26,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags) + tags = concat(local.common_tags, var.tags, var.not_responding_extra_tags) } # @@ -58,7 +58,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_status_not_green_extra_tags) + tags = concat(local.common_tags, var.tags, var.cluster_status_not_green_extra_tags) } # @@ -89,7 +89,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_initializing_shards_extra_tags) + tags = concat(local.common_tags, var.tags, var.cluster_initializing_shards_extra_tags) } # @@ -120,7 +120,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_relocating_shards_extra_tags) + tags = concat(local.common_tags, var.tags, var.cluster_relocating_shards_extra_tags) } # @@ -151,7 +151,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.cluster_unassigned_shards_extra_tags) + tags = concat(local.common_tags, var.tags, var.cluster_unassigned_shards_extra_tags) } # @@ -186,7 +186,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.node_free_space_extra_tags) + tags = concat(local.common_tags, var.tags, var.node_free_space_extra_tags) } # @@ -217,7 +217,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_heap_memory_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.jvm_heap_memory_usage_extra_tags) } # @@ -248,7 +248,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_memory_young_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.jvm_memory_young_usage_extra_tags) } # @@ -279,7 +279,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_memory_old_usage_extra_tags) + tags = concat(local.common_tags, var.tags, var.jvm_memory_old_usage_extra_tags) } # @@ -313,7 +313,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_gc_old_collection_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.jvm_gc_old_collection_latency_extra_tags) } # @@ -347,7 +347,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.jvm_gc_young_collection_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.jvm_gc_young_collection_latency_extra_tags) } # @@ -382,7 +382,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.indexing_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.indexing_latency_extra_tags) } # @@ -417,7 +417,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.flush_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.flush_latency_extra_tags) } # @@ -461,7 +461,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.http_connections_anomaly_extra_tags) + tags = concat(local.common_tags, var.tags, var.http_connections_anomaly_extra_tags) } # @@ -496,7 +496,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.search_query_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.search_query_latency_extra_tags) } # @@ -531,7 +531,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.fetch_latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.fetch_latency_extra_tags) } # @@ -562,7 +562,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.search_query_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.search_query_change_extra_tags) } # @@ -593,7 +593,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.fetch_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.fetch_change_extra_tags) } # @@ -625,7 +625,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.field_data_evictions_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.field_data_evictions_change_extra_tags) } # @@ -657,7 +657,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.query_cache_evictions_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.query_cache_evictions_change_extra_tags) } # @@ -689,7 +689,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.request_cache_evictions_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.request_cache_evictions_change_extra_tags) } # @@ -720,6 +720,6 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:elasticsearch", "resource:elasticsearch", "team:claranet", "created-by:terraform"], var.task_time_in_queue_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.task_time_in_queue_change_extra_tags) } diff --git a/database/mongodb/README.md b/database/mongodb/README.md index f33ac457..575c8f08 100644 --- a/database/mongodb/README.md +++ b/database/mongodb/README.md @@ -90,6 +90,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:elasticsearch",
"resource:elasticsearch"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/mongodb/common-inputs.tf b/database/mongodb/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/mongodb/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/mongodb/common-locals.tf b/database/mongodb/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/mongodb/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/mongodb/inputs.tf b/database/mongodb/inputs.tf index 4ff6dfb3..0286447f 100644 --- a/database/mongodb/inputs.tf +++ b/database/mongodb/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:mongo", "resource:mongodb"] } # Global DataDog diff --git a/database/mongodb/monitors-mongo.tf b/database/mongodb/monitors-mongo.tf index 763751b3..7af8d2d8 100644 --- a/database/mongodb/monitors-mongo.tf +++ b/database/mongodb/monitors-mongo.tf @@ -20,7 +20,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_primary_extra_tags) + tags = concat(local.common_tags, var.tags, var.mongodb_primary_extra_tags) } resource "datadog_monitor" "mongodb_secondary" { @@ -51,7 +51,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_secondary_extra_tags) + tags = concat(local.common_tags, var.tags, var.mongodb_secondary_extra_tags) } resource "datadog_monitor" "mongodb_server_count" { @@ -81,7 +81,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_secondary_extra_tags) + tags = concat(local.common_tags, var.tags, var.mongodb_secondary_extra_tags) } resource "datadog_monitor" "mongodb_replication" { @@ -110,6 +110,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:mongo", "resource:mongodb", "team:claranet", "created-by:terraform"], var.mongodb_replication_extra_tags) + tags = concat(local.common_tags, var.tags, var.mongodb_replication_extra_tags) } diff --git a/database/mysql/README.md b/database/mysql/README.md index f0f4d4b2..ca4d5fea 100644 --- a/database/mysql/README.md +++ b/database/mysql/README.md @@ -67,7 +67,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -155,6 +155,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds for the metric evaluation | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:mongo",
"resource:mongodb"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/mysql/common-inputs.tf b/database/mysql/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/mysql/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/mysql/common-locals.tf b/database/mysql/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/mysql/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/mysql/inputs.tf b/database/mysql/inputs.tf index 6123ff47..fe3593cf 100644 --- a/database/mysql/inputs.tf +++ b/database/mysql/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:mysql", "resource:mysql"] } +# Global DataDog variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 15 diff --git a/database/mysql/monitors-mysql.tf b/database/mysql/monitors-mysql.tf index de443b62..fbb7ea52 100644 --- a/database/mysql/monitors-mysql.tf +++ b/database/mysql/monitors-mysql.tf @@ -23,7 +23,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_availability_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_availability_extra_tags) } resource "datadog_monitor" "mysql_connection" { @@ -53,7 +53,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_connection_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_connection_extra_tags) } resource "datadog_monitor" "mysql_aborted" { @@ -83,7 +83,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_aborted_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_aborted_extra_tags) } resource "datadog_monitor" "mysql_slow" { @@ -113,7 +113,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_slow_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_slow_extra_tags) } resource "datadog_monitor" "mysql_pool_efficiency" { @@ -143,7 +143,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_pool_efficiency_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_pool_efficiency_extra_tags) } resource "datadog_monitor" "mysql_pool_utilization" { @@ -174,7 +174,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_pool_utilization_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_pool_utilization_extra_tags) } resource "datadog_monitor" "mysql_threads_anomaly" { @@ -217,7 +217,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_threads_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_threads_extra_tags) } resource "datadog_monitor" "mysql_questions_anomaly" { @@ -260,7 +260,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_questions_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_questions_extra_tags) } resource "datadog_monitor" "mysql_replication_lag" { @@ -287,7 +287,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_replication_lag_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_replication_lag_extra_tags) } resource "datadog_monitor" "mysql_replication_status" { @@ -313,5 +313,5 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:mysql", "resource:mysql", "team:claranet", "created-by:terraform"], var.mysql_replication_status_extra_tags) + tags = concat(local.common_tags, var.tags, var.mysql_replication_status_extra_tags) } diff --git a/database/pgbouncer/README.md b/database/pgbouncer/README.md index 37b628b8..1c7d80df 100644 --- a/database/pgbouncer/README.md +++ b/database/pgbouncer/README.md @@ -55,7 +55,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -91,6 +91,8 @@ Creates DataDog monitors with the following checks: | [pgbouncer\_wait\_time\_time\_aggregator](#input\_pgbouncer\_wait\_time\_time\_aggregator) | Monitor time aggregator for PGBouncer connection monitor [available values: min, max or avg] | `string` | `"avg"` | no | | [pgbouncer\_wait\_time\_timeframe](#input\_pgbouncer\_wait\_time\_timeframe) | Monitor timeframe for PGBouncer connection monitor [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](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:mysql",
"resource:mysql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/pgbouncer/common-inputs.tf b/database/pgbouncer/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/pgbouncer/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/pgbouncer/common-locals.tf b/database/pgbouncer/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/pgbouncer/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/pgbouncer/inputs.tf b/database/pgbouncer/inputs.tf index 21528fe8..e4e55f08 100644 --- a/database/pgbouncer/inputs.tf +++ b/database/pgbouncer/inputs.tf @@ -1,6 +1,7 @@ -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:pgbouncer", "resource:pgbouncer"] } # Global DataDog diff --git a/database/pgbouncer/monitors-pgbouncer.tf b/database/pgbouncer/monitors-pgbouncer.tf index e787ddc9..b007d8c7 100644 --- a/database/pgbouncer/monitors-pgbouncer.tf +++ b/database/pgbouncer/monitors-pgbouncer.tf @@ -23,7 +23,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:pgbouncer", "resource:pgbouncer", "team:claranet", "created-by:terraform"], var.pgbouncer_availability_extra_tags) + tags = concat(local.common_tags, var.tags, var.pgbouncer_availability_extra_tags) } resource "datadog_monitor" "pgbouncer_pool_connection_limit" { @@ -51,7 +51,7 @@ EOQ timeout_h = 0 include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:pgbouncer", "resource:pgbouncer", "team:claranet", "created-by:terraform"], var.pgbouncer_pool_connection_limit_extra_tags) + tags = concat(local.common_tags, var.tags, var.pgbouncer_pool_connection_limit_extra_tags) } resource "datadog_monitor" "pgbouncer_database_connection_limit" { @@ -80,7 +80,7 @@ EOQ timeout_h = 0 include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:pgbouncer", "resource:pgbouncer", "team:claranet", "created-by:terraform"], var.pgbouncer_database_connection_limit_extra_tags) + tags = concat(local.common_tags, var.tags, var.pgbouncer_database_connection_limit_extra_tags) } resource "datadog_monitor" "pgbouncer_wait_time" { @@ -108,5 +108,5 @@ EOQ timeout_h = 0 include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:pgbouncer", "resource:pgbouncer", "team:claranet", "created-by:terraform"], var.pgbouncer_wait_time_extra_tags) + tags = concat(local.common_tags, var.tags, var.pgbouncer_wait_time_extra_tags) } diff --git a/database/postgresql/README.md b/database/postgresql/README.md index 8eb7dbdc..e6fe8baf 100644 --- a/database/postgresql/README.md +++ b/database/postgresql/README.md @@ -57,7 +57,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -100,6 +100,8 @@ Creates DataDog monitors with the following checks: | [postgresql\_replication\_delay\_threshold\_warning](#input\_postgresql\_replication\_delay\_threshold\_warning) | Warning threshold in seconds | `number` | `100` | no | | [postgresql\_replication\_delay\_timeframe](#input\_postgresql\_replication\_delay\_timeframe) | Monitor timeframe for PostgreSQL replication delay [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_15m"` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:pgbouncer",
"resource:pgbouncer"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/postgresql/common-inputs.tf b/database/postgresql/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/postgresql/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/postgresql/common-locals.tf b/database/postgresql/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/postgresql/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/postgresql/inputs.tf b/database/postgresql/inputs.tf index 0e3dfc08..3c97ffd5 100644 --- a/database/postgresql/inputs.tf +++ b/database/postgresql/inputs.tf @@ -1,6 +1,7 @@ -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:postgres", "resource:postgresql"] } # Global DataDog diff --git a/database/postgresql/monitors-postgresql.tf b/database/postgresql/monitors-postgresql.tf index 93b94d6f..e43dad81 100644 --- a/database/postgresql/monitors-postgresql.tf +++ b/database/postgresql/monitors-postgresql.tf @@ -23,7 +23,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_availability_extra_tags) + tags = concat(local.common_tags, var.tags, var.postgresql_availability_extra_tags) } resource "datadog_monitor" "postgresql_connection_too_high" { @@ -52,7 +52,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_connection_extra_tags) + tags = concat(local.common_tags, var.tags, var.postgresql_connection_extra_tags) } resource "datadog_monitor" "postgresql_too_many_locks" { @@ -81,7 +81,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_lock_extra_tags) + tags = concat(local.common_tags, var.tags, var.postgresql_lock_extra_tags) } resource "datadog_monitor" "postgresql_disk_queue_depth" { @@ -109,7 +109,7 @@ EOQ timeout_h = 0 include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_disk_queue_extra_tags) + tags = concat(local.common_tags, var.tags, var.postgresql_disk_queue_extra_tags) } resource "datadog_monitor" "postgresql_replication_delay" { @@ -137,5 +137,5 @@ EOQ timeout_h = 0 include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:postgres", "resource:postgresql", "team:claranet", "created-by:terraform"], var.postgresql_replication_delay_extra_tags) + tags = concat(local.common_tags, var.tags, var.postgresql_replication_delay_extra_tags) } diff --git a/database/proxysql/README.md b/database/proxysql/README.md index 7e298a79..9f4ba967 100644 --- a/database/proxysql/README.md +++ b/database/proxysql/README.md @@ -57,7 +57,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -102,6 +102,8 @@ Creates DataDog monitors with the following checks: | [proxysql\_thread\_worker\_threshold\_warning](#input\_proxysql\_thread\_worker\_threshold\_warning) | Minimum warning acceptable of thread worker running | `number` | `4` | no | | [proxysql\_thread\_worker\_time\_aggregator](#input\_proxysql\_thread\_worker\_time\_aggregator) | Monitor time aggregator for ProxySQL thread worker monitor [available values: min, max or avg] | `string` | `"avg"` | no | | [proxysql\_thread\_worker\_timeframe](#input\_proxysql\_thread\_worker\_timeframe) | Monitor timeframe for ProxySQL thread worker monitor [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:postgres",
"resource:postgresql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/proxysql/common-inputs.tf b/database/proxysql/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/proxysql/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/proxysql/common-locals.tf b/database/proxysql/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/proxysql/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/proxysql/inputs.tf b/database/proxysql/inputs.tf index 14dee457..17be5791 100644 --- a/database/proxysql/inputs.tf +++ b/database/proxysql/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:proxysql", "resource:proxysql"] } +# Global DataDog variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 15 diff --git a/database/proxysql/monitors-proxysql.tf b/database/proxysql/monitors-proxysql.tf index 523b88af..fc3153c1 100644 --- a/database/proxysql/monitors-proxysql.tf +++ b/database/proxysql/monitors-proxysql.tf @@ -22,7 +22,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:proxysql", "resource:proxysql", "team:claranet", "created-by:terraform"], var.proxysql_thread_worker_extra_tags) + tags = concat(local.common_tags, var.tags, var.proxysql_thread_worker_extra_tags) } resource "datadog_monitor" "proxysql_slow" { @@ -52,7 +52,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:proxysql", "resource:proxysql", "team:claranet", "created-by:terraform"], var.proxysql_slow_extra_tags) + tags = concat(local.common_tags, var.tags, var.proxysql_slow_extra_tags) } resource "datadog_monitor" "proxysql_client_conn_aborted" { @@ -79,7 +79,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:proxysql", "resource:proxysql", "team:claranet", "created-by:terraform"], var.proxysql_client_conn_aborted_extra_tags) + tags = concat(local.common_tags, var.tags, var.proxysql_client_conn_aborted_extra_tags) } resource "datadog_monitor" "proxysql_server_conn_aborted" { @@ -106,7 +106,7 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:proxysql", "resource:proxysql", "team:claranet", "created-by:terraform"], var.proxysql_server_conn_aborted_extra_tags) + tags = concat(local.common_tags, var.tags, var.proxysql_server_conn_aborted_extra_tags) } resource "datadog_monitor" "proxysql_pool_conn_failure" { @@ -135,5 +135,5 @@ EOQ timeout_h = var.timeout_h include_tags = true - tags = concat(["env:${var.environment}", "type:database", "provider:proxysql", "resource:proxysql", "team:claranet", "created-by:terraform"], var.proxysql_pool_conn_failure_extra_tags) + tags = concat(local.common_tags, var.tags, var.proxysql_pool_conn_failure_extra_tags) } diff --git a/database/redis/README.md b/database/redis/README.md index 0b610b36..9f696559 100644 --- a/database/redis/README.md +++ b/database/redis/README.md @@ -74,7 +74,7 @@ Creates DataDog monitors with the following checks: | [blocked\_clients\_threshold\_warning](#input\_blocked\_clients\_threshold\_warning) | Blocked clients rate (warning threshold) | `number` | `10` | no | | [blocked\_clients\_time\_aggregator](#input\_blocked\_clients\_time\_aggregator) | Monitor aggregator for Redis Blocked clients [available values: min, max or avg] | `string` | `"min"` | no | | [blocked\_clients\_timeframe](#input\_blocked\_clients\_timeframe) | Monitor timeframe for Redis Blocked clients [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [evictedkeys\_change\_enabled](#input\_evictedkeys\_change\_enabled) | Flag to enable Redis evicted keys monitor | `string` | `"true"` | no | | [evictedkeys\_change\_extra\_tags](#input\_evictedkeys\_change\_extra\_tags) | Extra tags for Redis evicted keys monitor | `list(string)` | `[]` | no | @@ -145,6 +145,8 @@ Creates DataDog monitors with the following checks: | [rejected\_con\_threshold\_warning](#input\_rejected\_con\_threshold\_warning) | rejected connections errors limit (warning threshold) | `number` | `10` | no | | [rejected\_con\_time\_aggregator](#input\_rejected\_con\_time\_aggregator) | Monitor aggregator for Redis rejected connections errors [available values: min, max or avg] | `string` | `"min"` | no | | [rejected\_con\_timeframe](#input\_rejected\_con\_timeframe) | Monitor timeframe for Redis rejected connections errors [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:proxysql",
"resource:proxysql"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/redis/common-inputs.tf b/database/redis/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/redis/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/redis/common-locals.tf b/database/redis/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/redis/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/redis/inputs.tf b/database/redis/inputs.tf index 1c1574ee..44cdd20d 100644 --- a/database/redis/inputs.tf +++ b/database/redis/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:redisdb", "resource:redis"] } # Global DataDog diff --git a/database/redis/monitors-redis.tf b/database/redis/monitors-redis.tf index 141b3d1d..4974783f 100644 --- a/database/redis/monitors-redis.tf +++ b/database/redis/monitors-redis.tf @@ -26,7 +26,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags) + tags = concat(local.common_tags, var.tags, var.not_responding_extra_tags) } resource "datadog_monitor" "evicted_keys" { @@ -56,7 +56,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.evictedkeys_change_extra_tags) + tags = concat(local.common_tags, var.tags, var.evictedkeys_change_extra_tags) } resource "datadog_monitor" "expirations" { @@ -86,7 +86,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.expirations_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.expirations_rate_extra_tags) } resource "datadog_monitor" "blocked_clients" { @@ -117,7 +117,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.blocked_clients_extra_tags) + tags = concat(local.common_tags, var.tags, var.blocked_clients_extra_tags) } resource "datadog_monitor" "keyspace_full" { @@ -147,7 +147,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.keyspace_extra_tags) + tags = concat(local.common_tags, var.tags, var.keyspace_extra_tags) } resource "datadog_monitor" "memory_used" { @@ -178,7 +178,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.mem_used_extra_tags) + tags = concat(local.common_tags, var.tags, var.mem_used_extra_tags) } resource "datadog_monitor" "memory_frag" { @@ -208,7 +208,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.mem_frag_extra_tags) + tags = concat(local.common_tags, var.tags, var.mem_frag_extra_tags) } resource "datadog_monitor" "rejected_connections" { @@ -238,7 +238,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.rejected_con_extra_tags) + tags = concat(local.common_tags, var.tags, var.rejected_con_extra_tags) } resource "datadog_monitor" "latency" { @@ -268,7 +268,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.latency_extra_tags) + tags = concat(local.common_tags, var.tags, var.latency_extra_tags) } resource "datadog_monitor" "hitrate" { @@ -300,6 +300,6 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:database", "provider:redisdb", "resource:redis", "team:claranet", "created-by:terraform"], var.hitrate_extra_tags) + tags = concat(local.common_tags, var.tags, var.hitrate_extra_tags) } diff --git a/database/solr/README.md b/database/solr/README.md index 3233d00b..61a714bb 100644 --- a/database/solr/README.md +++ b/database/solr/README.md @@ -53,7 +53,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -85,6 +85,8 @@ Creates DataDog monitors with the following checks: | [searcher\_warmup\_time\_threshold\_critical](#input\_searcher\_warmup\_time\_threshold\_critical) | Searcher warmup time critical threshold in ms | `number` | `5000` | no | | [searcher\_warmup\_time\_threshold\_warning](#input\_searcher\_warmup\_time\_threshold\_warning) | Searcher warmup time warning threshold in ms | `number` | `2000` | no | | [searcher\_warmup\_time\_timeframe](#input\_searcher\_warmup\_time\_timeframe) | Timeframe for the searcher warmup time monitor | `string` | `"last_5m"` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:redisdb",
"resource:redis"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/solr/common-inputs.tf b/database/solr/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/solr/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/solr/common-locals.tf b/database/solr/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/solr/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/solr/inputs.tf b/database/solr/inputs.tf index d0ee7c5a..2f05f8fc 100644 --- a/database/solr/inputs.tf +++ b/database/solr/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:solr", "resource:solr"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/database/solr/monitors-solr.tf b/database/solr/monitors-solr.tf index a184b222..b4e21d2e 100644 --- a/database/solr/monitors-solr.tf +++ b/database/solr/monitors-solr.tf @@ -28,7 +28,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:database", "provider:solr", "resource:solr", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags) + tags = concat(local.common_tags, var.tags, var.not_responding_extra_tags) } @@ -61,7 +61,7 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:solr", "resource:solr", "team:claranet", "created-by:terraform"], var.search_handler_errors_extra_tags) + tags = concat(local.common_tags, var.tags, var.search_handler_errors_extra_tags) } @@ -93,5 +93,5 @@ EOQ require_full_window = true notify_no_data = false - tags = concat(["env:${var.environment}", "type:database", "provider:solr", "resource:solr", "team:claranet", "created-by:terraform"], var.searcher_warmup_time_extra_tags) + tags = concat(local.common_tags, var.tags, var.searcher_warmup_time_extra_tags) } diff --git a/database/sqlserver/README.md b/database/sqlserver/README.md index 8c0a65e2..a5376686 100644 --- a/database/sqlserver/README.md +++ b/database/sqlserver/README.md @@ -49,7 +49,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [sqlserver\_availability\_message](#input\_sqlserver\_availability\_message) | Custom message for SQL Server availability monitor | `string` | `""` | no | | [sqlserver\_availability\_no\_data\_timeframe](#input\_sqlserver\_availability\_no\_data\_timeframe) | SQL Server availability monitor no data timeframe | `string` | `10` | no | | [sqlserver\_availability\_threshold\_warning](#input\_sqlserver\_availability\_threshold\_warning) | SQL Server availability monitor (warning threshold) | `string` | `3` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:solr",
"resource:solr"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/database/sqlserver/common-inputs.tf b/database/sqlserver/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/sqlserver/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/sqlserver/common-locals.tf b/database/sqlserver/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/sqlserver/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/sqlserver/inputs.tf b/database/sqlserver/inputs.tf index e4ba892b..4ea50739 100644 --- a/database/sqlserver/inputs.tf +++ b/database/sqlserver/inputs.tf @@ -1,8 +1,10 @@ -variable "environment" { - description = "Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:sqlserver", "resource:sqlserver"] } +# Global DataDog variable "evaluation_delay" { description = "Delay in seconds for the metric evaluation" default = 15 diff --git a/database/sqlserver/monitors-sqlserver.tf b/database/sqlserver/monitors-sqlserver.tf index 9fff6cb1..c13636f1 100644 --- a/database/sqlserver/monitors-sqlserver.tf +++ b/database/sqlserver/monitors-sqlserver.tf @@ -23,5 +23,5 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:sqlserver", "resource:sqlserver", "team:claranet", "created-by:terraform"], var.sqlserver_availability_extra_tags) + tags = concat(local.common_tags, var.tags, var.sqlserver_availability_extra_tags) } diff --git a/database/zookeeper/README.md b/database/zookeeper/README.md index 7f5d89e3..ceb7961e 100644 --- a/database/zookeeper/README.md +++ b/database/zookeeper/README.md @@ -51,7 +51,7 @@ Creates DataDog monitors with the following checks: | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [environment](#input\_environment) | Architecture environment | `string` | n/a | yes | +| [environment](#input\_environment) | Architecture Environment | `string` | n/a | yes | | [evaluation\_delay](#input\_evaluation\_delay) | Delay in seconds for the metric evaluation | `number` | `15` | no | | [filter\_tags\_custom](#input\_filter\_tags\_custom) | Tags used for custom filtering when filter\_tags\_use\_defaults is false | `string` | `"*"` | no | | [filter\_tags\_custom\_excluded](#input\_filter\_tags\_custom\_excluded) | Tags excluded for custom filtering when filter\_tags\_use\_defaults is false | `string` | `""` | no | @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [not\_responding\_notify\_no\_data](#input\_not\_responding\_notify\_no\_data) | Send notification if not\_responding monitor does not retrieve data | `bool` | `true` | no | | [not\_responding\_threshold\_warning](#input\_not\_responding\_threshold\_warning) | Zookeeper not responding limit (warning threshold) | `number` | `3` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:sqlserver",
"resource:sqlserver"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [zookeeper\_latency\_availability\_extra\_tags](#input\_zookeeper\_latency\_availability\_extra\_tags) | Extra tags for zookeeper read latency monitor | `list(string)` | `[]` | no | | [zookeeper\_latency\_enabled](#input\_zookeeper\_latency\_enabled) | Flag to enable Zookeeper read latency monitor | `string` | `"true"` | no | diff --git a/database/zookeeper/common-inputs.tf b/database/zookeeper/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/database/zookeeper/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/database/zookeeper/common-locals.tf b/database/zookeeper/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/database/zookeeper/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/database/zookeeper/inputs.tf b/database/zookeeper/inputs.tf index e2598a79..87de10d7 100644 --- a/database/zookeeper/inputs.tf +++ b/database/zookeeper/inputs.tf @@ -1,11 +1,10 @@ -# -# Datadog global variables -# -variable "environment" { - description = "Architecture environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:database", "provider:zookeeper", "resource:zookeeper"] } +# Global DataDog variable "filter_tags_use_defaults" { description = "Use default filter tags convention" default = "true" diff --git a/database/zookeeper/monitors-zookeeper.tf b/database/zookeeper/monitors-zookeeper.tf index 7da35576..3b3730e1 100644 --- a/database/zookeeper/monitors-zookeeper.tf +++ b/database/zookeeper/monitors-zookeeper.tf @@ -23,7 +23,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:database", "provider:zookeeper", "resource:zookeeper", "team:claranet", "created-by:terraform"], var.zookeeper_latency_availability_extra_tags) + tags = concat(local.common_tags, var.tags, var.zookeeper_latency_availability_extra_tags) } @@ -52,6 +52,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:database", "provider:zookeeper", "resource:zookeeper", "team:claranet", "created-by:terraform"], var.zookeeper_latency_availability_extra_tags) + tags = concat(local.common_tags, var.tags, var.zookeeper_latency_availability_extra_tags) } diff --git a/middleware/apache/README.md b/middleware/apache/README.md index 0b5c297b..5aef6f03 100644 --- a/middleware/apache/README.md +++ b/middleware/apache/README.md @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:database",
"provider:zookeeper",
"resource:zookeeper"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/middleware/apache/common-inputs.tf b/middleware/apache/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/middleware/apache/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/middleware/apache/common-locals.tf b/middleware/apache/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/middleware/apache/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/middleware/apache/inputs.tf b/middleware/apache/inputs.tf index 25bd2aa1..8e389476 100644 --- a/middleware/apache/inputs.tf +++ b/middleware/apache/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:middleware", "provider:apache", "resource:apache"] } # Global DataDog diff --git a/middleware/apache/monitors-apache.tf b/middleware/apache/monitors-apache.tf index 10128f54..4740e573 100644 --- a/middleware/apache/monitors-apache.tf +++ b/middleware/apache/monitors-apache.tf @@ -23,6 +23,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:middleware", "provider:apache", "resource:apache", "team:claranet", "created-by:terraform"], var.apache_connect_extra_tags) + tags = concat(local.common_tags, var.tags, var.apache_connect_extra_tags) } diff --git a/middleware/kong/README.md b/middleware/kong/README.md index e1e7566d..15648b7d 100644 --- a/middleware/kong/README.md +++ b/middleware/kong/README.md @@ -66,6 +66,8 @@ Creates DataDog monitors with the following checks: | [not\_responding\_threshold\_warning](#input\_not\_responding\_threshold\_warning) | Warning threshold for the service check | `string` | `3` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:middleware",
"provider:apache",
"resource:apache"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [treatment\_limit\_enabled](#input\_treatment\_limit\_enabled) | Flag to enable Kong Treatment Limit monitor | `string` | `"true"` | no | | [treatment\_limit\_extra\_tags](#input\_treatment\_limit\_extra\_tags) | Extra tags for Kong Treatment Limit monitor | `list(string)` | `[]` | no | diff --git a/middleware/kong/common-inputs.tf b/middleware/kong/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/middleware/kong/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/middleware/kong/common-locals.tf b/middleware/kong/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/middleware/kong/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/middleware/kong/inputs.tf b/middleware/kong/inputs.tf index a095a374..fc6c8853 100644 --- a/middleware/kong/inputs.tf +++ b/middleware/kong/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:middleware", "provider:kong", "resource:kong"] } # Global DataDog diff --git a/middleware/kong/monitors-kong.tf b/middleware/kong/monitors-kong.tf index 981c08ed..57d44559 100644 --- a/middleware/kong/monitors-kong.tf +++ b/middleware/kong/monitors-kong.tf @@ -26,7 +26,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:middleware", "provider:kong", "resource:kong", "team:claranet", "created-by:terraform"], var.not_responding_extra_tags) + tags = concat(local.common_tags, var.tags, var.not_responding_extra_tags) } resource "datadog_monitor" "treatment_limit" { @@ -57,6 +57,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:middleware", "provider:kong", "resource:kong", "team:claranet", "created-by:terraform"], var.treatment_limit_extra_tags) + tags = concat(local.common_tags, var.tags, var.treatment_limit_extra_tags) } diff --git a/middleware/nginx/README.md b/middleware/nginx/README.md index 9135d443..147760b8 100644 --- a/middleware/nginx/README.md +++ b/middleware/nginx/README.md @@ -72,6 +72,8 @@ Creates DataDog monitors with the following checks: | [nginx\_dropped\_timeframe](#input\_nginx\_dropped\_timeframe) | Monitor timeframe for Nginx dropped connections [available values: `last_#m` (1, 5, 10, 15, or 30), `last_#h` (1, 2, or 4), or `last_1d`] | `string` | `"last_5m"` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:middleware",
"provider:kong",
"resource:kong"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/middleware/nginx/common-inputs.tf b/middleware/nginx/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/middleware/nginx/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/middleware/nginx/common-locals.tf b/middleware/nginx/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/middleware/nginx/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/middleware/nginx/inputs.tf b/middleware/nginx/inputs.tf index c0894803..5da65ced 100644 --- a/middleware/nginx/inputs.tf +++ b/middleware/nginx/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:middleware", "provider:nginx", "resource:nginx"] } # Global DataDog diff --git a/middleware/nginx/monitors-nginx.tf b/middleware/nginx/monitors-nginx.tf index 5878c2b5..9532c1cc 100644 --- a/middleware/nginx/monitors-nginx.tf +++ b/middleware/nginx/monitors-nginx.tf @@ -23,7 +23,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform"], var.nginx_connect_extra_tags) + tags = concat(local.common_tags, var.tags, var.nginx_connect_extra_tags) } resource "datadog_monitor" "datadog_nginx_dropped_connections" { @@ -51,6 +51,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:middleware", "provider:nginx", "resource:nginx", "team:claranet", "created-by:terraform"], var.nginx_dropped_extra_tags) + tags = concat(local.common_tags, var.tags, var.nginx_dropped_extra_tags) } diff --git a/middleware/php-fpm/README.md b/middleware/php-fpm/README.md index 6e968485..7cc1b669 100644 --- a/middleware/php-fpm/README.md +++ b/middleware/php-fpm/README.md @@ -73,6 +73,8 @@ Creates DataDog monitors with the following checks: | [php\_fpm\_connect\_no\_data\_timeframe](#input\_php\_fpm\_connect\_no\_data\_timeframe) | PHP FPM status monitor no data timeframe | `string` | `10` | no | | [php\_fpm\_connect\_threshold\_warning](#input\_php\_fpm\_connect\_threshold\_warning) | PHP FPM status monitor (warning threshold) | `string` | `3` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:middleware",
"provider:nginx",
"resource:nginx"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/middleware/php-fpm/common-inputs.tf b/middleware/php-fpm/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/middleware/php-fpm/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/middleware/php-fpm/common-locals.tf b/middleware/php-fpm/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/middleware/php-fpm/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/middleware/php-fpm/inputs.tf b/middleware/php-fpm/inputs.tf index af7a829f..59229142 100644 --- a/middleware/php-fpm/inputs.tf +++ b/middleware/php-fpm/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:middleware", "provider:php-fpm", "resource:php-fpm"] } # Global DataDog diff --git a/middleware/php-fpm/monitors-fpm.tf b/middleware/php-fpm/monitors-fpm.tf index ce41b7a0..f9ba9ab6 100644 --- a/middleware/php-fpm/monitors-fpm.tf +++ b/middleware/php-fpm/monitors-fpm.tf @@ -23,7 +23,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:middleware", "provider:php-fpm", "resource:php-fpm", "team:claranet", "created-by:terraform"], var.php_fpm_connect_extra_tags) + tags = concat(local.common_tags, var.tags, var.php_fpm_connect_extra_tags) } resource "datadog_monitor" "php_fpm_connect_idle" { @@ -54,6 +54,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:middleware", "provider:php-fpm", "resource:php-fpm", "team:claranet", "created-by:terraform"], var.php_fpm_busy_extra_tags) + tags = concat(local.common_tags, var.tags, var.php_fpm_busy_extra_tags) } diff --git a/network/dns/README.md b/network/dns/README.md index 0a4f0d66..01c573e9 100644 --- a/network/dns/README.md +++ b/network/dns/README.md @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:middleware",
"provider:php-fpm",
"resource:php-fpm"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/network/dns/common-inputs.tf b/network/dns/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/network/dns/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/network/dns/common-locals.tf b/network/dns/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/network/dns/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/network/dns/inputs.tf b/network/dns/inputs.tf index ab1293d9..190aa7af 100644 --- a/network/dns/inputs.tf +++ b/network/dns/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:network", "provider:dns_check", "resource:dns"] } # Global DataDog diff --git a/network/dns/monitors-dns.tf b/network/dns/monitors-dns.tf index 7603e83c..ed209af2 100644 --- a/network/dns/monitors-dns.tf +++ b/network/dns/monitors-dns.tf @@ -26,5 +26,5 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:network", "provider:dns_check", "resource:dns", "team:claranet", "created-by:terraform"], var.cannot_resolve_extra_tags) + tags = concat(local.common_tags, var.tags, var.cannot_resolve_extra_tags) } \ No newline at end of file diff --git a/network/http/ssl/README.md b/network/http/ssl/README.md index 05deb777..c4ebb425 100644 --- a/network/http/ssl/README.md +++ b/network/http/ssl/README.md @@ -73,6 +73,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:network",
"provider:dns_check",
"resource:dns"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/network/http/ssl/common-inputs.tf b/network/http/ssl/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/network/http/ssl/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/network/http/ssl/common-locals.tf b/network/http/ssl/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/network/http/ssl/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/network/http/ssl/inputs.tf b/network/http/ssl/inputs.tf index 00ebdcd3..db0b2264 100644 --- a/network/http/ssl/inputs.tf +++ b/network/http/ssl/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:network", "provider:http_check", "resource:ssl-certificate"] } # Global DataDog diff --git a/network/http/ssl/monitors-ssl.tf b/network/http/ssl/monitors-ssl.tf index 87b7b718..4a301db4 100644 --- a/network/http/ssl/monitors-ssl.tf +++ b/network/http/ssl/monitors-ssl.tf @@ -26,7 +26,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:network", "provider:http_check", "resource:ssl-certificate", "team:claranet", "created-by:terraform"], var.invalid_ssl_certificate_extra_tags) + tags = concat(local.common_tags, var.tags, var.invalid_ssl_certificate_extra_tags) } # @@ -59,5 +59,5 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:network", "provider:http_check", "resource:ssl-certificate", "team:claranet", "created-by:terraform"], var.certificate_expiration_date_extra_tags) + tags = concat(local.common_tags, var.tags, var.certificate_expiration_date_extra_tags) } \ No newline at end of file diff --git a/network/http/webcheck/README.md b/network/http/webcheck/README.md index 2495c620..bd347caa 100644 --- a/network/http/webcheck/README.md +++ b/network/http/webcheck/README.md @@ -64,6 +64,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:network",
"provider:http_check",
"resource:ssl-certificate"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/network/http/webcheck/common-inputs.tf b/network/http/webcheck/common-inputs.tf new file mode 120000 index 00000000..063966bb --- /dev/null +++ b/network/http/webcheck/common-inputs.tf @@ -0,0 +1 @@ +../../../common/module/inputs.tf \ No newline at end of file diff --git a/network/http/webcheck/common-locals.tf b/network/http/webcheck/common-locals.tf new file mode 120000 index 00000000..355a2a7b --- /dev/null +++ b/network/http/webcheck/common-locals.tf @@ -0,0 +1 @@ +../../../common/module/locals.tf \ No newline at end of file diff --git a/network/http/webcheck/inputs.tf b/network/http/webcheck/inputs.tf index 18768dd4..d34a3d92 100644 --- a/network/http/webcheck/inputs.tf +++ b/network/http/webcheck/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:network", "provider:http_check", "resource:webcheck"] } # Global DataDog diff --git a/network/http/webcheck/monitors-webcheck.tf b/network/http/webcheck/monitors-webcheck.tf index 10f09eb4..031b9dfc 100644 --- a/network/http/webcheck/monitors-webcheck.tf +++ b/network/http/webcheck/monitors-webcheck.tf @@ -26,5 +26,5 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:network", "provider:http_check", "resource:webcheck", "team:claranet", "created-by:terraform"], var.cannot_connect_extra_tags) + tags = concat(local.common_tags, var.tags, var.cannot_connect_extra_tags) } diff --git a/network/tls/README.md b/network/tls/README.md index acb7517c..8ec545c1 100644 --- a/network/tls/README.md +++ b/network/tls/README.md @@ -81,6 +81,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:network",
"provider:http_check",
"resource:webcheck"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [tls\_certificate\_expiration\_enabled](#input\_tls\_certificate\_expiration\_enabled) | Flag to enable TLS certificate expiration monitor | `string` | `"true"` | no | | [tls\_certificate\_expiration\_extra\_tags](#input\_tls\_certificate\_expiration\_extra\_tags) | Extra tags for TLS certificate expiration monitor | `list(string)` | `[]` | no | diff --git a/network/tls/common-inputs.tf b/network/tls/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/network/tls/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/network/tls/common-locals.tf b/network/tls/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/network/tls/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/network/tls/inputs.tf b/network/tls/inputs.tf index 6571b7ff..dfc9b9c6 100644 --- a/network/tls/inputs.tf +++ b/network/tls/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:network", "provider:tls", "resource:webcheck"] } # Global DataDog diff --git a/network/tls/monitors-tls.tf b/network/tls/monitors-tls.tf index 9c1725bc..98cd6026 100644 --- a/network/tls/monitors-tls.tf +++ b/network/tls/monitors-tls.tf @@ -26,7 +26,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:network", "provider:tls", "resource:webcheck", "team:claranet", "created-by:terraform"], var.cannot_connect_extra_tags) + tags = concat(local.common_tags, var.tags, var.cannot_connect_extra_tags) } # @@ -56,7 +56,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:network", "provider:tls", "resource:tls-certificate", "team:claranet", "created-by:terraform"], var.invalid_tls_certificate_extra_tags) + tags = concat(local.common_tags, var.tags, var.invalid_tls_certificate_extra_tags) } # @@ -86,7 +86,7 @@ EOQ require_full_window = true renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:network", "provider:tls", "resource:tls-certificate", "team:claranet", "created-by:terraform"], var.tls_certificate_expiration_extra_tags) + tags = concat(local.common_tags, var.tags, var.tls_certificate_expiration_extra_tags) } # @@ -120,5 +120,5 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:network", "provider:tls", "resource:tls-certificate", "team:claranet", "created-by:terraform"], var.certificate_expiration_date_extra_tags) + tags = concat(local.common_tags, var.tags, var.certificate_expiration_date_extra_tags) } \ No newline at end of file diff --git a/saas/new-relic/README.md b/saas/new-relic/README.md index d0d777eb..c4f975b7 100644 --- a/saas/new-relic/README.md +++ b/saas/new-relic/README.md @@ -75,6 +75,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:network",
"provider:tls",
"resource:webcheck"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/saas/new-relic/common-inputs.tf b/saas/new-relic/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/saas/new-relic/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/saas/new-relic/common-locals.tf b/saas/new-relic/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/saas/new-relic/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/saas/new-relic/inputs.tf b/saas/new-relic/inputs.tf index 8cd15992..d1cfa2b6 100644 --- a/saas/new-relic/inputs.tf +++ b/saas/new-relic/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:saas", "provider:new-relic", "resource:new-relic"] } # Global DataDog diff --git a/saas/new-relic/monitors-new-relic.tf b/saas/new-relic/monitors-new-relic.tf index 54daeace..240cb044 100644 --- a/saas/new-relic/monitors-new-relic.tf +++ b/saas/new-relic/monitors-new-relic.tf @@ -25,7 +25,7 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:saas", "provider:new-relic", "resource:new-relic", "team:claranet", "created-by:terraform"], var.app_error_rate_extra_tags) + tags = concat(local.common_tags, var.tags, var.app_error_rate_extra_tags) } resource "datadog_monitor" "app_apdex_score" { @@ -55,5 +55,5 @@ EOQ include_tags = true require_full_window = false - tags = concat(["env:${var.environment}", "type:saas", "provider:new-relic", "resource:new-relic", "team:claranet", "created-by:terraform"], var.app_apdex_score_extra_tags) + tags = concat(local.common_tags, var.tags, var.app_apdex_score_extra_tags) } diff --git a/scripts b/scripts index 06f6797a..7487d47c 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 06f6797a48e2e15c9ad4725ade196e4f79a46b96 +Subproject commit 7487d47ce346a82a33676f189104e583e86230b8 diff --git a/system/generic/README.md b/system/generic/README.md index 3f861b1d..0d5a4ed8 100644 --- a/system/generic/README.md +++ b/system/generic/README.md @@ -121,6 +121,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:saas",
"provider:new-relic",
"resource:new-relic"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | ## Outputs diff --git a/system/generic/common-inputs.tf b/system/generic/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/system/generic/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/system/generic/common-locals.tf b/system/generic/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/system/generic/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/system/generic/inputs.tf b/system/generic/inputs.tf index b58990d5..d5ee13cd 100644 --- a/system/generic/inputs.tf +++ b/system/generic/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:system", "resource:generic"] } # Global DataDog diff --git a/system/generic/monitors-system.tf b/system/generic/monitors-system.tf index 6fac36e0..4caec695 100644 --- a/system/generic/monitors-system.tf +++ b/system/generic/monitors-system.tf @@ -24,7 +24,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform"], var.cpu_extra_tags) + tags = concat(local.common_tags, var.tags, ["provider:system-check"], var.cpu_extra_tags) } resource "datadog_monitor" "load" { @@ -53,7 +53,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:system", "provider:system-core", "resource:generic", "team:claranet", "created-by:terraform"], var.load_extra_tags) + tags = concat(local.common_tags, var.tags, ["provider:system-core"], var.load_extra_tags) } resource "datadog_monitor" "disk_space" { @@ -82,7 +82,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform"], var.disk_space_extra_tags) + tags = concat(local.common_tags, var.tags, ["provider:disk"], var.disk_space_extra_tags) } resource "datadog_monitor" "disk_space_forecast" { @@ -118,7 +118,7 @@ EOQ notify_no_data = false renotify_interval = 0 - tags = concat(["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform"], var.disk_space_forecast_extra_tags) + tags = concat(local.common_tags, var.tags, ["provider:disk"], var.disk_space_forecast_extra_tags) } resource "datadog_monitor" "disk_inodes" { @@ -147,7 +147,7 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:system", "provider:disk", "resource:generic", "team:claranet", "created-by:terraform"], var.disk_inodes_extra_tags) + tags = concat(local.common_tags, var.tags, ["provider:disk"], var.disk_inodes_extra_tags) } resource "datadog_monitor" "memory" { @@ -178,6 +178,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:system", "provider:system-check", "resource:generic", "team:claranet", "created-by:terraform"], var.memory_extra_tags) + tags = concat(local.common_tags, var.tags, ["provider:system-check"], var.memory_extra_tags) } diff --git a/system/unreachable/README.md b/system/unreachable/README.md index cf17a26f..f32afad7 100644 --- a/system/unreachable/README.md +++ b/system/unreachable/README.md @@ -59,6 +59,8 @@ Creates DataDog monitors with the following checks: | [new\_host\_delay](#input\_new\_host\_delay) | Delay in seconds before monitor new resource | `number` | `300` | no | | [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no | | [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no | +| [tags](#input\_tags) | Global variables | `list(string)` |
"type:system",
"resource:generic"
]
[| no | +| [team](#input\_team) | n/a | `string` | `"claranet"` | no | | [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no | | [unreachable\_enabled](#input\_unreachable\_enabled) | Flag to enable Host unreachable monitor | `string` | `"true"` | no | | [unreachable\_extra\_tags](#input\_unreachable\_extra\_tags) | Extra tags for Host unreachable monitor | `list(string)` | `[]` | no | diff --git a/system/unreachable/common-inputs.tf b/system/unreachable/common-inputs.tf new file mode 120000 index 00000000..8ef8e9d8 --- /dev/null +++ b/system/unreachable/common-inputs.tf @@ -0,0 +1 @@ +../../common/module/inputs.tf \ No newline at end of file diff --git a/system/unreachable/common-locals.tf b/system/unreachable/common-locals.tf new file mode 120000 index 00000000..5672d21a --- /dev/null +++ b/system/unreachable/common-locals.tf @@ -0,0 +1 @@ +../../common/module/locals.tf \ No newline at end of file diff --git a/system/unreachable/inputs.tf b/system/unreachable/inputs.tf index 6cf091c0..122dfa58 100644 --- a/system/unreachable/inputs.tf +++ b/system/unreachable/inputs.tf @@ -1,7 +1,7 @@ -# Global Terraform -variable "environment" { - description = "Architecture Environment" - type = string +# Global variables +variable "tags" { + type = list(string) + default = ["type:system", "provider:host", "resource:unreachable"] } # Global DataDog diff --git a/system/unreachable/monitors-unreachable.tf b/system/unreachable/monitors-unreachable.tf index a4033a94..6937ce35 100644 --- a/system/unreachable/monitors-unreachable.tf +++ b/system/unreachable/monitors-unreachable.tf @@ -23,6 +23,6 @@ EOQ include_tags = true require_full_window = true - tags = concat(["env:${var.environment}", "type:system", "provider:host", "resource:unreachable", "team:claranet", "created-by:terraform"], var.unreachable_extra_tags) + tags = concat(local.common_tags, var.tags, var.unreachable_extra_tags) }
"type:system",
"provider:host",
"resource:unreachable"
]