Skip to content
Start here

Schema Validation

Schema ValidationSchemas

resource cloudflare_schema_validation_schemas

required Expand Collapse
zone_id: String

Identifier.

kind: String

The kind of the schema

name: String

A human-readable name for the schema

source: String

The raw schema, e.g., the OpenAPI schema, either as JSON or YAML

validation_enabled: Bool

An indicator if this schema is enabled

computed Expand Collapse
id: String

A unique identifier of this schema

schema_id: String

A unique identifier of this schema

created_at: Time

cloudflare_schema_validation_schemas

resource "cloudflare_schema_validation_schemas" "example_schema_validation_schemas" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  kind = "openapi_v3"
  name = "petstore schema"
  source = "<schema file contents>"
  validation_enabled = true
}

data cloudflare_schema_validation_schemas

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
schema_id?: String

UUID.

omit_source?: Bool

Omit the source-files of schemas and only retrieve their meta-data.

filter?: Attributes
validation_enabled?: Bool

Filter for enabled schemas

computed Expand Collapse
id: String

UUID.

created_at: Time
kind: String

The kind of the schema

name: String

A human-readable name for the schema

source: String

The raw schema, e.g., the OpenAPI schema, either as JSON or YAML

validation_enabled: Bool

An indicator if this schema is enabled

cloudflare_schema_validation_schemas

data "cloudflare_schema_validation_schemas" "example_schema_validation_schemas" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  schema_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
  omit_source = true
}

data cloudflare_schema_validation_schemas_list

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
validation_enabled?: Bool

Filter for enabled schemas

omit_source?: Bool

Omit the source-files of schemas and only retrieve their meta-data.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

A unique identifier of this schema

created_at: Time
kind: String

The kind of the schema

name: String

A human-readable name for the schema

schema_id: String

A unique identifier of this schema

source: String

The raw schema, e.g., the OpenAPI schema, either as JSON or YAML

validation_enabled: Bool

An indicator if this schema is enabled

cloudflare_schema_validation_schemas_list

data "cloudflare_schema_validation_schemas_list" "example_schema_validation_schemas_list" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  validation_enabled = true
}

Schema ValidationSettings

resource cloudflare_schema_validation_settings

required Expand Collapse
zone_id: String

Identifier.

validation_default_mitigation_action: String

The default mitigation action used Mitigation actions are as follows:

  • "log" - log request when request does not conform to schema
  • "block" - deny access to the site when request does not conform to schema
  • "none" - skip running schema validation
optional Expand Collapse
validation_override_mitigation_action?: String

When set, this overrides both zone level and operation level mitigation actions.

  • "none" - skip running schema validation entirely for the request
  • null - clears any existing override

cloudflare_schema_validation_settings

resource "cloudflare_schema_validation_settings" "example_schema_validation_settings" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  validation_default_mitigation_action = "block"
  validation_override_mitigation_action = "none"
}

data cloudflare_schema_validation_settings

required Expand Collapse
zone_id: String

Identifier.

computed Expand Collapse
validation_default_mitigation_action: String

The default mitigation action used

Mitigation actions are as follows:

  • log - log request when request does not conform to schema
  • block - deny access to the site when request does not conform to schema
  • none - skip running schema validation
validation_override_mitigation_action: String

When not null, this overrides global both zone level and operation level mitigation actions. This can serve as a quick way to disable schema validation for the whole zone.

  • "none" will skip running schema validation entirely for the request

cloudflare_schema_validation_settings

data "cloudflare_schema_validation_settings" "example_schema_validation_settings" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}

Schema ValidationSettingsOperations

resource cloudflare_schema_validation_operation_settings

required Expand Collapse
operation_id: String

UUID.

zone_id: String

Identifier.

mitigation_action: String

When set, this applies a mitigation action to this operation

  • "log" - log request when request does not conform to schema for this operation
  • "block" - deny access to the site when request does not conform to schema for this operation
  • "none" - will skip mitigation for this operation
  • null - clears any mitigation action

cloudflare_schema_validation_operation_settings

resource "cloudflare_schema_validation_operation_settings" "example_schema_validation_operation_settings" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  operation_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
  mitigation_action = "block"
}

data cloudflare_schema_validation_operation_settings

required Expand Collapse
operation_id: String

UUID.

zone_id: String

Identifier.

computed Expand Collapse
mitigation_action: String

When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation

  • "log" - log request when request does not conform to schema for this operation
  • "block" - deny access to the site when request does not conform to schema for this operation
  • "none" - will skip mitigation for this operation

cloudflare_schema_validation_operation_settings

data "cloudflare_schema_validation_operation_settings" "example_schema_validation_operation_settings" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  operation_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
}

data cloudflare_schema_validation_operation_settings_list

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

mitigation_action: String

When set, this applies a mitigation action to this operation which supersedes a global schema validation setting just for this operation

  • "log" - log request when request does not conform to schema for this operation
  • "block" - deny access to the site when request does not conform to schema for this operation
  • "none" - will skip mitigation for this operation
operation_id: String

UUID.

cloudflare_schema_validation_operation_settings_list

data "cloudflare_schema_validation_operation_settings_list" "example_schema_validation_operation_settings_list" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}