Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: switch to central Grafana instance #139

Merged
merged 1 commit into from
Sep 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/sub-infra-apply.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
id: grafana-get-details
uses: WalletConnect/actions/aws/grafana/get-details-by-name/@2.1.4
with:
workspace-name: 'Main'
workspace-name: ${{ vars.GRAFANA_WORKSPACE_NAME }}

- name: Get Grafana key
id: grafana-get-key
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/sub-infra-plan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
id: grafana-get-details
uses: WalletConnect/actions/aws/grafana/get-details-by-name/@2.1.4
with:
workspace-name: 'Main'
workspace-name: ${{ vars.GRAFANA_WORKSPACE_NAME }}

- name: Get Grafana key
id: grafana-get-key
Expand Down
64 changes: 32 additions & 32 deletions terraform/.terraform.lock.hcl

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion terraform/monitoring/dashboard.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ data "jsonnet_file" "dashboard" {
source = "${path.module}/dashboard.jsonnet"

ext_str = {
dashboard_title = "Keys-Server - ${module.this.stage}"
dashboard_title = "Keys-Server - ${title(module.this.stage)}"
dashboard_uid = "keyserver-${module.this.stage}"

prometheus_uid = grafana_data_source.prometheus.uid
Expand Down
4 changes: 4 additions & 0 deletions terraform/monitoring/data_sources.tf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ resource "grafana_data_source" "prometheus" {
sigV4Region = module.this.region
sigV4AssumeRoleArn = module.monitoring-role.iam_role_arn
})

depends_on = [module.monitoring-role]
}

resource "grafana_data_source" "cloudwatch" {
Expand All @@ -27,4 +29,6 @@ resource "grafana_data_source" "cloudwatch" {
defaultRegion = module.this.region
assumeRoleArn = module.monitoring-role.iam_role_arn
})

depends_on = [module.monitoring-role]
}
4 changes: 0 additions & 4 deletions terraform/monitoring/outputs.tf
Original file line number Diff line number Diff line change
@@ -1,4 +0,0 @@
output "dashboard_definition" {
description = "The JSON definition of the dashboard."
value = data.jsonnet_file.dashboard.rendered
}
2 changes: 1 addition & 1 deletion terraform/providers.tf
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,6 @@ provider "aws" {
}

provider "grafana" {
url = "https://${data.terraform_remote_state.monitoring.outputs.grafana_workspaces.main.grafana_endpoint}"
url = "https://${data.terraform_remote_state.monitoring.outputs.grafana_workspaces.central.grafana_endpoint}"
auth = var.grafana_auth
}
2 changes: 1 addition & 1 deletion terraform/res_monitoring.tf
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ module "monitoring" {
ecs_target_group_arn = module.ecs.target_group_arn
load_balancer_arn = module.ecs.load_balancer_arn_suffix
keystore_cluster_id = module.keystore.cluster_id
monitoring_role_arn = data.terraform_remote_state.monitoring.outputs.grafana_workspaces.main.iam_role_arn
monitoring_role_arn = data.terraform_remote_state.monitoring.outputs.grafana_workspaces.central.iam_role_arn
ecs_task_family = module.ecs.ecs_task_family
}
Loading