2023-04-10 15:36:59 +00:00
|
|
|
# Copyright (c) HashiCorp, Inc.
|
|
|
|
# SPDX-License-Identifier: MPL-2.0
|
|
|
|
|
2020-08-26 21:00:36 +00:00
|
|
|
output "servers" {
|
|
|
|
value = aws_instance.server.*.public_ip
|
|
|
|
}
|
|
|
|
|
|
|
|
output "linux_clients" {
|
2022-11-16 16:37:18 +00:00
|
|
|
value = aws_instance.client_ubuntu_jammy_amd64.*.public_ip
|
2020-08-26 21:00:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
output "windows_clients" {
|
2020-10-28 16:58:00 +00:00
|
|
|
value = aws_instance.client_windows_2016_amd64.*.public_ip
|
2020-08-26 21:00:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
output "message" {
|
|
|
|
value = <<EOM
|
|
|
|
Your cluster has been provisioned! To prepare your environment, run:
|
|
|
|
|
2021-06-01 14:10:12 +00:00
|
|
|
$(terraform output --raw environment)
|
2020-08-26 21:00:36 +00:00
|
|
|
|
|
|
|
Then you can run tests from the e2e directory with:
|
|
|
|
|
|
|
|
go test -v .
|
|
|
|
|
|
|
|
ssh into servers with:
|
|
|
|
|
2020-10-28 16:58:00 +00:00
|
|
|
%{for ip in aws_instance.server.*.public_ip~}
|
|
|
|
ssh -i keys/${local.random_name}.pem ubuntu@${ip}
|
|
|
|
%{endfor~}
|
2020-08-26 21:00:36 +00:00
|
|
|
|
|
|
|
ssh into clients with:
|
|
|
|
|
2022-11-16 16:37:18 +00:00
|
|
|
%{for ip in aws_instance.client_ubuntu_jammy_amd64.*.public_ip~}
|
2020-08-26 21:00:36 +00:00
|
|
|
ssh -i keys/${local.random_name}.pem ubuntu@${ip}
|
|
|
|
%{endfor~}
|
2020-10-28 16:58:00 +00:00
|
|
|
%{for ip in aws_instance.client_windows_2016_amd64.*.public_ip~}
|
|
|
|
ssh -i keys/${local.random_name}.pem Administrator@${ip}
|
|
|
|
%{endfor~}
|
2020-08-26 21:00:36 +00:00
|
|
|
|
|
|
|
EOM
|
|
|
|
}
|
|
|
|
|
2022-03-18 13:27:28 +00:00
|
|
|
# Note: Consul and Vault environment needs to be set in test
|
|
|
|
# environment before the Terraform run, so we don't have that output
|
|
|
|
# here
|
2020-08-26 21:00:36 +00:00
|
|
|
output "environment" {
|
|
|
|
description = "get connection config by running: $(terraform output environment)"
|
2022-03-18 13:27:28 +00:00
|
|
|
sensitive = true
|
2020-09-18 15:27:24 +00:00
|
|
|
value = <<EOM
|
2021-08-30 14:18:16 +00:00
|
|
|
export NOMAD_ADDR=https://${aws_instance.server[0].public_ip}:4646
|
2021-09-03 16:59:21 +00:00
|
|
|
export NOMAD_CACERT=${abspath(path.root)}/keys/tls_ca.crt
|
|
|
|
export NOMAD_CLIENT_CERT=${abspath(path.root)}/keys/tls_api_client.crt
|
|
|
|
export NOMAD_CLIENT_KEY=${abspath(path.root)}/keys/tls_api_client.key
|
2020-09-28 13:22:36 +00:00
|
|
|
export NOMAD_TOKEN=${data.local_file.nomad_token.content}
|
2022-03-18 13:27:28 +00:00
|
|
|
export NOMAD_E2E=1
|
2020-10-05 13:28:37 +00:00
|
|
|
|
2020-08-26 21:00:36 +00:00
|
|
|
EOM
|
|
|
|
}
|