API Gateway
API GatewayConfigurations
data cloudflare_api_shield
optional
cloudflare_api_shield
data "cloudflare_api_shield" "example_api_shield" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
normalize = true
}
API GatewayDiscoveryOperations
resource cloudflare_api_shield_discovery_operation
optional
cloudflare_api_shield_discovery_operation
resource "cloudflare_api_shield_discovery_operation" "example_api_shield_discovery_operation" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
operation_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
state = "review"
}
data cloudflare_api_shield_discovery_operations
optional
When true, only return API Discovery results that are not saved into API Shield Endpoint Management
Filter results to only include discovery results sourced from a particular discovery engine
ML- Discovered operations that were sourced using ML API DiscoverySessionIdentifier- Discovered operations that were sourced using Session Identifier API Discovery
Filter results to only include discovery results in a particular state. States are as follows
review- Discovered operations that are not saved into API Shield Endpoint Managementsaved- Discovered operations that are already saved into API Shield Endpoint Managementignored- Discovered operations that have been marked as ignored
cloudflare_api_shield_discovery_operations
data "cloudflare_api_shield_discovery_operations" "example_api_shield_discovery_operations" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
diff = true
direction = "desc"
endpoint = "/api/v1"
host = ["api.cloudflare.com"]
method = ["GET"]
order = "method"
origin = "ML"
state = "review"
}
API GatewayOperations
resource cloudflare_api_shield_operation
required
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/.
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
optional
computed
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/.
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
optional
Field to order by. When requesting a feature, the feature keys are available for ordering as well, e.g., thresholds.suggested_threshold.
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"
}
API GatewayOperationsSchema Validation
resource cloudflare_api_shield_operation_schema_validation_settings
optional
When set, this applies a mitigation action to this operation
loglog request when request does not conform to schema for this operationblockdeny access to the site when request does not conform to schema for this operationnonewill skip mitigation for this operationnullindicates 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
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
computed
When set, this applies a mitigation action to this operation
loglog request when request does not conform to schema for this operationblockdeny access to the site when request does not conform to schema for this operationnonewill skip mitigation for this operationnullindicates 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"
}
API GatewaySettingsSchema Validation
resource cloudflare_api_shield_schema_validation_settings
required
The default mitigation action used when there is no mitigation action defined on the operation
Mitigation actions are as follows:
log- log request when request does not conform to schemablock- deny access to the site when request does not conform to schema
A special value of of none will skip running schema validation entirely for the request when there is no mitigation action defined on the operation
optional
When set, this overrides both zone level and operation level mitigation actions.
nonewill skip running schema validation entirely for the requestnullindicates that no override is in place
To clear any override, use the special value disable_override or null
cloudflare_api_shield_schema_validation_settings
resource "cloudflare_api_shield_schema_validation_settings" "example_api_shield_schema_validation_settings" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
validation_default_mitigation_action = "block"
validation_override_mitigation_action = "none"
}
data cloudflare_api_shield_schema_validation_settings
computed
The default mitigation action used when there is no mitigation action defined on the operation
Mitigation actions are as follows:
log- log request when request does not conform to schemablock- deny access to the site when request does not conform to schema
A special value of of none will skip running schema validation entirely for the request when there is no mitigation action defined on the operation
cloudflare_api_shield_schema_validation_settings
data "cloudflare_api_shield_schema_validation_settings" "example_api_shield_schema_validation_settings" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
}
API GatewayUser Schemas
resource cloudflare_api_shield_schema
optional
cloudflare_api_shield_schema
resource "cloudflare_api_shield_schema" "example_api_shield_schema" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
file = "Example data"
kind = "openapi_v3"
name = "petstore schema"
validation_enabled = "true"
}
data cloudflare_api_shield_schema
cloudflare_api_shield_schema
data "cloudflare_api_shield_schema" "example_api_shield_schema" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
schema_id = "f174e90a-fafe-4643-bbbc-4a0ed4fc8415"
omit_source = true
}
data cloudflare_api_shield_schemas
optional
cloudflare_api_shield_schemas
data "cloudflare_api_shield_schemas" "example_api_shield_schemas" {
zone_id = "023e105f4ecef8ad9ca31a8372d0c353"
validation_enabled = true
}