0

I followed the paths shared in How to modify ~/.ssh folder & files in windows?. (created .ssh folder, ran ssh-keygen command and generated the id_rsa and id_rsa.pub file...'dir' shows both file exists)

Now I'm trying to access the id_rsa.pub file by setting it's path value to a variable in my tfvars file my_public_key = "C:\Users\your_username.ssh\id_rsa.pub" and calling it from tf.main like public_key = "${file("var.my_public_key")}"

trouble is it throws every "" slash as an error.

How to workaround this?

1 Answers1

0

It may occur because it treats "\" as escape character. In that case, use is again like "\\" to indicate that your slash is actually a part of the string.

So final path should look like that:

my_public_key = "C:\\Users\\your_username.ssh\\id_rsa.pub"
qeqoos
  • 32
  • 4