-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(DMVP-1232): Implemented ALB all requests, request count widgets
- Loading branch information
1 parent
ec823fa
commit 824a1e8
Showing
16 changed files
with
387 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
85 changes: 85 additions & 0 deletions
85
modules/dashboard/modules/widgets/balancer/all-requests/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.30 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.30 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_alb.balancer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/alb) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no | | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_balancer_arn"></a> [balancer\_arn](#input\_balancer\_arn) | n/a | `string` | `null` | no | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END_TF_DOCS --> | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.30 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.30 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_lb.balancer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no | | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_balancer_arn"></a> [balancer\_arn](#input\_balancer\_arn) | n/a | `string` | `null` | no | | ||
| <a name="input_balancer_name"></a> [balancer\_name](#input\_balancer\_name) | n/a | `string` | `null` | no | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
10 changes: 10 additions & 0 deletions
10
modules/dashboard/modules/widgets/balancer/all-requests/balancer.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
data "aws_lb" "balancer" { | ||
count = var.balancer_arn == null ? 1 : 0 | ||
|
||
name = var.balancer_name | ||
} | ||
|
||
locals { | ||
balancer = split("loadbalancer/", var.balancer_arn == null ? data.aws_lb.balancer[0].arn : var.balancer_arn)[1] | ||
balancer_name = split("/", local.balancer)[1] | ||
} |
25 changes: 25 additions & 0 deletions
25
modules/dashboard/modules/widgets/balancer/all-requests/base.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
module "base" { | ||
source = "../../base" | ||
|
||
coordinates = var.coordinates | ||
|
||
name = "All Requests" | ||
|
||
# stats | ||
stat = "Sum" | ||
period = var.period | ||
|
||
defaults = { | ||
MetricNamespace = "AWS/ApplicationELB" | ||
LoadBalancer = local.balancer | ||
accountId = var.account_id | ||
anomaly_detection = var.anomaly_detection | ||
} | ||
|
||
metrics = [ | ||
{ MetricName = "HTTPCode_Target_2XX_Count", color = "#3ECE76" }, | ||
{ MetricName = "HTTPCode_Target_3XX_Count", color = "#FFC300" }, | ||
{ MetricName = "HTTPCode_Target_4XX_Count", color = "#FF774D" }, | ||
{ MetricName = "HTTPCode_Target_5XX_Count", color = "#FF0F3C" }, | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/dashboard/modules/widgets/balancer/all-requests/output.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "data" { | ||
value = module.base.data | ||
} |
36 changes: 36 additions & 0 deletions
36
modules/dashboard/modules/widgets/balancer/all-requests/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
variable "balancer_name" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "balancer_arn" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "account_id" { | ||
type = string | ||
default = null | ||
} | ||
|
||
# position | ||
variable "coordinates" { | ||
type = object({ | ||
x : number | ||
y : number | ||
width : number | ||
height : number | ||
}) | ||
} | ||
|
||
# stats | ||
variable "period" { | ||
type = number | ||
default = 300 | ||
} | ||
|
||
variable "anomaly_detection" { | ||
type = bool | ||
default = false | ||
description = "Allow to enable anomaly detection on widget metrics" | ||
} |
10 changes: 10 additions & 0 deletions
10
modules/dashboard/modules/widgets/balancer/all-requests/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
terraform { | ||
required_version = ">= 1.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.30" | ||
} | ||
} | ||
} |
85 changes: 85 additions & 0 deletions
85
modules/dashboard/modules/widgets/balancer/request-count/README.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
<!-- BEGIN_TF_DOCS --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.30 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.30 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_alb.balancer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/alb) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no | | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_balancer_arn"></a> [balancer\_arn](#input\_balancer\_arn) | n/a | `string` | `null` | no | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END_TF_DOCS --> | ||
<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK --> | ||
## Requirements | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="requirement_terraform"></a> [terraform](#requirement\_terraform) | >= 1.0 | | ||
| <a name="requirement_aws"></a> [aws](#requirement\_aws) | ~> 4.30 | | ||
|
||
## Providers | ||
|
||
| Name | Version | | ||
|------|---------| | ||
| <a name="provider_aws"></a> [aws](#provider\_aws) | ~> 4.30 | | ||
|
||
## Modules | ||
|
||
| Name | Source | Version | | ||
|------|--------|---------| | ||
| <a name="module_base"></a> [base](#module\_base) | ../../base | n/a | | ||
|
||
## Resources | ||
|
||
| Name | Type | | ||
|------|------| | ||
| [aws_lb.balancer](https://registry.terraform.io/providers/hashicorp/aws/latest/docs/data-sources/lb) | data source | | ||
|
||
## Inputs | ||
|
||
| Name | Description | Type | Default | Required | | ||
|------|-------------|------|---------|:--------:| | ||
| <a name="input_account_id"></a> [account\_id](#input\_account\_id) | n/a | `string` | `null` | no | | ||
| <a name="input_anomaly_detection"></a> [anomaly\_detection](#input\_anomaly\_detection) | Allow to enable anomaly detection on widget metrics | `bool` | `false` | no | | ||
| <a name="input_balancer_arn"></a> [balancer\_arn](#input\_balancer\_arn) | n/a | `string` | `null` | no | | ||
| <a name="input_balancer_name"></a> [balancer\_name](#input\_balancer\_name) | n/a | `string` | `null` | no | | ||
| <a name="input_coordinates"></a> [coordinates](#input\_coordinates) | position | <pre>object({<br> x : number<br> y : number<br> width : number<br> height : number<br> })</pre> | n/a | yes | | ||
| <a name="input_period"></a> [period](#input\_period) | stats | `number` | `300` | no | | ||
|
||
## Outputs | ||
|
||
| Name | Description | | ||
|------|-------------| | ||
| <a name="output_data"></a> [data](#output\_data) | n/a | | ||
<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK --> |
10 changes: 10 additions & 0 deletions
10
modules/dashboard/modules/widgets/balancer/request-count/balancer.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
data "aws_lb" "balancer" { | ||
count = var.balancer_arn == null ? 1 : 0 | ||
|
||
name = var.balancer_name | ||
} | ||
|
||
locals { | ||
balancer = split("loadbalancer/", var.balancer_arn == null ? data.aws_lb.balancer[0].arn : var.balancer_arn)[1] | ||
balancer_name = split("/", local.balancer)[1] | ||
} |
22 changes: 22 additions & 0 deletions
22
modules/dashboard/modules/widgets/balancer/request-count/base.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
module "base" { | ||
source = "../../base" | ||
|
||
coordinates = var.coordinates | ||
|
||
name = "Request Count" | ||
|
||
# stats | ||
stat = "Sum" | ||
period = var.period | ||
|
||
defaults = { | ||
MetricNamespace = "AWS/ApplicationELB" | ||
LoadBalancer = local.balancer | ||
accountId = var.account_id | ||
anomaly_detection = var.anomaly_detection | ||
} | ||
|
||
metrics = [ | ||
{ MetricName = "RequestCount", color = "#127CEF" }, | ||
] | ||
} |
3 changes: 3 additions & 0 deletions
3
modules/dashboard/modules/widgets/balancer/request-count/output.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
output "data" { | ||
value = module.base.data | ||
} |
36 changes: 36 additions & 0 deletions
36
modules/dashboard/modules/widgets/balancer/request-count/variables.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
variable "balancer_name" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "balancer_arn" { | ||
type = string | ||
default = null | ||
} | ||
|
||
variable "account_id" { | ||
type = string | ||
default = null | ||
} | ||
|
||
# position | ||
variable "coordinates" { | ||
type = object({ | ||
x : number | ||
y : number | ||
width : number | ||
height : number | ||
}) | ||
} | ||
|
||
# stats | ||
variable "period" { | ||
type = number | ||
default = 300 | ||
} | ||
|
||
variable "anomaly_detection" { | ||
type = bool | ||
default = false | ||
description = "Allow to enable anomaly detection on widget metrics" | ||
} |
10 changes: 10 additions & 0 deletions
10
modules/dashboard/modules/widgets/balancer/request-count/versions.tf
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
terraform { | ||
required_version = ">= 1.0" | ||
|
||
required_providers { | ||
aws = { | ||
source = "hashicorp/aws" | ||
version = "~> 4.30" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.