Skip to content

"Migration Ready" logpush jobs still fails on import, pointing to locked v4 endpoint. #6599

@orlra

Description

@orlra

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

tf 1.12.2

provider "registry.terraform.io/cloudflare/cloudflare" {
  version     = "5.15.0"

Affected resource(s)

logpush_job

Terraform configuration files

resource "cloudflare_logpush_job" "account_to_datadog" {
  account_id       = "account"
  name             = "account-to-datadog"
  dataset          = "audit_logs_v2"
  enabled          = false
  destination_conf = ""
}

resource "cloudflare_logpush_job" "dev_to_datadog" {
  zone_id          = "zone3"
  name             = "datadog"
  dataset          = "http_requests"
  enabled          = false
  destination_conf = ""
}

optional matching imports. 
most of the config does not matter.
in my case, all fields taken from WORKING logpush job.

Link to debug output

everything need in panic output field

Panic output

GET "https://api.cloudflare.com/client/v4/zones/<<this is account string>>/logpush/jobs/<<this is logpush id>>": 401 Unauthorized {
  "result": null,
  "success": false,
  "errors": [
    {
      "code": 10000,
      "message": "Unauthorized"
    }
  ],
  "messages": []
}

plan seems fine, but import/apply points to v4 API, which is locked already, and cannot do anything but plan new resource.
account nor zone, both fails separate as well, on same error

Expected output

working apply

Actual output

plan failing when import is added with 401 Unauthorized
apply fails with 403 Forbidden {"success":false,"errors":[{"code":10000,"message":"Authentication error"}]}
both try to do something with
https://api.cloudflare.com/client/v4/zones

Steps to reproduce

  1. create logpush job
  2. run apply

or

  1. try to import existing logpush job

Additional factoids

same workspace makes another 712 Resources, so I doubt its issue with credentials or access.

References

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/bugCategorizes issue or PR as related to a bug.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions