Skip to content
Start here

Operations

resource cloudflare_api_shield_operation

required Expand Collapse
zone_id: String

Identifier.

endpoint: String

The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.

host: String

RFC3986-compliant host.

method: String

The HTTP method used to access the endpoint.

computed Expand Collapse
id: String

UUID.

operation_id: String

UUID.

last_updated: Time
features: Attributes
thresholds: Attributes
auth_id_tokens: Int64

The total number of auth-ids seen across this calculation.

data_points: Int64

The number of data points used for the threshold suggestion calculation.

last_updated: Time
p50: Int64

The p50 quantile of requests (in period_seconds).

p90: Int64

The p90 quantile of requests (in period_seconds).

p99: Int64

The p99 quantile of requests (in period_seconds).

period_seconds: Int64

The period over which this threshold is suggested.

requests: Int64

The estimated number of requests covered by these calculations.

suggested_threshold: Int64

The suggested threshold in requests done by the same auth_id or period_seconds.

parameter_schemas: Attributes
last_updated: Time
parameter_schemas: Attributes

An operation schema object containing a response.

parameters: List[JSON]

An array containing the learned parameter schemas.

responses: JSON

An empty response object. This field is required to yield a valid operation schema.

api_routing: Attributes

API Routing settings on endpoint.

last_updated: Time
route: String

Target route.

confidence_intervals: Attributes
last_updated: Time
suggested_threshold: Attributes
confidence_intervals: Attributes
p90: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

p95: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

p99: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

mean: Float64

Suggested threshold.

schema_info: Attributes
active_schema: Attributes

Schema active on endpoint.

id: String

UUID.

created_at: Time
is_learned: Bool

True if schema is Cloudflare-provided.

name: String

Schema file name.

learned_available: Bool

True if a Cloudflare-provided learned schema is available for this endpoint.

mitigation_action: String

Action taken on requests failing validation.

cloudflare_api_shield_operation

resource "cloudflare_api_shield_operation" "example_api_shield_operation" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  endpoint = "/api/v1/users/{var1}"
  host = "www.example.com"
  method = "GET"
}

data cloudflare_api_shield_operation

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
operation_id?: String

UUID.

feature?: List[String]

Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.

filter?: Attributes
direction?: String

Direction to order results.

endpoint?: String

Filter results to only include endpoints containing this pattern.

feature?: List[String]

Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.

host?: List[String]

Filter results to only include the specified hosts.

method?: List[String]

Filter results to only include the specified HTTP methods.

order?: String

Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., thresholds.suggested_threshold.

computed Expand Collapse
id: String

UUID.

endpoint: String

The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.

host: String

RFC3986-compliant host.

last_updated: Time
method: String

The HTTP method used to access the endpoint.

features: Attributes
thresholds: Attributes
auth_id_tokens: Int64

The total number of auth-ids seen across this calculation.

data_points: Int64

The number of data points used for the threshold suggestion calculation.

last_updated: Time
p50: Int64

The p50 quantile of requests (in period_seconds).

p90: Int64

The p90 quantile of requests (in period_seconds).

p99: Int64

The p99 quantile of requests (in period_seconds).

period_seconds: Int64

The period over which this threshold is suggested.

requests: Int64

The estimated number of requests covered by these calculations.

suggested_threshold: Int64

The suggested threshold in requests done by the same auth_id or period_seconds.

parameter_schemas: Attributes
last_updated: Time
parameter_schemas: Attributes

An operation schema object containing a response.

parameters: List[JSON]

An array containing the learned parameter schemas.

responses: JSON

An empty response object. This field is required to yield a valid operation schema.

api_routing: Attributes

API Routing settings on endpoint.

last_updated: Time
route: String

Target route.

confidence_intervals: Attributes
last_updated: Time
suggested_threshold: Attributes
confidence_intervals: Attributes
p90: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

p95: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

p99: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

mean: Float64

Suggested threshold.

schema_info: Attributes
active_schema: Attributes

Schema active on endpoint.

