Publish dashboards only if grafana folder exists (#148)

This commit is contained in:
Vijay Chintalapati
2023-04-06 13:02:39 -07:00
committed by GitHub
parent caeebe0e1a
commit f708659758
12 changed files with 61 additions and 4 deletions
@@ -171,6 +171,7 @@ terraform destroy -var-file=terraform.tfvars
|------|-------------|------|---------|:--------:|
| <a name="input_aws_region"></a> [aws\_region](#input\_aws\_region) | AWS Region | `string` | n/a | yes |
| <a name="input_eks_cluster_id"></a> [eks\_cluster\_id](#input\_eks\_cluster\_id) | Name of the EKS cluster | `string` | n/a | yes |
| <a name="input_enable_dashboards"></a> [enable\_dashboards](#input\_enable\_dashboards) | Enables or disables curated dashboards | `bool` | `true` | no |
| <a name="input_grafana_api_key"></a> [grafana\_api\_key](#input\_grafana\_api\_key) | API key for authorizing the Grafana provider to make changes to Amazon Managed Grafana | `string` | n/a | yes |
| <a name="input_managed_grafana_workspace_id"></a> [managed\_grafana\_workspace\_id](#input\_managed\_grafana\_workspace\_id) | Amazon Managed Grafana Workspace ID | `string` | n/a | yes |
| <a name="input_managed_prometheus_workspace_id"></a> [managed\_prometheus\_workspace\_id](#input\_managed\_prometheus\_workspace\_id) | Amazon Managed Service for Prometheus Workspace ID | `string` | `""` | no |
@@ -77,6 +77,10 @@ module "eks_monitoring" {
# reusing existing certificate manager? defaults to true
enable_cert_manager = true
# control the publishing of dashboards by specifying the boolean value for the variable 'enable_dashboards', default is 'true'
# the intention to publish is overruled depending upon whether grafana dashboard folder is created by the observability accelerator
enable_dashboards = module.aws_observability_accelerator.grafana_dashboard_folder_created ? var.enable_dashboards : false
dashboards_folder_id = module.aws_observability_accelerator.grafana_dashboards_folder_id
managed_prometheus_workspace_id = module.aws_observability_accelerator.managed_prometheus_workspace_id
@@ -2,21 +2,31 @@ variable "eks_cluster_id" {
description = "Name of the EKS cluster"
type = string
}
variable "aws_region" {
description = "AWS Region"
type = string
}
variable "managed_prometheus_workspace_id" {
description = "Amazon Managed Service for Prometheus Workspace ID"
type = string
default = ""
}
variable "managed_grafana_workspace_id" {
description = "Amazon Managed Grafana Workspace ID"
type = string
}
variable "grafana_api_key" {
description = "API key for authorizing the Grafana provider to make changes to Amazon Managed Grafana"
type = string
sensitive = true
}
variable "enable_dashboards" {
description = "Enables or disables curated dashboards"
type = bool
default = true
}