From c458b45ce2cada6d5eae0fc97e91ae350a507508 Mon Sep 17 00:00:00 2001 From: Xavier Basty Date: Mon, 18 Sep 2023 13:02:14 +0200 Subject: [PATCH] fix: switch to `central` Grafana instance (#139) --- .github/workflows/sub-infra-apply.yml | 2 +- .github/workflows/sub-infra-plan.yml | 2 +- terraform/.terraform.lock.hcl | 64 +++++++++++++-------------- terraform/monitoring/dashboard.tf | 2 +- terraform/monitoring/data_sources.tf | 4 ++ terraform/monitoring/outputs.tf | 4 -- terraform/providers.tf | 2 +- terraform/res_monitoring.tf | 2 +- 8 files changed, 41 insertions(+), 41 deletions(-) diff --git a/.github/workflows/sub-infra-apply.yml b/.github/workflows/sub-infra-apply.yml index 32bceaa..898ad05 100644 --- a/.github/workflows/sub-infra-apply.yml +++ b/.github/workflows/sub-infra-apply.yml @@ -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 diff --git a/.github/workflows/sub-infra-plan.yml b/.github/workflows/sub-infra-plan.yml index baf775c..3674acc 100644 --- a/.github/workflows/sub-infra-plan.yml +++ b/.github/workflows/sub-infra-plan.yml @@ -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 diff --git a/terraform/.terraform.lock.hcl b/terraform/.terraform.lock.hcl index afc88cd..6533fce 100644 --- a/terraform/.terraform.lock.hcl +++ b/terraform/.terraform.lock.hcl @@ -24,47 +24,47 @@ provider "registry.terraform.io/alxrem/jsonnet" { } provider "registry.terraform.io/grafana/grafana" { - version = "2.2.0" + version = "2.3.1" constraints = "~> 2.0, >= 2.1.0" hashes = [ - "h1:W3Qo+OqaMo8Hz/MRB1HM0/5ce2y6zpO+hX0JrqSP9mE=", - "zh:253b1d6742824e75e2b220deec1e0dd2f8e72f836fc17ed34a6f286b9b9f62e1", - "zh:4b8d84aae409f3a1566e30079d58bd2fcbf1fcca31b5643b23747029be078ed5", - "zh:69e9e0e0e3b48c08167ad4979760163819ea675527a46ad6bf92ce517f988e36", - "zh:a2c39387450e6853e354ab4a62c45743083357ce5ca88df8463f6fca225cf26a", - "zh:cd28f4673ba42d6f23c12dedf368c7ce405727a324c2cc7d1c99bd9d04bcd8a7", - "zh:cdc026e98209fa92a46f44b00dbfad92c9e0d17c11fbda1ea5b19613520ca98f", - "zh:d0cc7481a7ee578b096cb4ad3a6758e92cbc99a1141d4c71f6c85b64946e341f", - "zh:d0cea5b6084ff240ac167f715cefef7a69bbc0bcabfa6043da0438a19ac71224", - "zh:d654a5dd3e02d3f462ed78a84cbf8899beebc03b0499b76cefb5683fa283f824", - "zh:d732c1e7194e7211bd19b83f882dfa72b27d4d30f004650c83ca9df3ed27696d", - "zh:e673877bff28571807cbb60ff0e09b2ae5e8dec1297b457dd59d451649c2a657", - "zh:f705260e2bb4f15201a74f4cbe0848eab704e43068f801a6bb61604bcf6328d2", - "zh:f81e8963cbc4c3bf901651008add74bd1ecee4048b789666dc7e02c01ecb116e", - "zh:fc9159a5c77bc55d4bf9d0ff99dd0c6b55a9eed77b1e9e480f862a6a59815a90", + "h1:eA88WSfhsi/mDvGRats1tsvj1uIFiYC9WuMSmIwMPBA=", + "zh:08697de4636bb5fb633cc65917ff5a058b7b7e8afa550a515be42bb0e9804120", + "zh:28aa9c1d89f97ed07980ef486af629afdda9a8235f10932cff04c38fc9126455", + "zh:4191c4b8b26ce66f6963869d76aabb003c81f345b953a36064d8893375f0ee04", + "zh:4a29602e14a16796053a5e33145d46de174c237c4b54e6b11fc4de583098d5bb", + "zh:5191ab082b770f80f3ea9aa786ea155b4aa5ce9f019eb473800409998f9eaf11", + "zh:7f2bf9028766de406f066c9eea7df6054809bf1336b1dab734a356d9654fcb78", + "zh:8f1d5b5400bb1185982dbf1cb010a7b58b628a6bbd8a2d5e2277af61bfc4fd0f", + "zh:aac32024c758d4086f340cb1d615b8f1658f3cc073bc74d3773a1e0090dc04c8", + "zh:c17a1e2673d19fa747ca57d8cfa0a134ee20bb8c740d6fedf60bfbc0fb36c3b7", + "zh:cb8bb196d4ebd570b43dccf9af9bc6930ba567f602698dba34e6409aa9ffde49", + "zh:cc3bd739fb96689c56355f728fd57aa56e6bb03c455fe3149027da75ae04b57b", + "zh:cd182d58a1ab4ed70b0fea81059e456a5a8aed4d500678adf8e9dc4ec0fc8ea0", + "zh:e3d6f66f3fbbbe17051eabf80775a03effad57a42701545b75ad8278c89f76d6", + "zh:f1d8e24656eabec49eabd0bcbcac2a5ef41826ec9271df522a9873639976fd3d", ] } provider "registry.terraform.io/hashicorp/aws" { - version = "5.12.0" + version = "5.17.0" constraints = ">= 4.9.0, >= 4.50.0, >= 5.0.0, >= 5.7.0, ~> 5.7" hashes = [ - "h1:i28TUsgqoKs891cyDU0V9fFAwEz/RqbwF8sQShLfNq0=", - "zh:0953565eb67ece49556dc9046c77322dc6c76e0ae6fa0c9fd6710b6afa2588c9", - "zh:43676f3592c127a971719cc37b9199967376fb05d445b356f1545609e2b84bf8", - "zh:46422ab8044b35e90f422ffabc17fa043ec8e4a33e3df2f8b305d63a950c0edb", - "zh:4d34f024a82d31d10b5a9498d26fca71e3e35c543dfc5185c94c3205bc4dba22", - "zh:51be0eeb882f041fc2679bd621e64cd775d013ae003055cea013c9d630c15dfb", - "zh:7ca9252befa7271899febde25b679a73f90dbdb700cbbfec07d29389a3937131", - "zh:8325b2152be0534a718e497a3273cf6c42880e78f290dc35024feef2e0af8e97", - "zh:98f0c4d4c190cf4897cb9075a538f42f2998566e9f2d15755901fbb4862f8b32", + "h1:rplvK7UGP2FuzM44t2eRX+QYYPC0aUIoKdi5XayRI8M=", + "zh:0087b9dd2c9c638fd63e527e5b9b70988008e263d480a199f180efe5a4f070f0", + "zh:0fd532a4fd03ddef11f0502ff9fe4343443e1ae805cb088825a71d6d48906ec7", + "zh:16411e731100cd15f7e165f53c23be784b2c86c2fcfd34781e0642d17090d342", + "zh:251d520927e77f091e2ec6302e921d839a2430ac541c6a461aed7c08fb5eae12", + "zh:4919e69682dc2a8c32d44f6ebc038a52c9f40af9c61cb574b64e322800d6a794", + "zh:5334c60759d5f76bdc51355d1a3ebcc451d4d20f632f5c73b6e55c52b5dc9e52", + "zh:7341a2b7247572eba0d0486094a870b872967702ec0ac7af728c2df2c30af4e5", + "zh:81d1b1cb2cac6b3922a05adab69543b678f344a01debd54500263700dad7a288", + "zh:882bc8e15ef6d4020a07321ec4c056977c5c1d96934118032922561d29504d43", + "zh:8cd4871ef2b03fd916de1a6dc7eb8a81a354c421177d4334a2e3308e50215e41", + "zh:97e12fe6529b21298adf1046c5e20ac35d0569c836a6f385ff041e257e00cfd2", "zh:9b12af85486a96aedd8d7984b0ff811a4b42e3d88dad1a3fb4c0b580d04fa425", - "zh:a71e0bc6754bb3924b31727d80f05b04fa65247c009ffdfd2a715a01d95b373d", - "zh:a82ae67ce3d4c7aaae761a592275b8cac5e9965a30b2dba951c1d965b3121006", - "zh:c5510eca023cec89557a8244648bf8ad9a0cd3189b6abf6dcceba30e3b2e8c6d", - "zh:cd11fe9c83793e838b6f90a55840fc45e7c106b358a68f0a88db09a29a321c9a", - "zh:e451ad353f219a2922b92e786a93c31658168b896317be127798cddfa9a99363", - "zh:e4b70a70e925b9ccb7d44e17fd8e7b89aa744a965f298f8bb2480a5c96f3c4f0", + "zh:9f5baf5d59b9f3cf5504d1fa975f10f27da3791896a9e18ece47c258bac17634", + "zh:dffafba6731ac1db1c540bdbd6a8c878486b71de9d0ca1d23c5c00a6c3c14d80", + "zh:fa7440c3c15a42fc5731444d324ced75407d417bfe3184661ae47d40a9718dce", ] } diff --git a/terraform/monitoring/dashboard.tf b/terraform/monitoring/dashboard.tf index 4aaea05..89ccee2 100644 --- a/terraform/monitoring/dashboard.tf +++ b/terraform/monitoring/dashboard.tf @@ -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 diff --git a/terraform/monitoring/data_sources.tf b/terraform/monitoring/data_sources.tf index 4ec9f58..473b245 100644 --- a/terraform/monitoring/data_sources.tf +++ b/terraform/monitoring/data_sources.tf @@ -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" { @@ -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] } diff --git a/terraform/monitoring/outputs.tf b/terraform/monitoring/outputs.tf index bb1ab13..e69de29 100644 --- a/terraform/monitoring/outputs.tf +++ b/terraform/monitoring/outputs.tf @@ -1,4 +0,0 @@ -output "dashboard_definition" { - description = "The JSON definition of the dashboard." - value = data.jsonnet_file.dashboard.rendered -} diff --git a/terraform/providers.tf b/terraform/providers.tf index cf3c620..f7d191e 100644 --- a/terraform/providers.tf +++ b/terraform/providers.tf @@ -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 } diff --git a/terraform/res_monitoring.tf b/terraform/res_monitoring.tf index 5244204..76ddea9 100644 --- a/terraform/res_monitoring.tf +++ b/terraform/res_monitoring.tf @@ -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 }