title: Prevent creating new local_file resource in terraform
body: <p>I'm creating a service account key on google cloud platform in pkcs12 format, saving it to a file and converting it to pem format.</p>
  
  <p>When applying the plan on the second time, the p12 and pem files are recreated even though the service account key didn't change.
  How can I avoid recreating the files?</p>
  
  <pre><code>resource "google_service_account_key" "test_key_v1" {
    service_account_id = "${google_service_account.test.id}"
    private_key_type = "TYPE_PKCS12_FILE"
  }
  
  resource "local_file" "test_key_v1_file" {
    content     = "${base64decode(google_service_account_key.test_key_v1.private_key)}"
    filename = "./keys/test-key-v1.p12"
  
    provisioner "local-exec" {
      command = "cat ./keys/test-key-v1.p12 | openssl pkcs12 -nodes -nocerts -passin pass:notasecret | openssl rsa &gt; ./keys/test-key-v1.pem"
    }
  }
  </code></pre>
  
  <p>terraform aply on the second time gives me this message:</p>
  
  <pre><code>-/+ local_file.test_key_v1_file (new resource required)
        id:       "13a5202a06ef07569caa544efe2c21cd2b534d11" =&gt; &lt;computed&gt; (forces new resource)
  </code></pre>