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

cloudflare_list purges if no IP is being added #4742

Open
3 tasks done
lifeofguenter opened this issue Dec 10, 2024 · 3 comments
Open
3 tasks done

cloudflare_list purges if no IP is being added #4742

lifeofguenter opened this issue Dec 10, 2024 · 3 comments
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.

Comments

@lifeofguenter
Copy link

Confirmation

  • This is a bug with an existing resource and is not a feature request or enhancement. Feature requests should be submitted with Cloudflare Support or your account team.
  • I have searched the issue tracker and my issue isn't already found.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Applying the following:

Terraform will perform the following actions:

  # cloudflare_list.known_ip will be updated in-place
  ~ resource "cloudflare_list" "known_ip" {
        id         = "123"
        name       = "known_ip"
        # (2 unchanged attributes hidden)
    }

  # cloudflare_list.office_ip will be updated in-place
  ~ resource "cloudflare_list" "office_ip" {
        id         = "abc"
        name       = "office_ip"
        # (2 unchanged attributes hidden)
    }

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

will actually purge all cloudflare_list_item - evne though not indicated by the plan output

Affected resource(s)

  • cloudflare_list
  • cloudflare_list_item

Terraform configuration files

resource "cloudflare_list" "known_ip" {
  account_id = "abc"
  name       = "known_ip"
  kind       = "ip"
}

locals {
  natgw_ips = [
    for ip in module.network.natgw_ips : split("/", ip)[0]
  ]

  known_ips = compact(concat([
    # https://docs.sentry.io/security-legal-pii/security/ip-ranges/
    "34.141.31.19",         # sentry.io EU
    "34.141.4.162",         # sentry.io EU
    "35.234.78.236",        # sentry.io EU
  ], local.natgw_ips))
}

resource "cloudflare_list_item" "known_ips" {
  for_each   = toset(local.known_ips)
  account_id = cloudflare_list.known_ip.account_id
  list_id    = cloudflare_list.known_ip.id
  comment    = "Known IP"
  ip         = each.value
}

Link to debug output

n/a

Panic output

No response

Expected output

no changes

Actual output

changes

Steps to reproduce

n/a

Additional factoids

No response

References

No response

@lifeofguenter lifeofguenter added kind/bug Categorizes issue or PR as related to a bug. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 10, 2024
Copy link
Contributor

Thank you for reporting this issue! For maintainers to dig into issues it is required that all issues include the entirety of TF_LOG=DEBUG output to be provided. The only parts that should be redacted are your user credentials in the X-Auth-Key, X-Auth-Email and Authorization HTTP headers. Details such as zone or account identifiers are not considered sensitive but can be redacted if you are very cautious. This log file provides additional context from Terraform, the provider and the Cloudflare API that helps in debugging issues. Without it, maintainers are very limited in what they can do and may hamper diagnosis efforts.

This issue has been marked with triage/needs-information and is unlikely to receive maintainer attention until the log file is provided making this a complete bug report.

@github-actions github-actions bot added triage/needs-information Indicates an issue needs more information in order to work on it. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. labels Dec 10, 2024
Copy link
Contributor

Community Note

Voting for Prioritization

  • Please vote on this issue by adding a 👍 reaction to the original post to help the community and maintainers prioritize this request.
  • Please do not leave "+1" or other comments that do not add relevant new information or questions, they generate extra noise for issue followers and do not help prioritize the request.

Volunteering to Work on This Issue

  • If you are interested in working on this issue, please leave a comment.
  • If this would be your first contribution, please review the contribution guide.

Copy link
Contributor

Thank you for opening this issue and sorry to hear you're hitting issues. Unfortunately, the reproduction case provided contains HCL dynamic expressions. Examples of these are:

Maintainers don't accept these as reproduction cases since using these constructs and expressions can hold their own logic bugs which are outside of the provider and not able to be diagnosed.

For maintainers to triage this issue, we recommend providing a minimal reproduction test case that is only contains the impacted resources and can be easily reproduced in an isolated environment. Without providing this, maintainers are limited in what support they can provide.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. triage/needs-information Indicates an issue needs more information in order to work on it.
Projects
None yet
Development

No branches or pull requests

1 participant