Terraform-provider-cloudflare: Invalid format for X-Auth-Key header

Created on 17 Apr 2020  Â·  3Comments  Â·  Source: cloudflare/terraform-provider-cloudflare

Hi,

I am currently getting the below error message when attempting to use any resource/data source with the cloudflare provider.

Error: error listing Zone: error from makeRequest: HTTP status 400: content "{\"success\":false,\"errors\":[{\"code\":6003,\"message\":\"Invalid request headers\",\"error_chain\":[{\"code\":6103,\"message\":\"Invalid format for X-Auth-Key header\"}]}],\"messages\":[],\"result\":null}"

Terraform Version

  • Terraform v0.12.24
  • provider.cloudflare v2.5.1

Affected Resource(s)

All resources

If this issue appears to affect multiple resources, it may be an issue with Terraform's core, so please mention this.

Terraform Configuration Files

provider "cloudflare" {
  email = "<EMAIL>"
  api_key = "<API KEY>"
}


data "cloudflare_zones" "test" {
  filter {
    name   = "test.domain"
    status = "active"
    paused = false
  }
}

output "cloudflare-test" {
  value = data.cloudflare_zones.test.id
}

Debug Information

https://gist.github.com/brucedvgw/49654423972b7cebec1244591bc3bd58

Expected Behavior

Provide a response output of the zone id of the requested domain

Actual Behavior

Error returned above.

Steps to Reproduce

Please list the steps required to reproduce the issue, for example:

  1. terraform apply

Important Factoids

I have tried with configurations and credentials previously that previously worked and still receiving the same error.

Most helpful comment

Hi @jacobbednarz you are correct it was the wrong use of API Key, it should have been token

All 3 comments

I’m unable to reproduce this issue given the test case above. Can you confirm your using an API key and not an API token as the value?

Hi @jacobbednarz you are correct it was the wrong use of API Key, it should have been token

Thanks, I’ll add a new issue to add some validation to the API key and API
token to see if we can catch this earlier.

On Sun, 19 Apr 2020 at 13:29, brucedvgw notifications@github.com wrote:

Hi @jacobbednarz https://github.com/jacobbednarz you are correct it was
the wrong use of API Key, it should have been token

—
You are receiving this because you were mentioned.

Reply to this email directly, view it on GitHub
https://github.com/terraform-providers/terraform-provider-cloudflare/issues/657#issuecomment-616018478,
or unsubscribe
https://github.com/notifications/unsubscribe-auth/AACFEYXTBJCM4YF5SAZOVQLRNJVYNANCNFSM4MKWNKAA
.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

lneves75 picture lneves75  Â·  5Comments

gmsantos picture gmsantos  Â·  7Comments

Nmishin picture Nmishin  Â·  7Comments

DingGGu picture DingGGu  Â·  3Comments

quinlanj picture quinlanj  Â·  4Comments