I am struggling to understand how I should handle deposed resources found in my TF state.
In particular, when running an apply, I am now getting some errors like the below:
Error applying plan:
11 error(s) occurred:
* aws_instance.mongo-replica-01 (deposed #0): Error terminating instance: InvalidInstanceID.NotFound: The instance ID 'i-0f0bdc2c16e922fbc' does not exist
status code: 400, request id: 71b98708-cb06-4f11-ad14-8d3d160fbc1a
* aws_instance.mongo-replica-01 (deposed #1): Error terminating instance: InvalidInstanceID.NotFound: The instance ID 'i-080ef01dc84c09685' does not exist
status code: 400, request id: 07c96f82-1e32-4944-a1d6-ab0e6306b82e
* aws_instance.mongo-replica-02 (deposed #1): Error terminating instance: InvalidInstanceID.NotFound: The instance ID 'i-085b997daac742c1e' does not exist
status code: 400, request id: 20ff2b73-39c9-4d49-af41-f4ec542ec782
* aws_instance.mongo-replica-02 (deposed #0): Error terminating instance: InvalidInstanceID.NotFound: The instance ID 'i-00bc7fd15b04a3688' does not exist
status code: 400, request id: cdea3c4f-9bec-496a-aedd-bcfbf0a706d2
The AWS EC2 instances in question do not exist indeed, but TF errors out when trying to delete them (presumably because they don't exist) and still keeps them in the state.
I tried using the terraform state command in an attempt to remove the deposed resources, but it only allows me to delete the whole resource, not just the deposed instance of it...
Am I expected to, simply, manually go in the terraform state file and delete the deposed sections??

-refresh=trueparameter toterraform destroyshould automatically update the state file with what's in AWS and thus remove the missing instances and then not try to destroy them.