cloudflare / terraform-provider-cloudflare

Cloudflare Terraform Provider
https://registry.terraform.io/providers/cloudflare/cloudflare
Mozilla Public License 2.0
770 stars 597 forks source link

[CONFIG] Cloudflare -> Datadog Logpush job fails with "Key is Missing" error #2181

Closed samvanryssegem-qz closed 1 year ago

samvanryssegem-qz commented 1 year ago

Confirmation

Terraform and Cloudflare provider version

Terraform v1.3.2 on darwin_amd64

Affected resource(s)

cloudflare_logpush_job

Terraform configuration files

resource "cloudflare_logpush_job" "datadog_http_requests" {
  enabled          = true
  zone_id          = var.zone_id
  name             = "datadog-http-requests"
  logpull_options  = "fields=BotScore,CacheCacheStatus,ClientCountry,ClientDeviceType,ClientIP,ClientRegionCode,ClientRequestHost,ClientRequestMethod,ClientRequestPath,ClientRequestURI,ClientRequestUserAgent,EdgeResponseStatus,EdgeStartTimestamp&timestamps=rfc3339,EdgeTimeToFirstByteMs,OriginResponseDurationMs,OriginResponseStatus,ZoneName"
  destination_conf = "datadog://http-intake.logs.us5.datadoghq.com/api/v2/logs?header_DD-API-KEY=${var.dd_api_key}&ddsource=cloudflare&service=cloudflare&ddtags=env:prod"
  dataset          = "http_requests"
  filter           = "{\"key\":\"ClientCountry\",\"operator\":\"!eq\",\"value\":\"us\"}"
}

Link to debug output

https://gist.github.com/samvanryssegem-qz/961e442c6907096595fe8af5df41a877

Panic output

No response

Expected output

The logpush job to be created

Actual output

My terraform cloud run ended with the following error.

Error: error parsing logpush job from resource: Key is missing

Steps to reproduce

1.) Create terraform and run in tf cloud

Additional factoids

I've double-checked and my api key variable is set. Maybe I'm setting up the destination incorrectly?

References

No response

github-actions[bot] commented 1 year ago

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[bot] commented 1 year ago

Marking this issue as stale due to 30 days of inactivity. This helps our maintainers find and focus on the active issues. If this issue receives no comments in the next 7 days it will automatically be closed. Maintainers can also remove the lifecycle/stale label. If this issue was automatically closed and you feel this issue should be reopened, we encourage creating a new issue linking back to this one for added context. Thank you!

github-actions[bot] commented 1 year ago

This issue was closed because it has been stalled for 7 days with no activity.

lra commented 1 year ago

This just happened to us with Terraform v1.4.6 and cloudflare/cloudflare v4.6.0.