Skip to content
Start here

Turnstile

TurnstileWidgets

resource cloudflare_turnstile_widget

required Expand Collapse
account_id: String

Identifier

mode: String

Widget Mode

name: String

Human readable widget name. Not unique. Cloudflare suggests that you set this to a meaningful string to make it easier to identify your widget, and where it is used.

domains: List[String]
optional Expand Collapse
bot_fight_mode?: Bool

If bot_fight_mode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).

clearance_level?: String

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

ephemeral_id?: Bool

Return the Ephemeral ID in /siteverify (ENT only).

offlabel?: Bool

Do not show any Cloudflare branding on the widget (ENT only).

region?: String

Region where this widget can be used. This cannot be changed after creation.

computed Expand Collapse
id: String

Widget item identifier tag.

sitekey: String

Widget item identifier tag.

created_on: Time

When the widget was created.

modified_on: Time

When the widget was modified.

secret: String

Secret key for this widget.

cloudflare_turnstile_widget

resource "cloudflare_turnstile_widget" "example_turnstile_widget" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  domains = ["203.0.113.1", "cloudflare.com", "blog.example.com"]
  mode = "invisible"
  name = "blog.cloudflare.com login form"
  bot_fight_mode = false
  clearance_level = "interactive"
  ephemeral_id = false
  offlabel = false
  region = "world"
}

data cloudflare_turnstile_widget

required Expand Collapse
account_id: String

Identifier

optional Expand Collapse
sitekey?: String

Widget item identifier tag.

filter?: Attributes
direction?: String

Direction to order widgets.

filter?: String

Filter widgets by field using case-insensitive substring matching. Format: field:value

Supported fields:

  • name - Filter by widget name (e.g., filter=name:login-form)
  • sitekey - Filter by sitekey (e.g., filter=sitekey:0x4AAA)

Returns 400 Bad Request if the field is unsupported or format is invalid. An empty filter value returns all results.

order?: String

Field to order widgets by.

computed Expand Collapse
id: String

Widget item identifier tag.

bot_fight_mode: Bool

If bot_fight_mode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).

clearance_level: String

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

created_on: Time

When the widget was created.

ephemeral_id: Bool

Return the Ephemeral ID in /siteverify (ENT only).

mode: String

Widget Mode

modified_on: Time

When the widget was modified.

name: String

Human readable widget name. Not unique. Cloudflare suggests that you set this to a meaningful string to make it easier to identify your widget, and where it is used.

offlabel: Bool

Do not show any Cloudflare branding on the widget (ENT only).

region: String

Region where this widget can be used. This cannot be changed after creation.

secret: String

Secret key for this widget.

domains: List[String]

cloudflare_turnstile_widget

data "cloudflare_turnstile_widget" "example_turnstile_widget" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  sitekey = "0x4AAF00AAAABn0R22HWm-YUc"
}

data cloudflare_turnstile_widgets

required Expand Collapse
account_id: String

Identifier

optional Expand Collapse
direction?: String

Direction to order widgets.

filter?: String

Filter widgets by field using case-insensitive substring matching. Format: field:value

Supported fields:

  • name - Filter by widget name (e.g., filter=name:login-form)
  • sitekey - Filter by sitekey (e.g., filter=sitekey:0x4AAA)

Returns 400 Bad Request if the field is unsupported or format is invalid. An empty filter value returns all results.

order?: String

Field to order widgets by.

max_items?: Int64

Max items to fetch, default: 1000

computed Expand Collapse
result: List[Attributes]

The items returned by the data source

id: String

Widget item identifier tag.

bot_fight_mode: Bool

If bot_fight_mode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).

clearance_level: String

If Turnstile is embedded on a Cloudflare site and the widget should grant challenge clearance, this setting can determine the clearance level to be set

created_on: Time

When the widget was created.

domains: List[String]
ephemeral_id: Bool

Return the Ephemeral ID in /siteverify (ENT only).

mode: String

Widget Mode

modified_on: Time

When the widget was modified.

name: String

Human readable widget name. Not unique. Cloudflare suggests that you set this to a meaningful string to make it easier to identify your widget, and where it is used.

offlabel: Bool

Do not show any Cloudflare branding on the widget (ENT only).

region: String

Region where this widget can be used. This cannot be changed after creation.

sitekey: String

Widget item identifier tag.

cloudflare_turnstile_widgets

data "cloudflare_turnstile_widgets" "example_turnstile_widgets" {
  account_id = "023e105f4ecef8ad9ca31a8372d0c353"
  direction = "asc"
  filter = "name:my-widget"
  order = "id"
}