title: why do we get resource exists error in terraform?
body: <p>Probably something which i don’t understand for quiet some time.</p>
  
  <p>Executed plan and then apply. Created few resources and failed since the snapshot was not found.</p>
  
  <pre><code>aws_lambda_function.LambdaShipRdsLog: Creation complete
  aws_rds_cluster_parameter_group.default: Creation complete
  aws_db_parameter_group.default: Creation complete
  aws_s3_bucket.RdsLogShipment: Creation complete
  Error applying plan:
  </code></pre>
  
  <p>1 error(s) occurred:</p>
  
  <pre><code>* aws_rds_cluster.default: Error creating RDS Cluster: DBClusterSnapshotNotFoundFault: DBClusterSnapshot not found: xy
      status code: 404, request id: 123
  </code></pre>
  
  <p>So, i fixed the issue and trigger the plan and apply once again , but end up getting the resource exists error.</p>
  
  <p>3 error(s) occurred:</p>
  
  <pre><code>* aws_db_parameter_group.default: Error creating DB Parameter Group: DBParameterGroupAlreadyExists: Parameter group xyz already exists
      status code: 400, request id: 123
  * aws_lambda_function.LambdaShipRdsLog: Error creating Lambda function: ResourceConflictException: Function already exist: xyz
      status code: 409, request id: 123
  * aws_rds_cluster_parameter_group.default: Error creating DB Cluster Parameter Group: DBParameterGroupAlreadyExists: Parameter group xyz already exists
      status code: 400, request id: 123
  </code></pre>
  
  <p>As per my understanding, any resource that are being created will be updated in the state file and the next time when i execute <code>terraform plan</code> for the config, it knows that the resource already exists and it will skip it, but that doesn’t looks like the case. Can someone explain what I am missing? Thanks.</p>