From 945e0d399dceabe2498e3beec322294e03aed94f Mon Sep 17 00:00:00 2001 From: Juanadelacuesta <8647634+Juanadelacuesta@users.noreply.github.com> Date: Mon, 6 Jan 2025 14:01:59 -0500 Subject: [PATCH] func: Add outputs with all data necessary to connect to the cluster --- e2e/terraform/outputs.tf | 23 +++++++++++++++++++++++ e2e/terraform/provision-infra/outputs.tf | 20 ++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/e2e/terraform/outputs.tf b/e2e/terraform/outputs.tf index c17f94be41b..0e84917cfe8 100644 --- a/e2e/terraform/outputs.tf +++ b/e2e/terraform/outputs.tf @@ -17,6 +17,29 @@ output "message" { value = module.provision-infra.message } +output "nomad_addr" { + value = module.provision-infra.nomad_addr +} + +output "ca_file" { + value = module.provision-infra.ca_file +} + +output "cert_file" { + value = module.provision-infra.cert_file +} + +output "key_file" { + value = module.provision-infra.key_file +} + +output "nomad_token" { + value = module.provision-infra.nomad_token +} + + + + # Note: Consul and Vault environment needs to be set in test # environment before the Terraform run, so we don't have that output # here diff --git a/e2e/terraform/provision-infra/outputs.tf b/e2e/terraform/provision-infra/outputs.tf index c34329f4338..05e67e419b8 100644 --- a/e2e/terraform/provision-infra/outputs.tf +++ b/e2e/terraform/provision-infra/outputs.tf @@ -59,3 +59,23 @@ export CONSUL_HTTP_TOKEN=${local_sensitive_file.consul_initial_management_token. export CONSUL_CACERT=${abspath(path.module)}/keys/tls_ca.crt EOM } + +output "nomad_addr" { + value = "https://${aws_instance.server[0].public_ip}:4646" +} + +output "ca_file" { + value = "${abspath(path.module)}/keys/tls_ca.crt" +} + +output "cert_file" { + value = "${abspath(path.module)}/keys/tls_api_client.crt" +} + +output "key_file" { + value = "${abspath(path.module)}/keys/tls_api_client.key" +} + +output "nomad_token" { + value = "${data.local_sensitive_file.nomad_token.content}" +}