Terraform-provider-cloudflare: h2_prioritization: "cannot be set as it is read only"

Created on 11 Dec 2019  路  6Comments  路  Source: cloudflare/terraform-provider-cloudflare

Hi there,

Thank you for opening an issue. Please note that we try to keep the Terraform issue tracker reserved for bug reports and feature requests. For general usage questions, please see: https://www.terraform.io/community.html.

Terraform Version

Terraform v0.12.12
provider.cloudflare v2.2.0

Affected Resource(s)

  • cloudflare_zone_settings_override

Terraform Configuration Files

zone.tf:

provider "cloudflare" {
  version    = "~> 2.0"
  email      = "${var.cloudflare_email}"
  api_key    = "${var.cloudflare_token}"
  account_id = "${var.account_id}"
}

terraform {
  required_version = "~> 0.12.0"

  backend "remote" {
    hostname     = "app.terraform.io"
    organization = "<redacted>"

    workspaces {
      name = "<redacted>"
    }
  }
}

# Create the zone
resource "cloudflare_zone" "zone" {
  zone = "${var.zone}.com"
  plan = "enterprise"
  type = "partial"
}

vars.tf

variable "cloudflare_email" {}

variable "cloudflare_token" {}

variable "zone" {}

variable "account_id" {}

settings.tf

resource "cloudflare_zone_settings_override" "zone" {
  zone_id = "${cloudflare_zone.zone.id}"

  settings {
    always_use_https            = "on"
    waf                         = "on"
    http2                       = "on"
    min_tls_version             = "1.2"
    brotli                      = "on"
    polish                      = "lossless"
    webp                        = "on"
    security_level              = "high"
    opportunistic_encryption    = "on"
    automatic_https_rewrites    = "on"
    ssl                         = "full"
    sort_query_string_for_cache = "on"
    always_online               = "off"
    h2_prioritization           = "on"
    minify {
      css  = "on"
      js   = "on"
      html = "on"
    }
  }
}
...

Debug Output

https://gist.github.com/stractenberg-newell/31f1a37c4b46f58668b2a726294cf351

Panic Output

If Terraform produced a panic, please provide a link to a GitHub Gist containing the output of the crash.log.

Expected Behavior

It should enable "Enhanced HTTP/2 Prioritization"

Actual Behavior

Error: invalid zone setting "h2_prioritization" (value: on) found - cannot be set as it is read only

  on settings.tf line 2, in resource "cloudflare_zone_settings_override" "zone":
   2: resource "cloudflare_zone_settings_override" "zone" {

Steps to Reproduce

  1. Set h2_prioritization = "on"
  2. terraform apply

Important Factoids

I've reproduced this on several CF zones. If I manually turn Enhanced HTTP/2 Prioritization on via the console, then turn it off again, Terraform is then able to enable it. But it can't do it the first time by itself.

References

n/a

kinbug upstream

All 6 comments

What version of the Cloudflare provider are you using?

provider.cloudflare v2.2.0

happened with me as well. strangely re applying works

I can rerun 'terraform apply' over and over and it will never succeed for me. Until I manually enable/disable it in the CF console. Had to do this again just now (and will need to 9 more times next week)...

I'm also seeing this with v2.3.0 of the provider and a definition like this, which doesn't make any reference to h2_prioritization:

resource "cloudflare_zone_settings_override" "waf" {
  zone_id = var.zone_id

  settings {
    waf = var.waf_enabled ? "on" : "off"
  }
}

The issue should be fixed upstream. Please re-open if still occurs.

Was this page helpful?
0 / 5 - 0 ratings