Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mongodbatlas_project_ip_access_list error - Couldn't find resource #864

Closed
adrian-januzi opened this issue Oct 6, 2022 · 3 comments
Closed

Comments

@adrian-januzi
Copy link

adrian-januzi commented Oct 6, 2022

Terraform CLI and Terraform MongoDB Atlas Provider Version

Latest Version - 1.3.1

Terraform Configuration File

resource "mongodbatlas_project_ip_access_list" "applications_access_list" {
  project_id = mongodbatlas_project.atlas-project.id

  ip_address = "0.0.0.0"
}

Steps to Reproduce

  1. terraform init
  2. Attempt to add 0.0.0.0 to the whitelist.
  3. terraform apply

Expected Behavior

The mongoDB cluster created through Terraform has the IP 0.0.0.0 whitelisted.

Actual Behavior

The IP does get whitelisted though Terraform returns an error in the console stating that the resource cannot be found after the mongoDB cluster has been created. This occurs every time I attempt to create the mongoDB cluster.

Debug Output

Crash Output

│ Error: error creating Project IP Access List information: couldn't find resource (21 retries)

│ with mongodbatlas_project_ip_access_list.applications_access_list,
│ on main.tf line 70, in resource "mongodbatlas_project_ip_access_list" "applications_access_list":
│ 70: resource "mongodbatlas_project_ip_access_list" "applications_access_list" {

Additional Context

References

Similar issue here with no resolution - #266

@martinstibbe
Copy link
Contributor

@adrian-januzi It looks like 0.0.0.0 does not come back from API with an IP address
resource "mongodbatlas_project_ip_access_list" "applications_access_list" {
project_id = local.mongodbatlas_project_id
cidr_block = "0.0.0.0/0"
// ip_address = "0.0.0.0"
}
If I use this from a setting apply seems to apply correctly

@adrian-januzi
Copy link
Author

Hi, that seems to have worked. Appreciate the help @martinstibbe

@iwahbe
Copy link

iwahbe commented Aug 8, 2023

Hi @martinstibbe. Is replacing ip_address: "0.0.0.0" with cidr_block: "0.0.0.0/0" a workaround (with a fix to come later) or is the failure intended behavior? It seems like a workaround but the issue is closed and I couldn't find a PR to address this.

For context, I work at @pulumi. Some of our customers have encountered this issue and I'm not sure if I should tell them this will be resolved later, or if we should work around the behavior.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants