cloudflare_zone_lockdown (Resource)

Provides a Cloudflare Zone Lockdown resource. Zone Lockdown allows you to define one or more URLs (with wildcard matching on the domain or path) that will only permit access if the request originates from an IP address that matches a safelist of one or more IP addresses and/or IP ranges.

Example Usage

# Restrict access to these endpoints to requests from a known IP address range.
resource "cloudflare_zone_lockdown" "example" {
  zone_id     = "0da42c8d2132a9ddaf714f9e7c920711"
  paused      = "false"
  description = "Restrict access to these endpoints to requests from a known IP address range"
  urls = [
    "api.mysite.com/some/endpoint*",
  ]
  configurations {
    target = "ip_range"
    value  = "192.0.2.0/24"
  }
}

Schema

Required

Optional

Read-Only

Nested Schema for configurations

Required:

Import

Import is supported using the following syntax:

$ terraform import cloudflare_zone_lockdown.example <zone_id>/<lockdown_id>