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

Error for cloudflare_list_item when same hostname but different path #3269

Closed
2 tasks done
7jPUn4w8caDX opened this issue Apr 25, 2024 · 2 comments · Fixed by #3303
Closed
2 tasks done

Error for cloudflare_list_item when same hostname but different path #3269

7jPUn4w8caDX opened this issue Apr 25, 2024 · 2 comments · Fixed by #3303
Labels
kind/bug Categorizes issue or PR as related to a bug. service/lists Categorizes issue or PR as related to the Lists service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced
Milestone

Comments

@7jPUn4w8caDX
Copy link

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

Terraform v1.6.6
on darwin_amd64

  • provider registry.terraform.io/cloudflare/cloudflare v4.30.0

Affected resource(s)

cloudflare_list_item

Terraform configuration files

resource "cloudflare_list" "test_redirect_list" {
  account_id  = var.cloudflare_account_id
  name        = "test_redirect_list"
  description = "Test Redirect List"
  kind        = "redirect"
}

resource "cloudflare_list_item" "item_1" {
  account_id = var.cloudflare_account_id
  list_id    = cloudflare_list.test_redirect_list.id
  redirect {
    source_url  = "www.site1.com/"
    target_url  = "https://www.cisco.com/"
    status_code = 301
  }
}

resource "cloudflare_list_item" "item_2" {
  account_id = var.cloudflare_account_id
  list_id    = cloudflare_list.test_redirect_list.id
  redirect {
    source_url  = "www.site1.com/cloudflare/"
    target_url  = "https://www.cloudflare.com/"
    status_code = 301
  }
}

Link to debug output

https://gist.github.com/7jPUn4w8caDX/b41ae88c7efdabbd716cfda15b5c3dd7

Panic output


│ Error: failed to create list item:

│ with cloudflare_list_item.item_1,
│ on main.tf line 9, in resource "cloudflare_list_item" "item_1":
│ 9: resource "cloudflare_list_item" "item_1" {

│ failed to match exactly one list item: %!w()

Expected output

Terraform to complete the creation of two Redirect items inside a list with no issues.

Actual output

Terraform apply fails with the provided message. However the Cloudflare GUI shows the changes took place as desired.

Steps to reproduce

  1. Create a new file with the code, and perform a terraform apply
  2. terraform will fail
  3. Cloudflare dashboard will show that the changes took place, and they work as expected.

Additional factoids

No response

References

No response

@7jPUn4w8caDX 7jPUn4w8caDX 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 Apr 25, 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.

@github-actions github-actions bot added the triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. label Apr 25, 2024
@jacobbednarz jacobbednarz added triage/accepted Indicates an issue or PR is ready to be actively worked on. service/lists Categorizes issue or PR as related to the Lists service. and removed needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one. service/lists Categorizes issue or PR as related to the Lists service. labels Apr 26, 2024
jacobbednarz added a commit that referenced this issue May 13, 2024
Updates the functionality used for fetching the individual list item
identifiers to include a retry should the result not be an exact match.

This should handle the situations better where a large batch operation
is created and takes some time behind the scenes to complete the
polling operation.

Closes #3269
jacobbednarz added a commit that referenced this issue May 13, 2024
Updates the functionality used for fetching the individual list item
identifiers to include a retry should the result not be an exact match.

This should handle the situations better where a large batch operation
is created and takes some time behind the scenes to complete the
polling operation.

Closes #3269
@github-actions github-actions bot added this to the v4.33.0 milestone May 13, 2024
Copy link
Contributor

This functionality has been released in v4.33.0 of the Terraform Cloudflare Provider.

Please see the Terraform documentation on provider versioning or reach out if you need any assistance upgrading.

For further feature requests or bug reports with this functionality, please create a new GitHub issue following the template. Thank you!

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 15, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
kind/bug Categorizes issue or PR as related to a bug. service/lists Categorizes issue or PR as related to the Lists service. triage/accepted Indicates an issue or PR is ready to be actively worked on. triage/debug-log-attached Indicates an issue or PR has a complete Terraform debug log. workflow/synced
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants