-
Notifications
You must be signed in to change notification settings - Fork 209
Description
Is there an existing issue for this?
- I have searched the existing issues
Provider Version
2.1.0
Terraform Version
v1.8.5
Terraform Edition
Terraform Open Source (OSS)
Current Behavior
Hey guys,
We recently had an issue where we accidently deleted the IP whitelist of our MongoDB project by tearing down an old environment. Later down the road, we found out that all of our TF states were referencing the exact same mongodbatlas_project_ip_access_list resource. Our environments were creating the resource on the same project and the resource got automatically imported into each of their TF states. We weren't aware of the behavior and were quite surprised that we didn't get a 409 instead.
For example, when doing the same manipulations as described below, but on a mongodbatlas_database_user resource we get the following error: POST: HTTP 409 Conflict (Error code: "USER_ALREADY_EXISTS") which is what we would have expected from the mongodbatlas_project_ip_access_list resource.
Thanks for the help :)
Terraform configuration to reproduce the issue
resource "mongodbatlas_project_ip_access_list" "whitelist_all" {
project_id = "your_mongodb_project_id"
cidr_block = "0.0.0.0/0"
}Steps To Reproduce
- Create a blank project that will only manage a
mongodbatlas_project_ip_access_listresource - TF apply
- Delete your TF state
- Rerun the TF apply
- The resource will be added to your TF state even if it was already existing
- We would have expected a 409.
Logs
Code of Conduct
- I agree to follow this project's Code of Conduct