From 11fa9df9a7d590cdffda65634c710e5e55c7c9db Mon Sep 17 00:00:00 2001 From: Daniel Bimschas <daniel@bimschas.com> Date: Mon, 12 Aug 2024 14:42:12 +0200 Subject: [PATCH] HOLI-9542: add terraform output for endpoint URL to be consumed by other services --- terraform/environments/dns.tf | 5 ----- terraform/environments/vars.tf | 13 +++++++++++++ 2 files changed, 13 insertions(+), 5 deletions(-) diff --git a/terraform/environments/dns.tf b/terraform/environments/dns.tf index b929145..dd8b9a4 100644 --- a/terraform/environments/dns.tf +++ b/terraform/environments/dns.tf @@ -6,8 +6,3 @@ resource "google_dns_record_set" "holi_social_geo_api_domain_record_set" { ttl = 300 rrdatas = [google_cloud_run_domain_mapping.holi_social_geo_api.status[0].resource_records[0].rrdata] } - -output "api_domain" { - value = trimsuffix(google_dns_record_set.holi_social_geo_api_domain_record_set.name, ".") - description = "Domain where the api resides" -} diff --git a/terraform/environments/vars.tf b/terraform/environments/vars.tf index f7e2e18..f8761dd 100644 --- a/terraform/environments/vars.tf +++ b/terraform/environments/vars.tf @@ -6,5 +6,18 @@ locals { # the dns name can be at most 64 chars in total dns_name = "${trimsuffix(substr(local.environment, 0, 34), ".-")}.${data.terraform_remote_state.holi_geo_api_common_state.outputs.dns_geo_api_domain}" + api_domain = trimsuffix(google_dns_record_set.holi_social_geo_api_domain_record_set.name, ".") + api_endpoint_url = "https://${local.api_domain}/graphql" + default_region = data.terraform_remote_state.holi_infra_state.outputs.default_region } + +output "api_domain" { + value = local.api_domain + description = "Domain under which the GeoAPI runs" +} + +output "api_endpoint_url" { + value = local.api_endpoint_url + description = "GraphQL API endpoint URL of the GeoAPI" +} \ No newline at end of file -- GitLab