title: Terraform - refactoring modules: Error: Provider configuration not present
body: <p>I'm refactoring some Terraform modules and am getting:</p>
  
  <pre><code>Error: Provider configuration not present
  
  To work with
  module.my_module.some_resource.resource_name its
  original provider configuration at
  module.my_module.provider.some_provider.provider_name is required, but it
  has been removed. This occurs when a provider configuration is removed while
  objects created by that provider still exist in the state. Re-add the provider
  configuration to destroy
  module.my_module.some_resource.resource_name, after
  which you can remove the provider configuration again.
  </code></pre>
  
  <p>It seems like I need to remove that resource from the tfstate file then re-add it with the new tf config.</p>
  
  <p>As I'm refactoring some monolithic code there are hundreds of these <code>Error: Provider configuration not present</code> messages. </p>
  
  <p>Any shortcut to removing and re-adding?</p>