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 causes invalid plans #1484

Closed
aleks-andr opened this issue Sep 20, 2023 · 7 comments
Closed

mongodbatlas_project_ip_access_list causes invalid plans #1484

aleks-andr opened this issue Sep 20, 2023 · 7 comments
Labels

Comments

@aleks-andr
Copy link

Terraform CLI and Terraform MongoDB Atlas Provider Version

Terraform: v1.3.5
Provider: v1.12.0

Terraform Configuration File

resource "mongodbatlas_project_ip_access_list" "my_resource" {
  for_each = toset([
    "1.2.3.4",
    "5.6.7.8"
  ])

  project_id = mongodbatlas_project.main.id
  ip_address = each.key
  comment    = "<redacted>"
}

Steps to Reproduce

  1. terraform init
  2. terraform plan

Expected Behavior

Plan should succeed.

Actual Behavior

Plan throws the following error for each resource in the for_each set:

│ Error: Provider produced invalid plan
│ 
│ Provider "registry.terraform.io/mongodb/mongodbatlas" planned an invalid
│ value for
│ mongodbatlas_project_ip_access_list.my_resource["1.2.3.4"].timeouts:
│ planned for existence but config wants absence.
│ 
│ This is a bug in the provider, which should be reported in the provider's
│ own issue tracker.
╵

Additional Context

This was initially observed when planning infrastructure changes for a completely unrelated set of resources from a different provider. The issue also goes away when locking the provider version to 1.11.1.

References

Quick look through the changelog for v1.12.0 suggests that this PR may be the culprit.

@github-actions
Copy link
Contributor

Thanks for opening this issue. The ticket INTMDB-1129 was created for internal tracking.

@maastha
Copy link
Collaborator

maastha commented Sep 20, 2023

@aleks-andr I created mongodbatlas_project_ip_access_list with the above config but could not reproduce the issue.
I created resources with 1.11.1 and then upgraded provider to 1.12.0 and Terraform (v1.3.5) did not detect any plan changes for me.

Could you please share your config, state file and logs for the mongodbatlas_project_ip_access_list and mongodbatlas_project in your configuration?

@AgustinBettati
Copy link
Member

Closing ticket as it has been stale for some weeks, feel free to open with more details.

@drmaciej
Copy link

drmaciej commented Feb 5, 2024

@maastha @AgustinBettati I am experiencing the same issue. I have tried upgrading from 1.11.0 to 1.12.0 (well, to 1.15.0, but this issue is preventing me from doing that), terraform 1.3.4.

This is happening for mongodbatlas_project_ip_access_list resources only, and I am also using for_each.

@aleks-andr were you able to work around this issue?

@aleks-andr
Copy link
Author

@maastha @AgustinBettati I am experiencing the same issue. I have tried upgrading from 1.11.0 to 1.12.0 (well, to 1.15.0, but this issue is preventing me from doing that), terraform 1.3.4.

This is happening for mongodbatlas_project_ip_access_list resources only, and I am also using for_each.

@aleks-andr were you able to work around this issue?

Hi, just went back and checked the project where we had this issue and the provider version is still locked down to 1.11.0, so doesn't seem that any other workaround was ever implemented. But thanks for reminding me about this: we're now using Terraform 1.6.x in that project so I'm curious to see if the combination of newer TF and a newer provider will still produce the issue. I'll let you know if it works 🙂

@aleks-andr
Copy link
Author

@maastha @AgustinBettati I am experiencing the same issue. I have tried upgrading from 1.11.0 to 1.12.0 (well, to 1.15.0, but this issue is preventing me from doing that), terraform 1.3.4.
This is happening for mongodbatlas_project_ip_access_list resources only, and I am also using for_each.
@aleks-andr were you able to work around this issue?

Hi, just went back and checked the project where we had this issue and the provider version is still locked down to 1.11.0, so doesn't seem that any other workaround was ever implemented. But thanks for reminding me about this: we're now using Terraform 1.6.x in that project so I'm curious to see if the combination of newer TF and a newer provider will still produce the issue. I'll let you know if it works 🙂

Follow-up to this: I went and unpinned the provider version and the plan finished successfully. So that would be v1.15.0 of the provider and Terraform 1.6.3. Interestingly enough, the plan wanted to re-create all of the mongodbatlas_project_ip_access_list resources. So some combination of provider/Terraform version upgrades seems to have fixed the issue for us. Hope that helps @drmaciej

@drmaciej
Copy link

drmaciej commented Feb 6, 2024

thanks @aleks-andr , that does help indeed. I bumped terraform to 1.7.2 and it's still good.

However, I am now getting

+ aws_security_group = (known after apply) # forces replacement
~ ip_address         = "***" # forces replacement -> (known after apply) # forces replacement

which appears to be related to #1571 & #1495.

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

No branches or pull requests

5 participants