mongodb / terraform-provider-mongodbatlas

Terraform MongoDB Atlas Provider: Deploy, update, and manage MongoDB Atlas infrastructure as code through HashiCorp Terraform
https://registry.terraform.io/providers/mongodb/mongodbatlas
Mozilla Public License 2.0
230 stars 167 forks source link

fix: Removes error diagnostic if `mongodbatlas_project_ip_access_list` resource doesn't exist #2349

Closed maastha closed 2 weeks ago

maastha commented 2 weeks ago

Description

If the mongodbatlas_project_ip_access_list resource is deleted from the UI after creation, the provider should plan to recreate it and remove it from the state. Currently, this doesn't happen because when calling resp.State.RemoveResource(ctx) in the provider in Read(), we add an error to the response diagnostic, interfering with resource removal. As a result, users only see a 404 error and must manually remove the resource from the state. This PR removes the error diagnostic to ensure resp.State.RemoveResource(ctx) functions correctly.

Link to any related issue(s): https://github.com/mongodb/terraform-provider-mongodbatlas/issues/2343

Type of change:

Required Checklist:

Further comments

github-actions[bot] commented 2 weeks ago

APIx bot: a message has been sent to Docs Slack channel