id: String

UUID.

created_at: Time
is_learned: Bool

True if schema is Cloudflare-provided.

name: String

Schema file name.

learned_available: Bool

True if a Cloudflare-provided learned schema is available for this endpoint.

mitigation_action: String

Action taken on requests failing validation.

cloudflare_api_shield_operation

data "cloudflare_api_shield_operation" "example_api_shield_operation" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  operation_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
  feature = ["thresholds"]
}

data cloudflare_api_shield_operations

required Expand Collapse
zone_id: String

Identifier.

optional Expand Collapse
direction?: String

Direction to order results.

endpoint?: String

Filter results to only include endpoints containing this pattern.

order?: String

Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., thresholds.suggested_threshold.

feature?: List[String]

Add feature(s) to the results. The feature name that is given here corresponds to the resulting feature object. Have a look at the top-level object description for more details on the specific meaning.

host?: List[String]

Filter results to only include the specified hosts.

method?: List[String]

Filter results to only include the specified HTTP methods.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

UUID.

endpoint: String

The endpoint which can contain path parameter templates in curly braces, each will be replaced from left to right with {varN}, starting with {var1}, during insertion. This will further be Cloudflare-normalized upon insertion. See: https://developers.cloudflare.com/rules/normalization/how-it-works/.

host: String

RFC3986-compliant host.

last_updated: Time
method: String

The HTTP method used to access the endpoint.

operation_id: String

UUID.

features: Attributes
thresholds: Attributes
auth_id_tokens: Int64

The total number of auth-ids seen across this calculation.

data_points: Int64

The number of data points used for the threshold suggestion calculation.

last_updated: Time
p50: Int64

The p50 quantile of requests (in period_seconds).

p90: Int64

The p90 quantile of requests (in period_seconds).

p99: Int64

The p99 quantile of requests (in period_seconds).

period_seconds: Int64

The period over which this threshold is suggested.

requests: Int64

The estimated number of requests covered by these calculations.

suggested_threshold: Int64

The suggested threshold in requests done by the same auth_id or period_seconds.

parameter_schemas: Attributes
last_updated: Time
parameter_schemas: Attributes

An operation schema object containing a response.

parameters: List[JSON]

An array containing the learned parameter schemas.

responses: JSON

An empty response object. This field is required to yield a valid operation schema.

api_routing: Attributes

API Routing settings on endpoint.

last_updated: Time
route: String

Target route.

confidence_intervals: Attributes
last_updated: Time
suggested_threshold: Attributes
confidence_intervals: Attributes
p90: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

p95: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

p99: Attributes

Upper and lower bound for percentile estimate

lower: Float64

Lower bound for percentile estimate

upper: Float64

Upper bound for percentile estimate

mean: Float64

Suggested threshold.

schema_info: Attributes
active_schema: Attributes

Schema active on endpoint.

id: String

UUID.

created_at: Time
is_learned: Bool

True if schema is Cloudflare-provided.

name: String

Schema file name.

learned_available: Bool

True if a Cloudflare-provided learned schema is available for this endpoint.

mitigation_action: String

Action taken on requests failing validation.

cloudflare_api_shield_operations

data "cloudflare_api_shield_operations" "example_api_shield_operations" {
  zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
  direction = "desc"
  endpoint = "/api/v1"
  feature = ["thresholds"]
  host = ["api.cloudflare.com"]
  method = ["GET"]
  order = "method"
}

OperationsSchema Validation

resource cloudflare_api_shield_operation_schema_validation_settings

required Expand Collapse
operation_id: String

UUID.

zone_id: String

Identifier.

optional Expand Collapse
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 indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied
computed Expand Collapse
id: String

UUID.

cloudflare_api_shield_operation_schema_validation_settings

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

data cloudflare_api_shield_operation_schema_validation_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

  • 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 indicates that no operation level mitigation is in place, see Zone Level Schema Validation Settings for mitigation action that will be applied

cloudflare_api_shield_operation_schema_validation_settings

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