'Getting the error in terraform code while trying to connect to linux server in OCI cloud shell . ------Failed to read ssh private key: no key found

Getting the error in terraform code while trying to connect to linux server in OCI cloud shell . ------Failed to read ssh private key: no key found Below is my code : -


resource "null_resource" "remote-exec" {
        
    
    provisioner "remote-exec" {
        connection {
            agent = false
            timeout = "10m"
            host ="xx.xx.x.x" 
            user = var.host_user_name
            private_key =file("${path.module}/integerebspvtkey.ssh.ppk")
        }
        inline = [
            ...
        ]
    }
    }



    variable "host_user_name"{
          default="opc"
    }

integerebspvtkey.ssh.ppk is the private key present in the same directory from where I am running the terraform



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source