1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. TurnstileWidget
Cloudflare v6.0.1 published on Wednesday, Apr 16, 2025 by Pulumi

cloudflare.TurnstileWidget

Explore with Pulumi AI

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const exampleTurnstileWidget = new cloudflare.TurnstileWidget("example_turnstile_widget", {
    accountId: "023e105f4ecef8ad9ca31a8372d0c353",
    domains: [
        "203.0.113.1",
        "cloudflare.com",
        "blog.example.com",
    ],
    mode: "non-interactive",
    name: "blog.cloudflare.com login form",
    botFightMode: false,
    clearanceLevel: "no_clearance",
    ephemeralId: false,
    offlabel: false,
    region: "world",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_turnstile_widget = cloudflare.TurnstileWidget("example_turnstile_widget",
    account_id="023e105f4ecef8ad9ca31a8372d0c353",
    domains=[
        "203.0.113.1",
        "cloudflare.com",
        "blog.example.com",
    ],
    mode="non-interactive",
    name="blog.cloudflare.com login form",
    bot_fight_mode=False,
    clearance_level="no_clearance",
    ephemeral_id=False,
    offlabel=False,
    region="world")
Copy
package main

import (
	"github.com/pulumi/pulumi-cloudflare/sdk/v6/go/cloudflare"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := cloudflare.NewTurnstileWidget(ctx, "example_turnstile_widget", &cloudflare.TurnstileWidgetArgs{
			AccountId: pulumi.String("023e105f4ecef8ad9ca31a8372d0c353"),
			Domains: pulumi.StringArray{
				pulumi.String("203.0.113.1"),
				pulumi.String("cloudflare.com"),
				pulumi.String("blog.example.com"),
			},
			Mode:           pulumi.String("non-interactive"),
			Name:           pulumi.String("blog.cloudflare.com login form"),
			BotFightMode:   pulumi.Bool(false),
			ClearanceLevel: pulumi.String("no_clearance"),
			EphemeralId:    pulumi.Bool(false),
			Offlabel:       pulumi.Bool(false),
			Region:         pulumi.String("world"),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var exampleTurnstileWidget = new Cloudflare.TurnstileWidget("example_turnstile_widget", new()
    {
        AccountId = "023e105f4ecef8ad9ca31a8372d0c353",
        Domains = new[]
        {
            "203.0.113.1",
            "cloudflare.com",
            "blog.example.com",
        },
        Mode = "non-interactive",
        Name = "blog.cloudflare.com login form",
        BotFightMode = false,
        ClearanceLevel = "no_clearance",
        EphemeralId = false,
        Offlabel = false,
        Region = "world",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.TurnstileWidget;
import com.pulumi.cloudflare.TurnstileWidgetArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleTurnstileWidget = new TurnstileWidget("exampleTurnstileWidget", TurnstileWidgetArgs.builder()
            .accountId("023e105f4ecef8ad9ca31a8372d0c353")
            .domains(            
                "203.0.113.1",
                "cloudflare.com",
                "blog.example.com")
            .mode("non-interactive")
            .name("blog.cloudflare.com login form")
            .botFightMode(false)
            .clearanceLevel("no_clearance")
            .ephemeralId(false)
            .offlabel(false)
            .region("world")
            .build());

    }
}
Copy
resources:
  exampleTurnstileWidget:
    type: cloudflare:TurnstileWidget
    name: example_turnstile_widget
    properties:
      accountId: 023e105f4ecef8ad9ca31a8372d0c353
      domains:
        - 203.0.113.1
        - cloudflare.com
        - blog.example.com
      mode: non-interactive
      name: blog.cloudflare.com login form
      botFightMode: false
      clearanceLevel: no_clearance
      ephemeralId: false
      offlabel: false
      region: world
Copy

Create TurnstileWidget Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new TurnstileWidget(name: string, args: TurnstileWidgetArgs, opts?: CustomResourceOptions);
@overload
def TurnstileWidget(resource_name: str,
                    args: TurnstileWidgetArgs,
                    opts: Optional[ResourceOptions] = None)

@overload
def TurnstileWidget(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    account_id: Optional[str] = None,
                    domains: Optional[Sequence[str]] = None,
                    mode: Optional[str] = None,
                    name: Optional[str] = None,
                    bot_fight_mode: Optional[bool] = None,
                    clearance_level: Optional[str] = None,
                    ephemeral_id: Optional[bool] = None,
                    offlabel: Optional[bool] = None,
                    region: Optional[str] = None)
func NewTurnstileWidget(ctx *Context, name string, args TurnstileWidgetArgs, opts ...ResourceOption) (*TurnstileWidget, error)
public TurnstileWidget(string name, TurnstileWidgetArgs args, CustomResourceOptions? opts = null)
public TurnstileWidget(String name, TurnstileWidgetArgs args)
public TurnstileWidget(String name, TurnstileWidgetArgs args, CustomResourceOptions options)
type: cloudflare:TurnstileWidget
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. TurnstileWidgetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. TurnstileWidgetArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. TurnstileWidgetArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. TurnstileWidgetArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. TurnstileWidgetArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var turnstileWidgetResource = new Cloudflare.TurnstileWidget("turnstileWidgetResource", new()
{
    AccountId = "string",
    Domains = new[]
    {
        "string",
    },
    Mode = "string",
    Name = "string",
    BotFightMode = false,
    ClearanceLevel = "string",
    EphemeralId = false,
    Offlabel = false,
    Region = "string",
});
Copy
example, err := cloudflare.NewTurnstileWidget(ctx, "turnstileWidgetResource", &cloudflare.TurnstileWidgetArgs{
	AccountId: pulumi.String("string"),
	Domains: pulumi.StringArray{
		pulumi.String("string"),
	},
	Mode:           pulumi.String("string"),
	Name:           pulumi.String("string"),
	BotFightMode:   pulumi.Bool(false),
	ClearanceLevel: pulumi.String("string"),
	EphemeralId:    pulumi.Bool(false),
	Offlabel:       pulumi.Bool(false),
	Region:         pulumi.String("string"),
})
Copy
var turnstileWidgetResource = new TurnstileWidget("turnstileWidgetResource", TurnstileWidgetArgs.builder()
    .accountId("string")
    .domains("string")
    .mode("string")
    .name("string")
    .botFightMode(false)
    .clearanceLevel("string")
    .ephemeralId(false)
    .offlabel(false)
    .region("string")
    .build());
Copy
turnstile_widget_resource = cloudflare.TurnstileWidget("turnstileWidgetResource",
    account_id="string",
    domains=["string"],
    mode="string",
    name="string",
    bot_fight_mode=False,
    clearance_level="string",
    ephemeral_id=False,
    offlabel=False,
    region="string")
Copy
const turnstileWidgetResource = new cloudflare.TurnstileWidget("turnstileWidgetResource", {
    accountId: "string",
    domains: ["string"],
    mode: "string",
    name: "string",
    botFightMode: false,
    clearanceLevel: "string",
    ephemeralId: false,
    offlabel: false,
    region: "string",
});
Copy
type: cloudflare:TurnstileWidget
properties:
    accountId: string
    botFightMode: false
    clearanceLevel: string
    domains:
        - string
    ephemeralId: false
    mode: string
    name: string
    offlabel: false
    region: string
Copy

TurnstileWidget Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The TurnstileWidget resource accepts the following input properties:

AccountId This property is required. string
Identifier
Domains This property is required. List<string>
Mode This property is required. string
Widget Mode Available values: "non-interactive", "invisible", "managed".
Name This property is required. 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.
BotFightMode bool
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
ClearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
EphemeralId 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. Available values: "world".
AccountId This property is required. string
Identifier
Domains This property is required. []string
Mode This property is required. string
Widget Mode Available values: "non-interactive", "invisible", "managed".
Name This property is required. 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.
BotFightMode bool
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
ClearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
EphemeralId 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. Available values: "world".
accountId This property is required. String
Identifier
domains This property is required. List<String>
mode This property is required. String
Widget Mode Available values: "non-interactive", "invisible", "managed".
name This property is required. 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.
botFightMode Boolean
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
ephemeralId Boolean
Return the Ephemeral ID in /siteverify (ENT only).
offlabel Boolean
Do not show any Cloudflare branding on the widget (ENT only).
region String
Region where this widget can be used. Available values: "world".
accountId This property is required. string
Identifier
domains This property is required. string[]
mode This property is required. string
Widget Mode Available values: "non-interactive", "invisible", "managed".
name This property is required. 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.
botFightMode boolean
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
ephemeralId boolean
Return the Ephemeral ID in /siteverify (ENT only).
offlabel boolean
Do not show any Cloudflare branding on the widget (ENT only).
region string
Region where this widget can be used. Available values: "world".
account_id This property is required. str
Identifier
domains This property is required. Sequence[str]
mode This property is required. str
Widget Mode Available values: "non-interactive", "invisible", "managed".
name This property is required. str
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.
bot_fight_mode bool
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearance_level str
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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
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 str
Region where this widget can be used. Available values: "world".
accountId This property is required. String
Identifier
domains This property is required. List<String>
mode This property is required. String
Widget Mode Available values: "non-interactive", "invisible", "managed".
name This property is required. 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.
botFightMode Boolean
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
ephemeralId Boolean
Return the Ephemeral ID in /siteverify (ENT only).
offlabel Boolean
Do not show any Cloudflare branding on the widget (ENT only).
region String
Region where this widget can be used. Available values: "world".

Outputs

All input properties are implicitly available as output properties. Additionally, the TurnstileWidget resource produces the following output properties:

CreatedOn string
When the widget was created.
Id string
The provider-assigned unique ID for this managed resource.
ModifiedOn string
When the widget was modified.
Secret string
Secret key for this widget.
Sitekey string
Widget item identifier tag.
CreatedOn string
When the widget was created.
Id string
The provider-assigned unique ID for this managed resource.
ModifiedOn string
When the widget was modified.
Secret string
Secret key for this widget.
Sitekey string
Widget item identifier tag.
createdOn String
When the widget was created.
id String
The provider-assigned unique ID for this managed resource.
modifiedOn String
When the widget was modified.
secret String
Secret key for this widget.
sitekey String
Widget item identifier tag.
createdOn string
When the widget was created.
id string
The provider-assigned unique ID for this managed resource.
modifiedOn string
When the widget was modified.
secret string
Secret key for this widget.
sitekey string
Widget item identifier tag.
created_on str
When the widget was created.
id str
The provider-assigned unique ID for this managed resource.
modified_on str
When the widget was modified.
secret str
Secret key for this widget.
sitekey str
Widget item identifier tag.
createdOn String
When the widget was created.
id String
The provider-assigned unique ID for this managed resource.
modifiedOn String
When the widget was modified.
secret String
Secret key for this widget.
sitekey String
Widget item identifier tag.

Look up Existing TurnstileWidget Resource

Get an existing TurnstileWidget resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: TurnstileWidgetState, opts?: CustomResourceOptions): TurnstileWidget
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        bot_fight_mode: Optional[bool] = None,
        clearance_level: Optional[str] = None,
        created_on: Optional[str] = None,
        domains: Optional[Sequence[str]] = None,
        ephemeral_id: Optional[bool] = None,
        mode: Optional[str] = None,
        modified_on: Optional[str] = None,
        name: Optional[str] = None,
        offlabel: Optional[bool] = None,
        region: Optional[str] = None,
        secret: Optional[str] = None,
        sitekey: Optional[str] = None) -> TurnstileWidget
func GetTurnstileWidget(ctx *Context, name string, id IDInput, state *TurnstileWidgetState, opts ...ResourceOption) (*TurnstileWidget, error)
public static TurnstileWidget Get(string name, Input<string> id, TurnstileWidgetState? state, CustomResourceOptions? opts = null)
public static TurnstileWidget get(String name, Output<String> id, TurnstileWidgetState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:TurnstileWidget    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AccountId string
Identifier
BotFightMode bool
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
ClearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
CreatedOn string
When the widget was created.
Domains List<string>
EphemeralId bool
Return the Ephemeral ID in /siteverify (ENT only).
Mode string
Widget Mode Available values: "non-interactive", "invisible", "managed".
ModifiedOn string
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. Available values: "world".
Secret string
Secret key for this widget.
Sitekey string
Widget item identifier tag.
AccountId string
Identifier
BotFightMode bool
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
ClearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
CreatedOn string
When the widget was created.
Domains []string
EphemeralId bool
Return the Ephemeral ID in /siteverify (ENT only).
Mode string
Widget Mode Available values: "non-interactive", "invisible", "managed".
ModifiedOn string
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. Available values: "world".
Secret string
Secret key for this widget.
Sitekey string
Widget item identifier tag.
accountId String
Identifier
botFightMode Boolean
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
createdOn String
When the widget was created.
domains List<String>
ephemeralId Boolean
Return the Ephemeral ID in /siteverify (ENT only).
mode String
Widget Mode Available values: "non-interactive", "invisible", "managed".
modifiedOn String
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 Boolean
Do not show any Cloudflare branding on the widget (ENT only).
region String
Region where this widget can be used. Available values: "world".
secret String
Secret key for this widget.
sitekey String
Widget item identifier tag.
accountId string
Identifier
botFightMode boolean
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
createdOn string
When the widget was created.
domains string[]
ephemeralId boolean
Return the Ephemeral ID in /siteverify (ENT only).
mode string
Widget Mode Available values: "non-interactive", "invisible", "managed".
modifiedOn string
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 boolean
Do not show any Cloudflare branding on the widget (ENT only).
region string
Region where this widget can be used. Available values: "world".
secret string
Secret key for this widget.
sitekey string
Widget item identifier tag.
account_id str
Identifier
bot_fight_mode bool
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearance_level str
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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
created_on str
When the widget was created.
domains Sequence[str]
ephemeral_id bool
Return the Ephemeral ID in /siteverify (ENT only).
mode str
Widget Mode Available values: "non-interactive", "invisible", "managed".
modified_on str
When the widget was modified.
name str
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 str
Region where this widget can be used. Available values: "world".
secret str
Secret key for this widget.
sitekey str
Widget item identifier tag.
accountId String
Identifier
botFightMode Boolean
If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (ENT only).
clearanceLevel 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
createdOn String
When the widget was created.
domains List<String>
ephemeralId Boolean
Return the Ephemeral ID in /siteverify (ENT only).
mode String
Widget Mode Available values: "non-interactive", "invisible", "managed".
modifiedOn String
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 Boolean
Do not show any Cloudflare branding on the widget (ENT only).
region String
Region where this widget can be used. Available values: "world".
secret String
Secret key for this widget.
sitekey String
Widget item identifier tag.

Import

$ pulumi import cloudflare:index/turnstileWidget:TurnstileWidget example '<account_id>/<sitekey>'
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.