diff --git a/README.md b/README.md index c8c60ca..7bb9987 100644 --- a/README.md +++ b/README.md @@ -29,7 +29,7 @@ git config core.hooksPath githooks | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | -| [aws](#requirement\_aws) | ~>4.50 | +| [aws](#requirement\_aws) | >= 4.50, < 6.0 | ## Providers @@ -41,7 +41,7 @@ No providers. |------|--------|---------| | [alerts](#module\_alerts) | ./modules/alerts/ | n/a | | [alerts\_slo\_sli\_sla](#module\_alerts\_slo\_sli\_sla) | ./modules/alerts/ | n/a | -| [aws\_cloudwatch\_log\_metric\_filter](#module\_aws\_cloudwatch\_log\_metric\_filter) | dasmeta/modules/aws//modules/cloudwatch-log-metric | 1.7.0 | +| [aws\_cloudwatch\_log\_metric\_filter](#module\_aws\_cloudwatch\_log\_metric\_filter) | ./modules/cloudwatch-log-based-metrics | n/a | | [eks\_monitoring\_dashboard](#module\_eks\_monitoring\_dashboard) | ./modules/dashboard/ | n/a | | [health-check](#module\_health-check) | ./modules/alerts/ | n/a | | [monitoring\_dashboard](#module\_monitoring\_dashboard) | ./modules/dashboard/ | n/a | @@ -62,7 +62,7 @@ No resources. | [enable\_log\_base\_metrics](#input\_enable\_log\_base\_metrics) | n/a | `bool` | `true` | no | | [expression\_alert](#input\_expression\_alert) | Add multiple metrics in one alert and add expression. | `any` | `{}` | no | | [health\_checks](#input\_health\_checks) | Health\_checks endpoints and paths | `any` | `[]` | no | -| [log\_base\_metrics](#input\_log\_base\_metrics) | Log Base Metrics | `any` | `[]` | no | +| [log\_base\_metrics](#input\_log\_base\_metrics) | Log Base Metrics creation configuration |
list(object({
name = string
pattern = string
log_group_name = string
unit = optional(string, "None")
dimensions = optional(any, {})
value = optional(string, "1")
default_value = optional(string, "0")
}))
| `[]` | no | | [name](#input\_name) | Dashboard name | `string` | n/a | yes | | [region](#input\_region) | The region where resources should be managed. In this repository it's secondary because IAM is always global. | `string` | `"eu-central-1"` | no | | [sns\_topic\_name](#input\_sns\_topic\_name) | SNS topic name | `string` | `"cloudwatch-alarm"` | no | diff --git a/log-base-metrics.tf b/log-base-metrics.tf index e8cac6e..fa03485 100644 --- a/log-base-metrics.tf +++ b/log-base-metrics.tf @@ -1,12 +1,5 @@ module "aws_cloudwatch_log_metric_filter" { - source = "dasmeta/modules/aws//modules/cloudwatch-log-metric" - version = "1.7.0" + source = "./modules/cloudwatch-log-based-metrics" - for_each = { for item in var.log_base_metrics : item.name => item if var.enable_log_base_metrics } - - name = each.value.name - filter_pattern = each.value.filter - create_log_group = lookup(each.value, "create_log_group", false) - log_group_name = each.value.log_group_name - metric_name = each.value.name + metrics_patterns = var.log_base_metrics } diff --git a/modules/alerts/tests/insufficient-data-filled-alerts/README.md b/modules/alerts/tests/insufficient-data-filled-alerts/README.md index b74f53a..a074283 100644 --- a/modules/alerts/tests/insufficient-data-filled-alerts/README.md +++ b/modules/alerts/tests/insufficient-data-filled-alerts/README.md @@ -11,7 +11,7 @@ | Name | Version | |------|---------| -| [aws](#provider\_aws) | 4.67.0 | +| [aws](#provider\_aws) | ~> 4.33 | ## Modules diff --git a/modules/cloudwatch-log-based-metrics/README.md b/modules/cloudwatch-log-based-metrics/README.md index 6e793bf..20f21a3 100644 --- a/modules/cloudwatch-log-based-metrics/README.md +++ b/modules/cloudwatch-log-based-metrics/README.md @@ -43,9 +43,9 @@ No modules. | Name | Description | Type | Default | Required | |------|-------------|------|---------|:--------:| -| [log\_group\_name](#input\_log\_group\_name) | The name of cloudwatch log group on which the metric filters will apply | `string` | n/a | yes | +| [log\_group\_name](#input\_log\_group\_name) | The name of cloudwatch log group on which the metric filters will apply, one of var.log\_group\_name or var.metrics\_patterns.*.log\_group\_name is required | `string` | `null` | no | | [metrics\_namespace](#input\_metrics\_namespace) | The namespace of cloudwatch metric | `string` | `"LogBasedMetrics"` | no | -| [metrics\_patterns](#input\_metrics\_patterns) | The configurations of log based metric filtration |
list(object({
name = string
pattern = string
unit = optional(string, "None")
dimensions = optional(any, {})
value = optional(string, "1")
default_value = optional(string, "0")
}))
| `[]` | no | +| [metrics\_patterns](#input\_metrics\_patterns) | The configurations of log based metric filtration, one of var.log\_group\_name or var.metrics\_patterns.*.log\_group\_name is required |
list(object({
name = string
pattern = string
unit = optional(string, "None")
dimensions = optional(any, {})
value = optional(string, "1")
default_value = optional(string, "0")
log_group_name = optional(string, null)
}))
| `[]` | no | ## Outputs diff --git a/modules/cloudwatch-log-based-metrics/main.tf b/modules/cloudwatch-log-based-metrics/main.tf index aeb513f..e70204a 100644 --- a/modules/cloudwatch-log-based-metrics/main.tf +++ b/modules/cloudwatch-log-based-metrics/main.tf @@ -3,7 +3,7 @@ resource "aws_cloudwatch_log_metric_filter" "metric_filter" { name = each.value.name pattern = each.value.pattern - log_group_name = var.log_group_name + log_group_name = coalesce(each.value.log_group_name, var.log_group_name) metric_transformation { name = each.value.name diff --git a/modules/cloudwatch-log-based-metrics/variables.tf b/modules/cloudwatch-log-based-metrics/variables.tf index 9f8e094..393a5ea 100644 --- a/modules/cloudwatch-log-based-metrics/variables.tf +++ b/modules/cloudwatch-log-based-metrics/variables.tf @@ -1,19 +1,21 @@ variable "log_group_name" { type = string - description = "The name of cloudwatch log group on which the metric filters will apply" + description = "The name of cloudwatch log group on which the metric filters will apply, one of var.log_group_name or var.metrics_patterns.*.log_group_name is required" + default = null } variable "metrics_patterns" { type = list(object({ - name = string - pattern = string - unit = optional(string, "None") - dimensions = optional(any, {}) - value = optional(string, "1") - default_value = optional(string, "0") + name = string + pattern = string + unit = optional(string, "None") + dimensions = optional(any, {}) + value = optional(string, "1") + default_value = optional(string, "0") + log_group_name = optional(string, null) })) default = [] - description = "The configurations of log based metric filtration" + description = "The configurations of log based metric filtration, one of var.log_group_name or var.metrics_patterns.*.log_group_name is required" } variable "metrics_namespace" { diff --git a/modules/dashboard/README.md b/modules/dashboard/README.md index c6f3550..c9cc7e4 100644 --- a/modules/dashboard/README.md +++ b/modules/dashboard/README.md @@ -111,14 +111,14 @@ module "this" { | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.3.0 | -| [aws](#requirement\_aws) | ~> 4.3 | +| [aws](#requirement\_aws) | >= 4.3, < 6.0 | | [random](#requirement\_random) | >= 3.4.3 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.3 | +| [aws](#provider\_aws) | >= 4.3, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/2xx/README.md b/modules/dashboard/modules/widgets/balancer/2xx/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/2xx/README.md +++ b/modules/dashboard/modules/widgets/balancer/2xx/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/2xx/versions.tf b/modules/dashboard/modules/widgets/balancer/2xx/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/2xx/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/2xx/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/4xx/README.md b/modules/dashboard/modules/widgets/balancer/4xx/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/4xx/README.md +++ b/modules/dashboard/modules/widgets/balancer/4xx/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/4xx/versions.tf b/modules/dashboard/modules/widgets/balancer/4xx/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/4xx/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/4xx/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/5xx/README.md b/modules/dashboard/modules/widgets/balancer/5xx/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/5xx/README.md +++ b/modules/dashboard/modules/widgets/balancer/5xx/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/5xx/versions.tf b/modules/dashboard/modules/widgets/balancer/5xx/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/5xx/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/5xx/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/all-requests/README.md b/modules/dashboard/modules/widgets/balancer/all-requests/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/all-requests/README.md +++ b/modules/dashboard/modules/widgets/balancer/all-requests/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/all-requests/versions.tf b/modules/dashboard/modules/widgets/balancer/all-requests/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/all-requests/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/all-requests/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/connection-issues/README.md b/modules/dashboard/modules/widgets/balancer/connection-issues/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/connection-issues/README.md +++ b/modules/dashboard/modules/widgets/balancer/connection-issues/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/connection-issues/versions.tf b/modules/dashboard/modules/widgets/balancer/connection-issues/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/connection-issues/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/connection-issues/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/error-rate/README.md b/modules/dashboard/modules/widgets/balancer/error-rate/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/error-rate/README.md +++ b/modules/dashboard/modules/widgets/balancer/error-rate/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/error-rate/versions.tf b/modules/dashboard/modules/widgets/balancer/error-rate/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/error-rate/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/error-rate/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/request-count/README.md b/modules/dashboard/modules/widgets/balancer/request-count/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/request-count/README.md +++ b/modules/dashboard/modules/widgets/balancer/request-count/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/request-count/versions.tf b/modules/dashboard/modules/widgets/balancer/request-count/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/request-count/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/request-count/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/requests/README.md b/modules/dashboard/modules/widgets/balancer/requests/README.md index ed41415..58b9b25 100644 --- a/modules/dashboard/modules/widgets/balancer/requests/README.md +++ b/modules/dashboard/modules/widgets/balancer/requests/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/requests/versions.tf b/modules/dashboard/modules/widgets/balancer/requests/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/requests/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/requests/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/response-time/README.md b/modules/dashboard/modules/widgets/balancer/response-time/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/response-time/README.md +++ b/modules/dashboard/modules/widgets/balancer/response-time/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/response-time/versions.tf b/modules/dashboard/modules/widgets/balancer/response-time/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/response-time/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/response-time/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/traffic/README.md b/modules/dashboard/modules/widgets/balancer/traffic/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/traffic/README.md +++ b/modules/dashboard/modules/widgets/balancer/traffic/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/traffic/versions.tf b/modules/dashboard/modules/widgets/balancer/traffic/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/traffic/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/traffic/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/README.md b/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/README.md index 83171fc..5b7da81 100644 --- a/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/README.md +++ b/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/versions.tf b/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/versions.tf +++ b/modules/dashboard/modules/widgets/balancer/unhealthy-request-count/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/cloudfront/error-rate/README.md b/modules/dashboard/modules/widgets/cloudfront/error-rate/README.md index d44900d..4ce2b6e 100644 --- a/modules/dashboard/modules/widgets/cloudfront/error-rate/README.md +++ b/modules/dashboard/modules/widgets/cloudfront/error-rate/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,7 +46,7 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers diff --git a/modules/dashboard/modules/widgets/cloudfront/error-rate/versions.tf b/modules/dashboard/modules/widgets/cloudfront/error-rate/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/cloudfront/error-rate/versions.tf +++ b/modules/dashboard/modules/widgets/cloudfront/error-rate/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/cloudfront/errors/README.md b/modules/dashboard/modules/widgets/cloudfront/errors/README.md index d44900d..4ce2b6e 100644 --- a/modules/dashboard/modules/widgets/cloudfront/errors/README.md +++ b/modules/dashboard/modules/widgets/cloudfront/errors/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,7 +46,7 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers diff --git a/modules/dashboard/modules/widgets/cloudfront/errors/versions.tf b/modules/dashboard/modules/widgets/cloudfront/errors/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/cloudfront/errors/versions.tf +++ b/modules/dashboard/modules/widgets/cloudfront/errors/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/cloudfront/requests/README.md b/modules/dashboard/modules/widgets/cloudfront/requests/README.md index d44900d..4ce2b6e 100644 --- a/modules/dashboard/modules/widgets/cloudfront/requests/README.md +++ b/modules/dashboard/modules/widgets/cloudfront/requests/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,7 +46,7 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers diff --git a/modules/dashboard/modules/widgets/cloudfront/requests/versions.tf b/modules/dashboard/modules/widgets/cloudfront/requests/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/cloudfront/requests/versions.tf +++ b/modules/dashboard/modules/widgets/cloudfront/requests/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/README.md b/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/README.md index d44900d..4ce2b6e 100644 --- a/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/README.md +++ b/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,7 +46,7 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers diff --git a/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/versions.tf b/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/versions.tf +++ b/modules/dashboard/modules/widgets/cloudfront/traffic-bytes/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/modules/widgets/sla-slo-sli/README.md b/modules/dashboard/modules/widgets/sla-slo-sli/README.md index d09f703..966ca01 100644 --- a/modules/dashboard/modules/widgets/sla-slo-sli/README.md +++ b/modules/dashboard/modules/widgets/sla-slo-sli/README.md @@ -4,13 +4,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules @@ -46,13 +46,13 @@ | Name | Version | |------|---------| | [terraform](#requirement\_terraform) | >= 1.0 | -| [aws](#requirement\_aws) | ~> 4.30 | +| [aws](#requirement\_aws) | >= 4.30, < 6.0 | ## Providers | Name | Version | |------|---------| -| [aws](#provider\_aws) | ~> 4.30 | +| [aws](#provider\_aws) | >= 4.30, < 6.0 | ## Modules diff --git a/modules/dashboard/modules/widgets/sla-slo-sli/versions.tf b/modules/dashboard/modules/widgets/sla-slo-sli/versions.tf index 112f580..0c1f130 100644 --- a/modules/dashboard/modules/widgets/sla-slo-sli/versions.tf +++ b/modules/dashboard/modules/widgets/sla-slo-sli/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.30" + version = ">= 4.30, < 6.0" } } } diff --git a/modules/dashboard/versions.tf b/modules/dashboard/versions.tf index 098eed0..a4518b1 100644 --- a/modules/dashboard/versions.tf +++ b/modules/dashboard/versions.tf @@ -4,7 +4,7 @@ terraform { required_providers { aws = { source = "hashicorp/aws" - version = "~> 4.3" + version = ">= 4.3, < 6.0" } # grafana = { diff --git a/tests/base/0-setup.tf b/tests/base/0-setup.tf index 6034c39..fddf290 100644 --- a/tests/base/0-setup.tf +++ b/tests/base/0-setup.tf @@ -1,12 +1,8 @@ terraform { required_providers { - # test = { - # source = "terraform.io/builtin/test" - # } - aws = { source = "hashicorp/aws" - version = "~> 4.33" + version = "= 4.59" } } } @@ -19,3 +15,28 @@ provider "aws" { region = "us-east-1" alias = "virginia" } + +# get region default vpc and its public subnets +data "aws_vpc" "default" { + default = true + provider = aws +} + +data "aws_subnets" "default" { + filter { + name = "vpc-id" + values = [data.aws_vpc.default.id] + } +} + +# create test alb +resource "aws_lb" "test" { + name = "test-dashboard-alb" + provider = aws + subnets = data.aws_subnets.default.ids +} + +# create test log group +resource "aws_cloudwatch_log_group" "test" { + name = "test-dashboard-log-group" +} diff --git a/tests/base/1-example.tf b/tests/base/1-example.tf index f41700e..ec7e2a5 100644 --- a/tests/base/1-example.tf +++ b/tests/base/1-example.tf @@ -1,12 +1,8 @@ module "this" { - source = "../../" - name = "dev" - sns_topic_name = "alarm-dev" - webhook_url = "" - application_channel_webhook_url = "" - enable_log_base_metrics = true - fallback_email_addresses = [] - fallback_phone_numbers = [] + source = "../../" + name = "dev" + sns_topic_name = "alarm-dev" + enable_log_base_metrics = true health_checks = [ { host = "dasmeta.com" @@ -16,8 +12,8 @@ module "this" { log_base_metrics = [ { name = "container_exception_error_fail_crash_critical" - filter = "{$.log = *error* || $.log = *fail* || $.log = *crash* || $.log = *critical* || $.log = *exception*}" - log_group_name = "eks-dev" + pattern = "{$.log = *error* || $.log = *fail* || $.log = *crash* || $.log = *critical* || $.log = *exception*}" + log_group_name = aws_cloudwatch_log_group.test.name }, ] application_channel_alerts = [ @@ -59,7 +55,7 @@ module "this" { width = 24 height = 8 type = "sla-slo-sli", - balancer_name = "alb-dev" + balancer_name = aws_lb.test.name region = "eu-central-1" } ], @@ -68,4 +64,6 @@ module "this" { aws = aws aws.virginia = aws.virginia } + + depends_on = [aws_cloudwatch_log_group.test, aws_lb.test] } diff --git a/tests/base/2-assert.tf b/tests/base/2-assert.tf deleted file mode 100644 index 909a500..0000000 --- a/tests/base/2-assert.tf +++ /dev/null @@ -1,9 +0,0 @@ -resource "test_assertions" "dummy" { - component = "monitoring-modules-cloudwatch-alarm-actions" - - equal "scheme" { - description = "As module does not have any output and data just make sure the case runs. Probably can be thrown away." - got = "all good" - want = "all good" - } -} diff --git a/tests/base/README.md b/tests/base/README.md index 944f4e7..09c9fce 100644 --- a/tests/base/README.md +++ b/tests/base/README.md @@ -5,13 +5,13 @@ | Name | Version | |------|---------| -| [aws](#requirement\_aws) | ~> 4.33 | +| [aws](#requirement\_aws) | = 4.59 | ## Providers | Name | Version | |------|---------| -| [test](#provider\_test) | n/a | +| [aws](#provider\_aws) | 4.59.0 | ## Modules @@ -23,7 +23,10 @@ | Name | Type | |------|------| -| [test_assertions.dummy](https://registry.terraform.io/providers/hashicorp/test/latest/docs/resources/assertions) | resource | +| [aws_cloudwatch_log_group.test](https://registry.terraform.io/providers/hashicorp/aws/4.59/docs/resources/cloudwatch_log_group) | resource | +| [aws_lb.test](https://registry.terraform.io/providers/hashicorp/aws/4.59/docs/resources/lb) | resource | +| [aws_subnets.default](https://registry.terraform.io/providers/hashicorp/aws/4.59/docs/data-sources/subnets) | data source | +| [aws_vpc.default](https://registry.terraform.io/providers/hashicorp/aws/4.59/docs/data-sources/vpc) | data source | ## Inputs diff --git a/vaiables.tf b/vaiables.tf index e0fb558..914001e 100644 --- a/vaiables.tf +++ b/vaiables.tf @@ -33,9 +33,17 @@ variable "enable_log_base_metrics" { } variable "log_base_metrics" { - type = any + type = list(object({ + name = string + pattern = string + log_group_name = string + unit = optional(string, "None") + dimensions = optional(any, {}) + value = optional(string, "1") + default_value = optional(string, "0") + })) default = [] - description = "Log Base Metrics" + description = "Log Base Metrics creation configuration" } variable "alerts" { diff --git a/version.tf b/version.tf index 345263b..94f2d97 100644 --- a/version.tf +++ b/version.tf @@ -2,7 +2,7 @@ terraform { required_version = ">= 1.3.0" required_providers { aws = { - version = "~>4.50" + version = ">= 4.50, < 6.0" configuration_aliases = [aws, aws.virginia] } }