» cloudflare_zone_settings_override

Provides a resource which customizes Cloudflare zone settings. Note that after destroying this resource Zone Settings will be reset to their initial values.

» Example Usage

resource "cloudflare_zone_settings_override" "test" {
    zone_id = var.cloudflare_zone_id
    settings {
        brotli = "on"
        challenge_ttl = 2700
        security_level = "high"
        opportunistic_encryption = "on"
        automatic_https_rewrites = "on"
        mirage = "on"
        waf = "on"
        minify {
            css = "on"
            js = "off"
            html = "off"
        security_header {
            enabled = true

» Argument Reference

The following arguments are supported:

  • zone_id - (Required) The DNS zone ID to which apply settings.
  • settings - (Optional) Settings overrides that will be applied to the zone. If a setting is not specified the existing setting will be used. For a full list of available settings see below.

The settings block supports settings that may be applied to the zone. These may be on/off values, unitary fields, string values, integers or nested objects.

» Plan-Dependent Settings

Note that some settings are only available on certain plans. Setting an argument for a feature that is not available on the plan configured for the zone will result in an error:

Error: invalid zone setting "<argument>" (value: <value>) found - cannot be set as it is read only

This is true even when setting the argument to its default value. These values should either be omitted or set to null for zones with plans that don't support the feature. See the plan feature matrices for details on feature support by plan.

» On/Off Values

These can be specified as "on" or "off" string. Similar to boolean values, but here the empty string also means to use the existing value. Attributes available:

» String Values

  • cache_level. Allowed values: "aggressive" (default) - delivers a different resource each time the query string changes, "basic" - delivers resources from cache when there is no query string, "simplified" - delivers the same resource to everyone independent of the query string.
  • cname_flattening. Allowed values: "flatten_at_root" (default), "flatten_all", "flatten_none".
  • h2_prioritization. Allowed values: "on", "off" (default), "custom".
  • image_resizing. Allowed values: "on", "off" (default), "open".
  • min_tls_version. Allowed values: "1.0" (default), "1.1", "1.2", "1.3".
  • polish. Allowed values: "off" (default), "lossless", "lossy".
  • pseudo_ipv4. Allowed values: "off" (default), "add_header", "overwrite_header".
  • security_level. Allowed values: "off" (Enterprise only), "essentially_off", "low", "medium" (default), "high", "under_attack".
  • ssl. Allowed values: "off" (default), "flexible", "full", "strict", "origin_pull".
  • tls_1_3. Allowed values: "off" (default), "on", "zrt".

» Integer Values

» Nested Objects

The minify attribute supports the following fields:

  • css (Required) "on"/"off"
  • html (Required) "on"/"off"
  • js (Required)"on"/"off"

The mobile_redirect attribute supports the following fields:

The security_header attribute supports the following fields:

» Attributes Reference

The following attributes are exported:

  • id - The zone ID.
  • initial_settings - Settings present in the zone at the time the resource is created. This will be used to restore the original settings when this resource is destroyed. Shares the same schema as the settings attribute (Above).
  • intial_settings_read_at - Time when this resource was created and the initial_settings were set.
  • readonly_settings - Which of the current settings are not able to be set by the user. Which settings these are is determined by plan level and user permissions.
  • zone_status. A full zone implies that DNS is hosted with Cloudflare. A partial zone is typically a partner-hosted zone or a CNAME setup.
  • zone_type. Status of the zone. Valid values: active, pending, initializing, moved, deleted, deactivated.