Skip to content

Commit

Permalink
test on docker
Browse files Browse the repository at this point in the history
  • Loading branch information
Aohzan committed Oct 6, 2023
1 parent cf8c7cf commit 2791a98
Show file tree
Hide file tree
Showing 7 changed files with 74 additions and 54 deletions.
2 changes: 2 additions & 0 deletions caas/docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,8 @@ Creates DataDog monitors with the following checks:
| <a name="input_not_responding_threshold_warning"></a> [not\_responding\_threshold\_warning](#input\_not\_responding\_threshold\_warning) | Docker does not respond monitor (warning threshold) | `string` | `3` | no |
| <a name="input_notify_no_data"></a> [notify\_no\_data](#input\_notify\_no\_data) | Will raise no data alert if set to true | `bool` | `true` | no |
| <a name="input_prefix_slug"></a> [prefix\_slug](#input\_prefix\_slug) | Prefix string to prepend between brackets on every monitors names | `string` | `""` | no |
| <a name="input_tags"></a> [tags](#input\_tags) | Global terraform | `list(string)` | <pre>[<br> "type:docker",<br> "provider:docker",<br> "resource:docker"<br>]</pre> | no |
| <a name="input_team"></a> [team](#input\_team) | n/a | `string` | `"claranet"` | no |
| <a name="input_timeout_h"></a> [timeout\_h](#input\_timeout\_h) | Default auto-resolving state (in hours) | `number` | `0` | no |

## Outputs
Expand Down
1 change: 1 addition & 0 deletions caas/docker/common-inputs.tf
1 change: 1 addition & 0 deletions caas/docker/common-locals.tf
57 changes: 5 additions & 52 deletions caas/docker/inputs.tf
Original file line number Diff line number Diff line change
@@ -1,58 +1,11 @@
# Global Terraform
variable "environment" {
description = "Architecture Environment"
type = string
}

# Global DataDog
variable "evaluation_delay" {
description = "Delay in seconds for the metric evaluation"
default = 15
}

variable "new_host_delay" {
description = "Delay in seconds before monitor new resource"
default = 300
}

variable "new_group_delay" {
description = "Delay in seconds before monitor new resource"
default = 300
}

variable "timeout_h" {
description = "Default auto-resolving state (in hours)"
default = 0
}

variable "prefix_slug" {
description = "Prefix string to prepend between brackets on every monitors names"
default = ""
}

variable "notify_no_data" {
description = "Will raise no data alert if set to true"
default = true
}
# Global variables

variable "message" {
description = "Message sent when an alert is triggered"
variable "tags" {
type = list(string)
default = ["type:docker", "provider:docker", "resource:docker"]
}

variable "filter_tags_use_defaults" {
description = "Use default filter tags convention"
default = "true"
}

variable "filter_tags_custom" {
description = "Tags used for custom filtering when filter_tags_use_defaults is false"
default = "*"
}

variable "filter_tags_custom_excluded" {
description = "Tags excluded for custom filtering when filter_tags_use_defaults is false"
default = ""
}
# Datadog monitors variables

#
# Not Responding
Expand Down
4 changes: 2 additions & 2 deletions caas/docker/monitors-docker.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down Expand Up @@ -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)
}

60 changes: 60 additions & 0 deletions common/module/inputs.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# Global Terraform
variable "environment" {
description = "Architecture Environment"
type = string
}

variable "team" {
type = string
default = "claranet"
}

# Global DataDog
variable "evaluation_delay" {
description = "Delay in seconds for the metric evaluation"
default = 15
}

variable "new_host_delay" {
description = "Delay in seconds before monitor new resource"
default = 300
}

variable "new_group_delay" {
description = "Delay in seconds before monitor new resource"
default = 300
}

variable "timeout_h" {
description = "Default auto-resolving state (in hours)"
default = 0
}

variable "prefix_slug" {
description = "Prefix string to prepend between brackets on every monitors names"
default = ""
}

variable "notify_no_data" {
description = "Will raise no data alert if set to true"
default = true
}

variable "message" {
description = "Message sent when an alert is triggered"
}

variable "filter_tags_use_defaults" {
description = "Use default filter tags convention"
default = "true"
}

variable "filter_tags_custom" {
description = "Tags used for custom filtering when filter_tags_use_defaults is false"
default = "*"
}

variable "filter_tags_custom_excluded" {
description = "Tags excluded for custom filtering when filter_tags_use_defaults is false"
default = ""
}
3 changes: 3 additions & 0 deletions common/module/locals.tf
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
locals {
common_tags = ["env:${var.environment}", "team:${var.team}", "created-by:terraform"]
}

0 comments on commit 2791a98

Please sign in to comment.