diff --git a/acceptance/terraform/main.tf b/acceptance/terraform/main.tf index df9978d74b76..a6f0e566d0b1 100644 --- a/acceptance/terraform/main.tf +++ b/acceptance/terraform/main.tf @@ -40,7 +40,7 @@ resource "google_compute_instance" "cockroach" { connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}" + private_key = "${file(format("~/.ssh/%s", var.key_name))}" } service_account { @@ -70,7 +70,7 @@ resource "null_resource" "cockroach-runner" { connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}" + private_key = "${file(format("~/.ssh/%s", var.key_name))}" host = "${element(google_compute_instance.cockroach.*.network_interface.0.access_config.0.assigned_nat_ip, count.index)}" } diff --git a/cloud/aws/README.md b/cloud/aws/README.md index ac23bdb230af..46a70e46ffc5 100644 --- a/cloud/aws/README.md +++ b/cloud/aws/README.md @@ -39,7 +39,7 @@ To see the actions expected to be performed by terraform, use `plan` instead of #### Create a cockroach cluster with 3 nodes ``` -$ terraform apply --var=num_instances=3 +$ terraform apply --var=num_instances=\"3\" Outputs: example_block_writer = diff --git a/cloud/aws/examples.tf b/cloud/aws/examples.tf index fa85dc41ab3c..20e4e7d73f4a 100644 --- a/cloud/aws/examples.tf +++ b/cloud/aws/examples.tf @@ -27,7 +27,7 @@ resource "aws_instance" "example_block_writer" { connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}.pem" + private_key = "${file(format("~/.ssh/%s.pem", var.key_name))}" } provisioner "file" { diff --git a/cloud/aws/main.tf b/cloud/aws/main.tf index 973f53cbd56d..7e7fd6c54eab 100644 --- a/cloud/aws/main.tf +++ b/cloud/aws/main.tf @@ -35,7 +35,7 @@ resource "null_resource" "cockroach-runner" { count = "${var.num_instances}" connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}.pem" + private_key = "${file(format("~/.ssh/%s.pem", var.key_name))}" host = "${element(aws_instance.cockroach.*.public_ip, count.index)}" } diff --git a/cloud/gce/README.md b/cloud/gce/README.md index bdeca3a0dca8..2cdcd40a33b1 100644 --- a/cloud/gce/README.md +++ b/cloud/gce/README.md @@ -43,7 +43,7 @@ The following variables can be modified if necessary: #### Create a cockroach cluster with 3 nodes ``` -$ terraform apply --var=num_instances=3 +$ terraform apply --var=num_instances=\"3\" Outputs: diff --git a/cloud/gce/examples.tf b/cloud/gce/examples.tf index 7dc8ae7cc302..046df5ede526 100644 --- a/cloud/gce/examples.tf +++ b/cloud/gce/examples.tf @@ -38,7 +38,7 @@ resource "google_compute_instance" "example_block_writer" { connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}" + private_key = "${file(format("~/.ssh/%s", var.key_name))}" } service_account { diff --git a/cloud/gce/main.tf b/cloud/gce/main.tf index 38a64f662c55..6bf0517c37f8 100644 --- a/cloud/gce/main.tf +++ b/cloud/gce/main.tf @@ -27,7 +27,7 @@ resource "google_compute_instance" "cockroach" { connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}" + private_key = "${file(format("~/.ssh/%s", var.key_name))}" } service_account { @@ -55,7 +55,7 @@ resource "null_resource" "cockroach-runner" { connection { user = "ubuntu" - key_file = "~/.ssh/${var.key_name}" + private_key = "${file(format("~/.ssh/%s", var.key_name))}" host = "${element(google_compute_instance.cockroach.*.network_interface.0.access_config.0.assigned_nat_ip, count.index)}" }