Terraform-provider-cloudflare: Failed to create CloudFlare Record: API Error: Zone does not exist.

Created on 13 Jun 2017  路  16Comments  路  Source: cloudflare/terraform-provider-cloudflare

_This issue was originally opened by @JorritSalverda as hashicorp/terraform#2551. It was migrated here as part of the provider split. The original body of the issue is below._


In a CloudFlare multi-user organizational account no single user owns the data, but only has access rights to it, while it's owned by the organization. This causes zones seemingly not to exist when you try to add a record using one of the users and their api key.

The old api (https://www.cloudflare.com/docs/client-api.html) does not support the multi-user model, where the new one (https://api.cloudflare.com/) does.

I see the https://github.com/pearkes/cloudflare/ provider still uses the old api. Should I raise this issue with pearkes?

kinbug

All 16 comments

_This comment was originally opened by @ziggythehamster as https://github.com/hashicorp/terraform/issues/2551#issuecomment-213642913. It was migrated here as part of the provider split. The original comment is below._


I'm subscribing here as well - the upstream API used for CloudFlare (pearkes/cloudflare) prohibits Terraform from supporting the other APIs that CloudFlare exposes, like page rules (which would be the exact kind of thing that you'd want to manage with Terraform).

_This comment was originally opened by @Turneliusz as https://github.com/hashicorp/terraform/issues/2551#issuecomment-216224109. It was migrated here as part of the provider split. The original comment is below._


Would be great to update

_This comment was originally opened by @LoicAG as https://github.com/hashicorp/terraform/issues/2551#issuecomment-216573983. It was migrated here as part of the provider split. The original comment is below._


This is an issue for us as well

_This comment was originally opened by @stack72 as https://github.com/hashicorp/terraform/issues/2551#issuecomment-235451340. It was migrated here as part of the provider split. The original comment is below._


Hi all

The cloudflare provider now uses the official cloudflare API - please can you tell me if this is still an error?

Thanks

Paul

_This comment was originally opened by @craigedmunds as https://github.com/hashicorp/terraform/issues/2551#issuecomment-237246622. It was migrated here as part of the provider split. The original comment is below._


This is still an issue in Terraform 0.7.0, I believe it's the same issue. I get:

  • cloudflare_record.cf_dns: Error finding zone ":domain:": ListZones command failed: 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}"

_This comment was originally opened by @craigedmunds as https://github.com/hashicorp/terraform/issues/2551#issuecomment-241760673. It was migrated here as part of the provider split. The original comment is below._


Hey @stack72 not sure if you've seen this - worth removing the "waiting-response" label?

_This comment was originally opened by @pasali as https://github.com/hashicorp/terraform/issues/2551#issuecomment-256014077. It was migrated here as part of the provider split. The original comment is below._


@stack72 i guess i am getting same error in Terraform v0.7.7
Error finding zone "example.com": Zone could not be found

@patryk either this is fixed generally or works when one provides the org_id flag in the provider config. either way I think this is safe to close given a year with no update and others are hitting any issues now.

Yeah, I believe it should not happen anymore, but if it does, better to have fresh report opened. Closing as stale.

the error is still persisting using the latest terraform version v0.11.8

Can you please provide more details? Also please ensure you are using the latest version of our provider: v1.4.0

It appears that I am running into this issue as well.

Terraform v0.11.10

  • provider.archive v1.1.0
  • provider.aws v1.40.0
  • provider.cloudflare v1.7.0
  • provider.template v1.0.0

cloudflare.tf

provider "cloudflare" {
  email = "[email protected]"
  token = "<my-cloudflare-global-key>"
}

resource "cloudflare_record" "test" {
  name    = "test.mydomain.com"
  domain  = "<mydomain-zone-id>"
  type    = "TXT"
  ttl     = "600"
  value   = "hello"
}

Results:

```
cloudflare_record.test: 1 error(s) occurred:

  • cloudflare_record.test: Error finding zone "": Zone could not be found

```

Thoughts?

You need to use zone name, not ID. We will soon do a refactor that will allow using zone IDs directly.

Yep, that did it... changing it to my-domain.com instead of the Zone ID worked. Thanks!

This error seems to now once again exist in the cloudflare 1.9 provider. When I've attempted an import, I get: "Zone could not be found"

I've downgraded to the 1.8 version, and the import works just fine.

@JasonM-mwh can you please open a new issue using the issue template provided and we can take a look? thanks!

Was this page helpful?
0 / 5 - 0 ratings