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

[Bug]: Unable to recreate IP access list entries after UI modifications #2343

Closed
2 tasks done
nick-augustine opened this issue Jun 13, 2024 · 6 comments
Closed
2 tasks done
Labels

Comments

@nick-augustine
Copy link

Is there an existing issue for this?

  • I have searched the existing issues

Provider Version

1.17.0

Terraform Version

1.8.3

Terraform Edition

Terraform Cloud

Current Behavior

When a resource mongodbatlas_project_ip_access_list is removed from the list of networks in the Mongo Cloud UI, we're expecting Terraform to be used to create that again or remove and create new entries during terraform applies. The current behavior of this resource will generate an error when attempting to read the state during a terraform plan -

│ Error: resource not found
│ 
│   with module.dev_project.mongodbatlas_project_ip_access_list.default["170.85.0.0/16"],
│   on ../modules/mongo_project/networking.tf line 2, in resource "mongodbatlas_project_ip_access_list" "default":
│    2: resource "mongodbatlas_project_ip_access_list" "default" {
│ 
│ https://cloud.mongodb.com/api/atlas/v2/groups/66574f0e56a8133612676008/accessList/170.85.0.0%2F16
│ GET: HTTP 404 Not Found (Error code:
│ "ATLAS_NETWORK_PERMISSION_ENTRY_NOT_FOUND") Detail: IP Address
│ 170.85.0.0/16 not on Atlas access list for group 66574f0e56a8133612676008.
│ Reason: Not Found. Params: [170.85.0.0/16 66574f0e56a8133612676008]
╵
Operation failed: failed running terraform plan (exit 1)

If the resource is removed from terraform state, the plan will successfully run.
terraform state rm 'module.dev_project.mongodbatlas_project_ip_access_list.default["170.85.0.0/16"]'

Terraform used the selected providers to generate the following execution
plan. Resource actions are indicated with the following symbols:
  + create

Terraform will perform the following actions:

  # module.dev_project.mongodbatlas_project_ip_access_list.deafult_sw["170.85.0.0/16"] will be created
  + resource "mongodbatlas_project_ip_access_list" "deafult_sw" {
      + aws_security_group = (known after apply)
      + cidr_block         = "170.85.0.0/16"
      + comment            = "Default Set of SW Networks including ZScaler"
      + id                 = (known after apply)
      + ip_address         = (known after apply)
      + project_id         = "66574f0e56a8133612676008"
    }

Plan: 1 to add, 0 to change, 0 to destroy.

Terraform configuration to reproduce the issue

# Terraform code being used within a module 
resource "mongodbatlas_project_ip_access_list" "default" {
  for_each = var.default_networks_whitelist

  project_id = mongodbatlas_project.this.id
  cidr_block = each.value
  comment    = "Default Set of Networks"
}

variable "default_networks_whitelist" {
  type    = set(string)
  default = ["8.8.8.8", "1.1.1.1", "192.168.1.1", "170.85.0.0/16"]
}

Steps To Reproduce

  1. Create resource mongodbatlas_project_ip_access_list with Terraform code
  2. From the Mongo Cloud UI, remove the resource from the project.
  3. Attempt to terraform plan to recreate the resource.

Logs

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
Copy link
Contributor

Thanks for opening this issue! Please make sure you've followed our guidelines when opening the issue. In short, to help us reproduce the issue we need:

  • Terraform configuration file used to reproduce the issue
  • Terraform log files from the run where the issue occurred
  • Terraform Atlas provider version used to reproduce the issue
  • Terraform version used to reproduce the issue
  • Confirmation if Terraform OSS, Terraform Cloud, or Terraform Enterprise deployment

The ticket CLOUDP-253876 was created for internal tracking.

@maastha
Copy link
Collaborator

maastha commented Jun 17, 2024

@nick-augustine Thank you for creating this issue!
I was able to reproduce this issue. We are working on the fix for this issue which should be available in our next release.

Copy link
Contributor

This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale label Jun 23, 2024
@nick-augustine
Copy link
Author

bump

@github-actions github-actions bot removed the stale label Jun 25, 2024
Copy link
Contributor

This issue has gone 7 days without any activity and meets the project’s definition of "stale". This will be auto-closed if there is no new activity over the next 7 days. If the issue is still relevant and active, you can simply comment with a "bump" to keep it open, or add the label "not_stale". Thanks for keeping our repository healthy!

@github-actions github-actions bot added the stale label Jun 30, 2024
@EspenAlbert
Copy link
Collaborator

Looks like this has been fixed in #2349 and released in 1.17.2.

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

3 participants