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: "invisible",
name: "blog.cloudflare.com login form",
botFightMode: false,
clearanceLevel: "interactive",
ephemeralId: false,
offlabel: false,
region: "world",
});
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="invisible",
name="blog.cloudflare.com login form",
bot_fight_mode=False,
clearance_level="interactive",
ephemeral_id=False,
offlabel=False,
region="world")
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("invisible"),
Name: pulumi.String("blog.cloudflare.com login form"),
BotFightMode: pulumi.Bool(false),
ClearanceLevel: pulumi.String("interactive"),
EphemeralId: pulumi.Bool(false),
Offlabel: pulumi.Bool(false),
Region: pulumi.String("world"),
})
if err != nil {
return err
}
return nil
})
}
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 = "invisible",
Name = "blog.cloudflare.com login form",
BotFightMode = false,
ClearanceLevel = "interactive",
EphemeralId = false,
Offlabel = false,
Region = "world",
});
});
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("invisible")
.name("blog.cloudflare.com login form")
.botFightMode(false)
.clearanceLevel("interactive")
.ephemeralId(false)
.offlabel(false)
.region("world")
.build());
}
}
resources:
exampleTurnstileWidget:
type: cloudflare:TurnstileWidget
name: example_turnstile_widget
properties:
accountId: 023e105f4ecef8ad9ca31a8372d0c353
domains:
- 203.0.113.1
- cloudflare.com
- blog.example.com
mode: invisible
name: blog.cloudflare.com login form
botFightMode: false
clearanceLevel: interactive
ephemeralId: false
offlabel: false
region: world
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 string
- The unique name of the resource.
- args TurnstileWidgetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- resource_name str
- The unique name of the resource.
- args 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 string
- The unique name of the resource.
- args TurnstileWidgetArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TurnstileWidgetArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args 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",
});
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"),
})
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());
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")
const turnstileWidgetResource = new cloudflare.TurnstileWidget("turnstileWidgetResource", {
accountId: "string",
domains: ["string"],
mode: "string",
name: "string",
botFightMode: false,
clearanceLevel: "string",
ephemeralId: false,
offlabel: false,
region: "string",
});
type: cloudflare:TurnstileWidget
properties:
accountId: string
botFightMode: false
clearanceLevel: string
domains:
- string
ephemeralId: false
mode: string
name: string
offlabel: false
region: string
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:
- Account
Id string - Identifier
- Domains List<string>
- Mode string
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- 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.
- Bot
Fight boolMode - If botfightmode 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 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 string
- Region where this widget can be used. Available values: "world".
- Account
Id string - Identifier
- Domains []string
- Mode string
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- 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.
- Bot
Fight boolMode - If botfightmode 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 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 string
- Region where this widget can be used. Available values: "world".
- account
Id String - Identifier
- domains List<String>
- mode String
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- 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.
- bot
Fight BooleanMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- ephemeral
Id 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 string - Identifier
- domains string[]
- mode string
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- 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.
- bot
Fight booleanMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- ephemeral
Id 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 str - Identifier
- domains Sequence[str]
- mode str
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- 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.
- bot_
fight_ boolmode - 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".
- account
Id String - Identifier
- domains List<String>
- mode String
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- 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.
- bot
Fight BooleanMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- ephemeral
Id 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:
- Created
On string - When the widget was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - When the widget was modified.
- Secret string
- Secret key for this widget.
- Sitekey string
- Widget item identifier tag.
- Created
On string - When the widget was created.
- Id string
- The provider-assigned unique ID for this managed resource.
- Modified
On string - When the widget was modified.
- Secret string
- Secret key for this widget.
- Sitekey string
- Widget item identifier tag.
- created
On String - When the widget was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On String - When the widget was modified.
- secret String
- Secret key for this widget.
- sitekey String
- Widget item identifier tag.
- created
On string - When the widget was created.
- id string
- The provider-assigned unique ID for this managed resource.
- modified
On 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.
- created
On String - When the widget was created.
- id String
- The provider-assigned unique ID for this managed resource.
- modified
On 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- The unique provider ID of the resource to lookup.
- name
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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
- The unique name of the resulting resource.
- id
- 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.
- Account
Id string - Identifier
- Bot
Fight boolMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- Created
On string - When the widget was created.
- Domains List<string>
- Ephemeral
Id bool - Return the Ephemeral ID in /siteverify (ENT only).
- Mode string
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- Modified
On 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.
- Account
Id string - Identifier
- Bot
Fight boolMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- Created
On string - When the widget was created.
- Domains []string
- Ephemeral
Id bool - Return the Ephemeral ID in /siteverify (ENT only).
- Mode string
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- Modified
On 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.
- account
Id String - Identifier
- bot
Fight BooleanMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- created
On String - When the widget was created.
- domains List<String>
- ephemeral
Id Boolean - Return the Ephemeral ID in /siteverify (ENT only).
- mode String
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- modified
On 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 string - Identifier
- bot
Fight booleanMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- created
On string - When the widget was created.
- domains string[]
- ephemeral
Id boolean - Return the Ephemeral ID in /siteverify (ENT only).
- mode string
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- modified
On 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_ boolmode - 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.
- account
Id String - Identifier
- bot
Fight BooleanMode - If botfightmode 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 Available values: "no_clearance", "jschallenge", "managed", "interactive".
- created
On String - When the widget was created.
- domains List<String>
- ephemeral
Id Boolean - Return the Ephemeral ID in /siteverify (ENT only).
- mode String
- Widget Mode Available values: "non-interactive", "invisible", "managed".
- modified
On 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>'
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.