From 0132aba7cd1a615bc300244d220034ece41b1a09 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Tue, 12 Nov 2024 17:10:54 -0500 Subject: [PATCH 1/3] Update the outputs.tf with endpoints nomenclature --- terraform/modules/cos/main.tf | 32 +++++++++++++++--------------- terraform/modules/loki/outputs.tf | 19 +++++++----------- terraform/modules/mimir/outputs.tf | 17 ++++++---------- terraform/modules/tempo/outputs.tf | 10 +++++++--- 4 files changed, 36 insertions(+), 42 deletions(-) diff --git a/terraform/modules/cos/main.tf b/terraform/modules/cos/main.tf index 14a6042f..f2dea892 100644 --- a/terraform/modules/cos/main.tf +++ b/terraform/modules/cos/main.tf @@ -53,12 +53,12 @@ resource "juju_integration" "mimir-grafana-dashboards-provider" { application { name = module.mimir.app_names.mimir_coordinator - endpoint = module.mimir.provides.grafana_dashboards_provider + endpoint = module.mimir.endpoints.grafana_dashboards_provider } application { name = module.grafana.app_name - endpoint = module.grafana.requires.grafana_dashboard + endpoint = module.grafana.endpoints.grafana_dashboard } } @@ -67,12 +67,12 @@ resource "juju_integration" "mimir-grafana-source" { application { name = module.mimir.app_names.mimir_coordinator - endpoint = module.mimir.provides.grafana_source + endpoint = module.mimir.endpoints.grafana_source } application { name = module.grafana.app_name - endpoint = module.grafana.requires.grafana_source + endpoint = module.grafana.endpoints.grafana_source } } @@ -83,12 +83,12 @@ resource "juju_integration" "loki-grafana-dashboards-provider" { application { name = module.loki.app_names.loki_coordinator - endpoint = module.loki.provides.grafana_dashboards_provider + endpoint = module.loki.endpoints.grafana_dashboards_provider } application { name = module.grafana.app_name - endpoint = module.grafana.requires.grafana_dashboard + endpoint = module.grafana.endpoints.grafana_dashboard } } @@ -97,12 +97,12 @@ resource "juju_integration" "loki-grafana-source" { application { name = module.loki.app_names.loki_coordinator - endpoint = module.loki.provides.grafana_source + endpoint = module.loki.endpoints.grafana_source } application { name = module.grafana.app_name - endpoint = module.grafana.requires.grafana_source + endpoint = module.grafana.endpoints.grafana_source } } @@ -113,12 +113,12 @@ resource "juju_integration" "grafana-catalogue" { application { name = module.catalogue.app_name - endpoint = module.catalogue.provides.catalogue + endpoint = module.catalogue.endpoints.catalogue } application { name = module.grafana.app_name - endpoint = module.grafana.requires.catalogue + endpoint = module.grafana.endpoints.catalogue } } @@ -129,12 +129,12 @@ resource "juju_integration" "catalogue-ingress" { application { name = module.traefik.app_name - endpoint = module.traefik.provides.ingress + endpoint = module.traefik.endpoints.ingress } application { name = module.catalogue.app_name - endpoint = module.catalogue.requires.ingress + endpoint = module.catalogue.endpoints.ingress } } @@ -143,12 +143,12 @@ resource "juju_integration" "grafana-ingress" { application { name = module.traefik.app_name - endpoint = module.traefik.provides.traefik_route + endpoint = module.traefik.endpoints.traefik_route } application { name = module.grafana.app_name - endpoint = module.grafana.requires.ingress + endpoint = module.grafana.endpoints.ingress } } @@ -157,11 +157,11 @@ resource "juju_integration" "loki-ingress" { application { name = module.traefik.app_name - endpoint = module.traefik.provides.ingress + endpoint = module.traefik.endpoints.ingress } application { name = module.loki.app_names.loki_coordinator - endpoint = module.loki.requires.ingress + endpoint = module.loki.endpoints.ingress } } diff --git a/terraform/modules/loki/outputs.tf b/terraform/modules/loki/outputs.tf index 0f3152cd..7cdeaa72 100644 --- a/terraform/modules/loki/outputs.tf +++ b/terraform/modules/loki/outputs.tf @@ -10,24 +10,19 @@ output "app_names" { ) } -output "requires" { - value = { - alertmanager = "alertmanager", - certificates = "certificates", - ingress = "ingress", - logging_consumer = "logging-consumer", - s3 = "s3", - tracing = "tracing", - } -} - -output "provides" { +output "endpoints" { value = { + alertmanager = "alertmanager", + certificates = "certificates", grafana_dashboards_provider = "grafana-dashboards-provider", grafana_source = "grafana-source", + ingress = "ingress", logging = "logging", + logging_consumer = "logging-consumer", loki_cluster = "loki-cluster", receive_remote_write = "receive-remote-write", + s3 = "s3", self_metrics_endpoint = "self-metrics-endpoint", + tracing = "tracing", } } diff --git a/terraform/modules/mimir/outputs.tf b/terraform/modules/mimir/outputs.tf index e6a166d7..8bd2fc74 100644 --- a/terraform/modules/mimir/outputs.tf +++ b/terraform/modules/mimir/outputs.tf @@ -18,22 +18,17 @@ output "app_names" { ) } -output "requires" { - value = { - certificates = "certificates", - ingress = "ingress", - logging_consumer = "logging-consumer", - s3 = "s3", - tracing = "tracing", - } -} - -output "provides" { +output "endpoints" { value = { + certificates = "certificates", grafana_dashboards_provider = "grafana-dashboards-provider", grafana_source = "grafana-source", + ingress = "ingress", + logging_consumer = "logging-consumer", mimir_cluster = "mimir-cluster", receive_remote_write = "receive-remote-write", + s3 = "s3", self_metrics_endpoint = "self-metrics-endpoint", + tracing = "tracing", } } \ No newline at end of file diff --git a/terraform/modules/tempo/outputs.tf b/terraform/modules/tempo/outputs.tf index ec638b2f..40db7c6f 100644 --- a/terraform/modules/tempo/outputs.tf +++ b/terraform/modules/tempo/outputs.tf @@ -1,6 +1,7 @@ output "app_names" { value = merge( { + tempo_s3_integrator = juju_application.s3_integrator.name, tempo_coordinator = module.tempo_coordinator.app_name, tempo_querier = module.tempo_querier.app_name, tempo_query_frontend = module.tempo_query_frontend.app_name, @@ -8,9 +9,12 @@ output "app_names" { tempo_distributor = module.tempo_distributor.app_name, tempo_compactor = module.tempo_compactor.app_name, tempo_metrics_generator = module.tempo_metrics_generator.app_name, - tempo_s3_integrator = juju_application.s3_integrator.name, } ) - - } + +output "endpoints" { + value = { + tempo_cluster = "tempo-cluster" + } +} \ No newline at end of file From da0ccf989f18a2d7d4f11626f48afa10f2ebd0c9 Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Tue, 12 Nov 2024 17:29:30 -0500 Subject: [PATCH 2/3] chore: tf fmt --- terraform/modules/loki/outputs.tf | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/terraform/modules/loki/outputs.tf b/terraform/modules/loki/outputs.tf index 7cdeaa72..99b126ea 100644 --- a/terraform/modules/loki/outputs.tf +++ b/terraform/modules/loki/outputs.tf @@ -1,11 +1,11 @@ output "app_names" { value = merge( { - loki_s3_integrator = juju_application.s3_integrator.name, - loki_coordinator = module.loki_coordinator.app_name, - loki_backend = module.loki_backend.app_name, - loki_read = module.loki_read.app_name, - loki_write = module.loki_write.app_name, + loki_s3_integrator = juju_application.s3_integrator.name, + loki_coordinator = module.loki_coordinator.app_name, + loki_backend = module.loki_backend.app_name, + loki_read = module.loki_read.app_name, + loki_write = module.loki_write.app_name, } ) } From b5791a7153dc678a50a72b907b5d1c21f229b6ac Mon Sep 17 00:00:00 2001 From: Michael Thamm Date: Wed, 13 Nov 2024 10:59:03 -0500 Subject: [PATCH 3/3] Split requires and provides in outputs.tf endpoints --- terraform/modules/loki/outputs.tf | 14 ++++++++------ terraform/modules/mimir/outputs.tf | 12 +++++++----- terraform/modules/tempo/outputs.tf | 2 ++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/terraform/modules/loki/outputs.tf b/terraform/modules/loki/outputs.tf index 99b126ea..28050ec2 100644 --- a/terraform/modules/loki/outputs.tf +++ b/terraform/modules/loki/outputs.tf @@ -12,17 +12,19 @@ output "app_names" { output "endpoints" { value = { - alertmanager = "alertmanager", - certificates = "certificates", + # Requires + alertmanager = "alertmanager", + certificates = "certificates", + ingress = "ingress", + logging_consumer = "logging-consumer", + s3 = "s3", + tracing = "tracing", + # Provides grafana_dashboards_provider = "grafana-dashboards-provider", grafana_source = "grafana-source", - ingress = "ingress", logging = "logging", - logging_consumer = "logging-consumer", loki_cluster = "loki-cluster", receive_remote_write = "receive-remote-write", - s3 = "s3", self_metrics_endpoint = "self-metrics-endpoint", - tracing = "tracing", } } diff --git a/terraform/modules/mimir/outputs.tf b/terraform/modules/mimir/outputs.tf index 8bd2fc74..a28bd3f4 100644 --- a/terraform/modules/mimir/outputs.tf +++ b/terraform/modules/mimir/outputs.tf @@ -20,15 +20,17 @@ output "app_names" { output "endpoints" { value = { - certificates = "certificates", + # Requires + certificates = "certificates", + ingress = "ingress", + logging_consumer = "logging-consumer", + s3 = "s3", + tracing = "tracing", + # Provides grafana_dashboards_provider = "grafana-dashboards-provider", grafana_source = "grafana-source", - ingress = "ingress", - logging_consumer = "logging-consumer", mimir_cluster = "mimir-cluster", receive_remote_write = "receive-remote-write", - s3 = "s3", self_metrics_endpoint = "self-metrics-endpoint", - tracing = "tracing", } } \ No newline at end of file diff --git a/terraform/modules/tempo/outputs.tf b/terraform/modules/tempo/outputs.tf index 40db7c6f..74ab8141 100644 --- a/terraform/modules/tempo/outputs.tf +++ b/terraform/modules/tempo/outputs.tf @@ -15,6 +15,8 @@ output "app_names" { output "endpoints" { value = { + # Requires + # Provides tempo_cluster = "tempo-cluster" } } \ No newline at end of file