oracle/terraform-examples

ssh_public_key_file Variable in instance-with-ssh example

paulofp79 opened this issue · 1 comments

Hi Stephen,

I was creating "instance-with-ssh" and got error in "ssh_public_key_file" :

1 error(s) occurred:

  • opc_compute_ssh_key.ssh_key: 1 error(s) occurred:

  • opc_compute_ssh_key.ssh_key: file: open ./id_rsa.pub: no such file or directory in:

${file(var.ssh_public_key)}

################

I changed the variables file:

--OLD VALUE

variable ssh_public_key_file {
description = "ssh public key"
default = "/.id_rsa.pub"
}

--NEW VALUE
variable ssh_public_key_file {
description = "ssh public key"
default = "~/.ssh/id_rsa.pub" --to get my default id_rsa.pub file
}

Thanks,
Portugal

An alternative to modifying the default value would be to create a terraform.tfvars file with the path to your ssh key file

ssh_public_key_file="~/.ssh/id_rsa.pub"