Skip to content

Commit

Permalink
acceptance+cloud: fix for Terraform 0.7.4
Browse files Browse the repository at this point in the history
Fix incompatibility with Terraform 0.7.4. The preferred way of
specifying private keys has changed, with no mention in the 0.7.*
upgrade guide. Tested with Terraform 0.7.3 (TeamCity version) and 0.7.4
(latest released version).

See hashicorp/terraform#8963 for details.
  • Loading branch information
Cuong Do committed Sep 29, 2016
1 parent 4a5fc29 commit bd580db
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 9 deletions.
4 changes: 2 additions & 2 deletions acceptance/terraform/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)}"
}

Expand Down
2 changes: 1 addition & 1 deletion cloud/aws/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
2 changes: 1 addition & 1 deletion cloud/aws/examples.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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" {
Expand Down
2 changes: 1 addition & 1 deletion cloud/aws/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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)}"
}

Expand Down
2 changes: 1 addition & 1 deletion cloud/gce/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion cloud/gce/examples.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
4 changes: 2 additions & 2 deletions cloud/gce/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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)}"
}

Expand Down

0 comments on commit bd580db

Please sign in to comment.