Skip to content

Instantly share code, notes, and snippets.

@andywirv
Created November 3, 2017 16:16
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save andywirv/d61ebaaef0aa99d1370899d6138616be to your computer and use it in GitHub Desktop.
Save andywirv/d61ebaaef0aa99d1370899d6138616be to your computer and use it in GitHub Desktop.
Multi-line Output for Terraform
output "SSH Config" {
value = <<SSHCONFIG
### START Auto-gen SSH Config for ${random_pet.cluster_id.id} ###
Host ${random_pet.cluster_id.id}-bastion
User core
Hostname ${aws_instance.bastion.public_ip}
IdentityFile ~/.ssh/${random_pet.cluster_id.id}.key
Host ${random_pet.cluster_id.id}-agent
User core
Hostname ${aws_instance.mesos_private_agent.0.private_ip}
ProxyCommand ssh ${random_pet.cluster_id.id}-bastion -W %h:%p 2> /dev/null
IdentityFile ~/.ssh/${random_pet.cluster_id.id}.key
Host ${random_pet.cluster_id.id}-master
User core
Hostname ${aws_instance.mesos_master.0.private_ip}
ProxyCommand ssh ${random_pet.cluster_id.id}-bastion -W %h:%p 2> /dev/null
IdentityFile ~/.ssh/${random_pet.cluster_id.id}.key
### END Auto-gen SSH Config for ${random_pet.cluster_id.id} ###
SSHCONFIG
}
@ArgonQQ
Copy link

ArgonQQ commented Mar 7, 2023

Thanks for sharing 💪🏻

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment