Skip to content

Commit

Permalink
func: Add outputs with all data necessary to connect to the cluster
Browse files Browse the repository at this point in the history
  • Loading branch information
Juanadelacuesta committed Jan 8, 2025
1 parent ef9aa9b commit 945e0d3
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 0 deletions.
23 changes: 23 additions & 0 deletions e2e/terraform/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
20 changes: 20 additions & 0 deletions e2e/terraform/provision-infra/outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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}"
}

0 comments on commit 945e0d3

Please sign in to comment.