Skip to content

API Token 403 on zone creation #1387

Description

@abulfat-m

Confirmation

  • My issue isn't already found on the issue tracker.
  • I have replicated my issue using the latest version of the provider and it is still present.

Terraform and Cloudflare provider version

3.3.0

Affected resource(s)

cloudflare_zone

Terraform configuration files

resource "cloudflare_zone" "this" {
  zone       = var.zone_name
  paused     = var.paused
  jump_start = var.jump_start
  plan       = var.plan // = enterprise
  type       = var.type
}

Debug output

Error: error creating zone "...........com": HTTP status 400: Permission denied (1068)

with module.zone_base_config.cloudflare_zone.this[0],

on .terraform/modules/zone_base_config/zone.tf line 1, in resource "cloudflare_zone" "this":

1: resource "cloudflare_zone" "this" {

time=2022-01-13T17:32:17Z level=error msg=1 error occurred:

* exit status 1

Panic output

No response

Expected output

zone created

Actual output

Error: error creating zone "...............com": HTTP status 400: Permission denied (1068)

with module.zone_base_config.cloudflare_zone.this[0],

on .terraform/modules/zone_base_config/zone.tf line 1, in resource "cloudflare_zone" "this":

1: resource "cloudflare_zone" "this" {

time=2022-01-13T17:32:17Z level=error msg=1 error occurred:

* exit status 1

Steps to reproduce

  1. Create API Token with the following permissions:
    Account-level - Billing:Edit, Account Settings:Edit
    All zones - Zone WAF:Edit, Zone Settings:Edit, Zone:Edit, SSL and Certificates:Edit, Logs:Edit, DNS:Edit, Analytics:Read
  2. Use token in Terraform provider and try to create a zone using cloudflare_zone resource.

Additional factoids

According to #1102 and @jacobbednarz, API token should have worked.
As per Cloudflare, API Keys are considered legacy and not recommended to use, therefore we need to use API Tokens instead.

References

#1102
#1101

Metadata

Metadata

Assignees

No one assigned

    Labels

    kind/supportCategorizes issue or PR as related to user support.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions