Skip to content

Commit

Permalink
fix: switch to central Grafana instance
Browse files Browse the repository at this point in the history
  • Loading branch information
Xavier Basty committed Sep 18, 2023
1 parent a5a9bb6 commit 718b4d1
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 41 deletions.
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
}

0 comments on commit 718b4d1

Please sign in to comment.