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

Updating cloudflare_list results in filters.api.invalid_json error #5016

Open
3 tasks done
devin-purple opened this issue Jan 31, 2025 · 1 comment
Open
3 tasks done
Labels
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.

Comments

@devin-purple
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

OpenTofu v1.8.7
on linux_amd64

  • provider registry.opentofu.org/cloudflare/cloudflare v5.0.0

Affected resource(s)

cloudflare_list

Terraform configuration files

resource "cloudflare_list" "test" {
  account_id  = var.account_id
  name        = "test"
  description = "test"
  kind        = "redirect"
}

Link to debug output

https://gist.github.com/devin-purple/efdf2f7e56d7f4ca093dc2ee441f26ac

Panic output

No response

Expected output

List updated

Actual output

│ Error: failed to make http request
│ 
│   with module.rules.cloudflare_list.drupal,
│   on rules/redirect.tf line 2, in resource "cloudflare_list" "drupal":
│    2: resource "cloudflare_list" "drupal" {
│ 
│ PUT "https://api.cloudflare.com/client/v4/accounts/xx/rules/lists/xx": 400 Bad Request {
│   "result": null,
│   "success": false,
│   "errors": [
│     {
│       "code": 10026,
│       "message": "filters.api.invalid_json"
│     }
│   ],
│   "messages": []
│ }

Steps to reproduce

Create an account list and attempt to update it.

Additional factoids

The API specification only allows for "description" in a PUT request.

https://developers.cloudflare.com/api/resources/rules/subresources/lists/subresources/bulk_operations/models/operation_status/#(schema)

References

No response

@devin-purple devin-purple 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 Jan 31, 2025
@bledavik
Copy link

bledavik commented Feb 5, 2025

Any updates or workarounds for this? I am having the same issue.

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. needs-triage Indicates an issue or PR lacks a `triage/foo` label and requires one.
Projects
None yet
Development

No branches or pull requests

2 participants