Error when attempting to build image

I didn’t change any of the downloaded code, and it’s all in the same directory. Can someone help me understand what’s going wrong here?

I’m attempting to work through this tutorial:

C:\Users\realm\Documents\Projects\packer tutorial\learn-terraform-provisioning\images>packer build image.pkr.hcl
Error: Failed preparing provisioner-block "file" ""

  on image.pkr.hcl line 32:
  (source code not available)

1 error(s) occurred:

* Bad source '../tf-packer.pub': CreateFile ../tf-packer.pub: The system cannot
find the file specified.

I’m going to assume that you resolved your issue since you deleted whatever response you wrote, but if not, I think the issue is the tf-packer.pub file is “all in the same directory” because the path which it’s looking for the file is 1 directory up as denoted by the ‘…’

Nah, I deleted my reply because I had originally missed out on some info on the initial post, then realized I could edit it to add said info instead of posting a reply.

To clarify there, I mean that I didn’t take anything out of the downloaded code and put it anywhere else. The structure of the directories is unchanged from how it was downloaded from git.

Sounds like it can’t find the ssh key you create in a previous step of the tutorial.
Packer is expecting it to be at the root, in your case:
C:\Users\realm\Documents\Projects\packer tutorial\learn-terraform-provisioning\tf-packer.pub

Did you create it in the images directory by chance? If so, move the two files (tf-packer and tf-packer.pub) to the path mentioned above.

did anyone provide a fix for this issue because im getting the same error