Provides a resource to manage User Agent Blocking Rules.
resource "cloudflare_user_agent_blocking_rule" "example_1" {
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
mode = "js_challenge"
paused = false
description = "My description 1"
configuration {
target = "ua"
value = "Chrome"
}
}
resource "cloudflare_user_agent_blocking_rule" "example_2" {
zone_id = "0da42c8d2132a9ddaf714f9e7c920711"
mode = "challenge"
paused = true
description = "My description 22"
configuration {
target = "ua"
value = "Mozilla"
}
}
configuration
(Block List, Min: 1, Max: 1) The configuration object for the current rule. (see below for nested schema)description
(String) An informative summary of the rule.mode
(String) The action to apply to a matched request. Available values: block
, challenge
, js_challenge
, managed_challenge
.paused
(Boolean) When true, indicates that the rule is currently paused.zone_id
(String) The zone identifier to target for the resource. Modifying this attribute will force creation of a new resource.id
(String) The ID of this resource.configuration
Required:
target
(String) The configuration target for this rule. You must set the target to ua for User Agent Blocking rules.value
(String) The exact user agent string to match. This value will be compared to the received User-Agent HTTP header value.Import is supported using the following syntax:
$ terraform import cloudflare_user_agent_blocking_rule.example <zone_id>/<user_agent_blocking_rule_id>