github.com/hernad/nomad@v1.6.112/e2e/terraform/outputs.tf (about) 1 # Copyright (c) HashiCorp, Inc. 2 # SPDX-License-Identifier: MPL-2.0 3 4 output "servers" { 5 value = aws_instance.server.*.public_ip 6 } 7 8 output "linux_clients" { 9 value = aws_instance.client_ubuntu_jammy_amd64.*.public_ip 10 } 11 12 output "windows_clients" { 13 value = aws_instance.client_windows_2016_amd64.*.public_ip 14 } 15 16 output "message" { 17 value = <<EOM 18 Your cluster has been provisioned! To prepare your environment, run: 19 20 $(terraform output --raw environment) 21 22 Then you can run tests from the e2e directory with: 23 24 go test -v . 25 26 ssh into servers with: 27 28 %{for ip in aws_instance.server.*.public_ip~} 29 ssh -i keys/${local.random_name}.pem ubuntu@${ip} 30 %{endfor~} 31 32 ssh into clients with: 33 34 %{for ip in aws_instance.client_ubuntu_jammy_amd64.*.public_ip~} 35 ssh -i keys/${local.random_name}.pem ubuntu@${ip} 36 %{endfor~} 37 %{for ip in aws_instance.client_windows_2016_amd64.*.public_ip~} 38 ssh -i keys/${local.random_name}.pem Administrator@${ip} 39 %{endfor~} 40 41 EOM 42 } 43 44 # Note: Consul and Vault environment needs to be set in test 45 # environment before the Terraform run, so we don't have that output 46 # here 47 output "environment" { 48 description = "get connection config by running: $(terraform output environment)" 49 sensitive = true 50 value = <<EOM 51 export NOMAD_ADDR=https://${aws_instance.server[0].public_ip}:4646 52 export NOMAD_CACERT=${abspath(path.root)}/keys/tls_ca.crt 53 export NOMAD_CLIENT_CERT=${abspath(path.root)}/keys/tls_api_client.crt 54 export NOMAD_CLIENT_KEY=${abspath(path.root)}/keys/tls_api_client.key 55 export NOMAD_TOKEN=${data.local_file.nomad_token.content} 56 export NOMAD_E2E=1 57 58 EOM 59 }