title: Tell Terraform not to destroy and create when updating a null_resource
body: <p>I have a <code>null_resource</code> that is used to install/uninstall Kubernetes YAML manifests, and looks as follows:</p>
  
  <pre><code>resource "null_resource" "manifest_provisioner" {
    count = var.enabled ? 1 : 0
  
    triggers = {
      manifest_file = &lt;actual_content_of_the_yaml_manifest&gt;
    }
  
    # Create-time provisioner
    provisioner "local-exec" {
      command = "kubectl apply -f -&lt;&lt;EOF\n${self.triggers.manifest_file}\nEOF"
    }
  
    # Destroy-time provisioner
    provisioner "local-exec" {
      when = destroy
      command = "kubectl delete -f -&lt;&lt;EOF\n${self.triggers.manifest_file}\nEOF"
    }
  }
  
  </code></pre>
  
  <p>When adding a new manifest, or asking to delete it, the resource works as expected.</p>
  
  <p>However, whenever I want to update an existing manifest, Terraform would first destroy and then create the resource, which means that an update would always incur a full deletion of Kubernetes objects which is problematic.</p>
  
  <p>How can I instruct this resource to only run the create-time provisioner when updating an existing resource?</p>