As mentioned at Terraform Resource: Connection Error while executing apply
I changed my code to the the below
provisioner "remote-exec" {
    connection {
      type        = "ssh"
      host        = aws_eip.nat-eip.public_ip
      user        = "ubuntu"
      private_key = file("/id_rsa.pem")
    }
    inline = [
      "chmod +x /tmp/start_node.sh",
      "sudo sed -i -e 's/\r$//' /tmp/start_node.sh", # Remove the spurious CR characters.
      "sudo /tmp/start_node.sh",
    ]
  }
But I still get the same error
Error: Invalid function argument
  on explorer.tf line 60, in resource "aws_instance" "explorer":
  60:       private_key = file("/id_rsa.pem")
Invalid value for "path" parameter: no file exists at /id_rsa.pem;
this function works only with files that are distributed as part of the
configuration source code, so if this file will be created by a resource in
this configuration you must instead obtain this result from an attribute of
that resource.
ls -la ooutput
total 156
drwxr-xr-x  10 CORP\mayuresh CORP\domain users  4096 Jan 12 14:29 .
drwxr-xr-x  16 CORP\mayuresh CORP\domain users  4096 Jan 10 13:10 ..
drwxr-xr-x  12 CORP\mayuresh CORP\domain users  4096 Jan 12 09:49 byoc-terraform
drwxr-xr-x   2 CORP\mayuresh CORP\domain users  4096 Jan 11 11:57 controllers
-rw-r--r--   1 CORP\mayuresh CORP\domain users   188 Jan 10 13:27 .env
-rw-r--r--   1 CORP\mayuresh CORP\domain users  1582 Jan 10 17:12 fetchUserData.js
drwxr-xr-x   9 CORP\mayuresh CORP\domain users  4096 Jan 12 13:14 .git
-rw-r--r--   1 CORP\mayuresh CORP\domain users   629 Jan 10 13:27 .gitignore
-rw-r--r--   1 CORP\mayuresh CORP\domain users   107 Dec 30 06:49 .gitmodules
-rw-r--r--   1 CORP\mayuresh CORP\domain users  1765 Jan 12 13:21 id_rsa.pem
-rw-r--r--   1 CORP\mayuresh CORP\domain users  1488 Jan 10 13:27 index.js
drwxr-xr-x   3 CORP\mayuresh CORP\domain users  4096 Jan 10 13:27 models
drwxr-xr-x 221 CORP\mayuresh CORP\domain users 12288 Jan 10 13:30 node_modules
-rw-r--r--   1 CORP\mayuresh CORP\domain users  1058 Jan 10 13:27 package.json
-rw-r--r--   1 CORP\mayuresh CORP\domain users 78791 Jan 10 13:27 package-lock.json
drwxr-xr-x   2 CORP\mayuresh CORP\domain users  4096 Jan 10 13:27 routes
drwxr-xr-x   2 CORP\mayuresh CORP\domain users  4096 Jan 10 17:01 utils
drwxr-xr-x   2 CORP\mayuresh CORP\domain users  4096 Jan 10 13:27 VMCreationFiles```
 
     
     
    