akshaykarle / terraform-provider-mongodbatlas

Terraform provider for MongoDB Atlas
Mozilla Public License 2.0
123 stars 54 forks source link

Error after deleting a Project #38

Closed dpiddockcmp closed 5 years ago

dpiddockcmp commented 5 years ago

The provider does not remove a project itself.

I deleted the resource definition in terraform configs and also deleted via the web UI. Now when running terraform plan I get an error:

mongodbatlas_project.test: Refreshing state... (ID: 123456789xxxx)

Error: Error refreshing state: 1 error(s) occurred:

* mongodbatlas_project.test: mongodbatlas_project.test: Error reading MongoDB Project 123456789xxxx: MongoDB Atlas: 404 No group with ID 123456789xxxx exists.

I have to modify the terraform state manually.

akshaykarle commented 5 years ago

This is similar to #28. Need to check if the API returns a 404 and just mark the project as deleted which should force recreation.