Skip to content

Commit

Permalink
Update the output and updated the script to support the latest versio…
Browse files Browse the repository at this point in the history
…n of terraform
  • Loading branch information
vp15591 committed Sep 24, 2019
1 parent 011b4e3 commit 08d1ea9
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 3 deletions.
1 change: 1 addition & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
[submodule "utilities"]
path = utilities
url = https://github.com/YugaByte/utilities.git
branch = master
9 changes: 7 additions & 2 deletions main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ resource "google_compute_instance" "yugabyte_node" {
size = "${var.disk_size}"
}
}
metadata {
metadata = {
sshKeys = "${var.ssh_user}:${file(var.ssh_public_key)}"
}

Expand All @@ -54,6 +54,7 @@ resource "google_compute_instance" "yugabyte_node" {
source = "${path.module}/utilities/scripts/install_software.sh"
destination = "/home/${var.ssh_user}/install_software.sh"
connection {
host = "${self.network_interface.0.access_config.0.nat_ip}"
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file(var.ssh_private_key)}"
Expand All @@ -64,6 +65,7 @@ resource "google_compute_instance" "yugabyte_node" {
source = "${path.module}/utilities/scripts/create_universe.sh"
destination ="/home/${var.ssh_user}/create_universe.sh"
connection {
host = "${self.network_interface.0.access_config.0.nat_ip}"
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file(var.ssh_private_key)}"
Expand All @@ -73,6 +75,7 @@ resource "google_compute_instance" "yugabyte_node" {
source = "${path.module}/utilities/scripts/start_master.sh"
destination ="/home/${var.ssh_user}/start_master.sh"
connection {
host = "${self.network_interface.0.access_config.0.nat_ip}"
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file(var.ssh_private_key)}"
Expand All @@ -82,6 +85,7 @@ resource "google_compute_instance" "yugabyte_node" {
source = "${path.module}/utilities/scripts/start_tserver.sh"
destination ="/home/${var.ssh_user}/start_tserver.sh"
connection {
host = "${self.network_interface.0.access_config.0.nat_ip}"
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file(var.ssh_private_key)}"
Expand All @@ -93,9 +97,10 @@ resource "google_compute_instance" "yugabyte_node" {
"chmod +x /home/${var.ssh_user}/create_universe.sh",
"chmod +x /home/${var.ssh_user}/start_tserver.sh",
"chmod +x /home/${var.ssh_user}/start_master.sh",
"/home/${var.ssh_user}/install_software.sh '${var.yb_edition}' '${var.yb_version}' '${var.yb_download_url}'"
"/home/${var.ssh_user}/install_software.sh '${var.yb_version}'"
]
connection {
host = "${self.network_interface.0.access_config.0.nat_ip}"
type = "ssh"
user = "${var.ssh_user}"
private_key = "${file(var.ssh_private_key)}"
Expand Down
26 changes: 25 additions & 1 deletion outputs.tf
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,31 @@ output "ui" {
sensitive = false
value = "http://${google_compute_instance.yugabyte_node.0.network_interface.0.access_config.0.nat_ip}:7000"
}
output "ssh_user" {
sensitive = false
value = "${var.ssh_user}"
}
output "ssh_key" {
sensitive = false
value = "${var.ssh_private_key}"
}
}

output "JDBC" {
sensitive =false
value = "postgresql://postgres@${google_compute_instance.yugabyte_node.0.network_interface.0.access_config.0.nat_ip}:5433"
}

output "YSQL"{
sensitive = false
value = "psql -U postgres -h ${google_compute_instance.yugabyte_node.0.network_interface.0.access_config.0.nat_ip} -p 5433"
}

output "YCQL"{
sensitive = false
value = "cqlsh ${google_compute_instance.yugabyte_node.0.network_interface.0.access_config.0.nat_ip} 9042"
}

output "YEDIS"{
sensitive = false
value = "redis-cli -h ${google_compute_instance.yugabyte_node.0.network_interface.0.access_config.0.nat_ip} -p 6379"
}

0 comments on commit 08d1ea9

Please sign in to comment.