title: How to use passphrase protected private ssh key in terraform?
body: <p>I am following this tutorial, <a href="https://www.digitalocean.com/community/tutorials/how-to-use-ansible-with-terraform-for-configuration-management" rel="noreferrer">https://www.digitalocean.com/community/tutorials/how-to-use-ansible-with-terraform-for-configuration-management</a>, to learn Terraform and Ansible.</p>
  <p>When I execute <code>terraform apply</code>, it throws an error:</p>
  <pre class="lang-sh prettyprint-override"><code>digitalocean_droplet.web[2]: Provisioning with 'remote-exec'...
  
  Error: Failed to parse ssh private key: ssh: this private key is passphrase protected
  
  Error: Error creating droplet: POST https://api.digitalocean.com/v2/droplets: 422 Failed to resolve VPC
  
    on droplets.tf line 1, in resource &quot;digitalocean_droplet&quot; &quot;web&quot;:
     1: resource &quot;digitalocean_droplet&quot; &quot;web&quot; {
  </code></pre>
  <p>This is the code:</p>
  <pre><code>  provisioner &quot;remote-exec&quot; {
      inline = [&quot;sudo apt update&quot;, &quot;sudo apt install python3 -y&quot;, &quot;echo DONE!&quot;]
  
      connection {
        host        = self.ipv4_address
        type        = &quot;ssh&quot;
        user        = &quot;root&quot;
        private_key = file(var.pvt_key)
      }
    }
  </code></pre>
  <p>That private SSH key (<code>~/.ssh/id_rsa</code>) on my machine is passphrase protected. How do I use it?</p>