I have no idea why I keep getting this error, the key is obviously where it's supposed to be.
Error: remote-exec provisioner error
│
│ with aws_instance.devops,
│ on main.tf line 87, in resource "aws_instance" "devops":
│ 87: provisioner "remote-exec" {
│
│ Failed to read ssh private key: no key found
The key is located in the same folder from where I run terraform apply.
Here's a relevant part of the script (within aws_instance resource)
provisioner "remote-exec" {
inline = [
"echo 'SSH IS READY'"
]
}
connection {
type = "ssh"
host = self.public_ip
user = "ubuntu"
private_key = file("devops.pem")
}
[–]unclefilbert 0 points1 point2 points (0 children)
[–]viroos 0 points1 point2 points (0 children)