1. Packages
  2. Cloudflare
  3. API Docs
  4. TurnstileWidget
Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi

cloudflare.TurnstileWidget

Explore with Pulumi AI

cloudflare logo
Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi

    The Turnstile Widget resource allows you to manage Cloudflare Turnstile Widgets.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as cloudflare from "@pulumi/cloudflare";
    
    const example = new cloudflare.TurnstileWidget("example", {
        accountId: "f037e56e89293a057740de681ac9abbe",
        name: "example widget",
        botFightMode: false,
        domains: ["example.com"],
        mode: "invisible",
        region: "world",
    });
    
    import pulumi
    import pulumi_cloudflare as cloudflare
    
    example = cloudflare.TurnstileWidget("example",
        account_id="f037e56e89293a057740de681ac9abbe",
        name="example widget",
        bot_fight_mode=False,
        domains=["example.com"],
        mode="invisible",
        region="world")
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-cloudflare/sdk/v5/go/cloudflare"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := cloudflare.NewTurnstileWidget(ctx, "example", &cloudflare.TurnstileWidgetArgs{
    			AccountId:    pulumi.String("f037e56e89293a057740de681ac9abbe"),
    			Name:         pulumi.String("example widget"),
    			BotFightMode: pulumi.Bool(false),
    			Domains: pulumi.StringArray{
    				pulumi.String("example.com"),
    			},
    			Mode:   pulumi.String("invisible"),
    			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 example = new Cloudflare.TurnstileWidget("example", new()
        {
            AccountId = "f037e56e89293a057740de681ac9abbe",
            Name = "example widget",
            BotFightMode = false,
            Domains = new[]
            {
                "example.com",
            },
            Mode = "invisible",
            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 example = new TurnstileWidget("example", TurnstileWidgetArgs.builder()
                .accountId("f037e56e89293a057740de681ac9abbe")
                .name("example widget")
                .botFightMode(false)
                .domains("example.com")
                .mode("invisible")
                .region("world")
                .build());
    
        }
    }
    
    resources:
      example:
        type: cloudflare:TurnstileWidget
        properties:
          accountId: f037e56e89293a057740de681ac9abbe
          name: example widget
          botFightMode: false
          domains:
            - example.com
          mode: invisible
          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,
                        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,
        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),
    	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)
        .offlabel(false)
        .region("string")
        .build());
    
    turnstile_widget_resource = cloudflare.TurnstileWidget("turnstileWidgetResource",
        account_id="string",
        domains=["string"],
        mode="string",
        name="string",
        bot_fight_mode=False,
        offlabel=False,
        region="string")
    
    const turnstileWidgetResource = new cloudflare.TurnstileWidget("turnstileWidgetResource", {
        accountId: "string",
        domains: ["string"],
        mode: "string",
        name: "string",
        botFightMode: false,
        offlabel: false,
        region: "string",
    });
    
    type: cloudflare:TurnstileWidget
    properties:
        accountId: string
        botFightMode: false
        domains:
            - string
        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

    The TurnstileWidget resource accepts the following input properties:

    AccountId string
    The account identifier to target for the resource.
    Domains List<string>
    Domains where the widget is deployed
    Mode string
    Widget Mode. Available values: non-interactive, invisible, managed
    Name string
    Human readable widget name.
    BotFightMode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    Offlabel bool
    Do not show any Cloudflare branding on the widget (Enterprise only).
    Region string
    Region where this widget can be used.
    AccountId string
    The account identifier to target for the resource.
    Domains []string
    Domains where the widget is deployed
    Mode string
    Widget Mode. Available values: non-interactive, invisible, managed
    Name string
    Human readable widget name.
    BotFightMode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    Offlabel bool
    Do not show any Cloudflare branding on the widget (Enterprise only).
    Region string
    Region where this widget can be used.
    accountId String
    The account identifier to target for the resource.
    domains List<String>
    Domains where the widget is deployed
    mode String
    Widget Mode. Available values: non-interactive, invisible, managed
    name String
    Human readable widget name.
    botFightMode Boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    offlabel Boolean
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region String
    Region where this widget can be used.
    accountId string
    The account identifier to target for the resource.
    domains string[]
    Domains where the widget is deployed
    mode string
    Widget Mode. Available values: non-interactive, invisible, managed
    name string
    Human readable widget name.
    botFightMode boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    offlabel boolean
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region string
    Region where this widget can be used.
    account_id str
    The account identifier to target for the resource.
    domains Sequence[str]
    Domains where the widget is deployed
    mode str
    Widget Mode. Available values: non-interactive, invisible, managed
    name str
    Human readable widget name.
    bot_fight_mode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    offlabel bool
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region str
    Region where this widget can be used.
    accountId String
    The account identifier to target for the resource.
    domains List<String>
    Domains where the widget is deployed
    mode String
    Widget Mode. Available values: non-interactive, invisible, managed
    name String
    Human readable widget name.
    botFightMode Boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    offlabel Boolean
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region String
    Region where this widget can be used.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Secret string
    Secret key for this widget.
    Id string
    The provider-assigned unique ID for this managed resource.
    Secret string
    Secret key for this widget.
    id String
    The provider-assigned unique ID for this managed resource.
    secret String
    Secret key for this widget.
    id string
    The provider-assigned unique ID for this managed resource.
    secret string
    Secret key for this widget.
    id str
    The provider-assigned unique ID for this managed resource.
    secret str
    Secret key for this widget.
    id String
    The provider-assigned unique ID for this managed resource.
    secret String
    Secret key for this widget.

    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,
            domains: Optional[Sequence[str]] = None,
            mode: Optional[str] = None,
            name: Optional[str] = None,
            offlabel: Optional[bool] = None,
            region: Optional[str] = None,
            secret: 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)
    Resource lookup is not supported in YAML
    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.
    The following state arguments are supported:
    AccountId string
    The account identifier to target for the resource.
    BotFightMode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    Domains List<string>
    Domains where the widget is deployed
    Mode string
    Widget Mode. Available values: non-interactive, invisible, managed
    Name string
    Human readable widget name.
    Offlabel bool
    Do not show any Cloudflare branding on the widget (Enterprise only).
    Region string
    Region where this widget can be used.
    Secret string
    Secret key for this widget.
    AccountId string
    The account identifier to target for the resource.
    BotFightMode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    Domains []string
    Domains where the widget is deployed
    Mode string
    Widget Mode. Available values: non-interactive, invisible, managed
    Name string
    Human readable widget name.
    Offlabel bool
    Do not show any Cloudflare branding on the widget (Enterprise only).
    Region string
    Region where this widget can be used.
    Secret string
    Secret key for this widget.
    accountId String
    The account identifier to target for the resource.
    botFightMode Boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    domains List<String>
    Domains where the widget is deployed
    mode String
    Widget Mode. Available values: non-interactive, invisible, managed
    name String
    Human readable widget name.
    offlabel Boolean
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region String
    Region where this widget can be used.
    secret String
    Secret key for this widget.
    accountId string
    The account identifier to target for the resource.
    botFightMode boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    domains string[]
    Domains where the widget is deployed
    mode string
    Widget Mode. Available values: non-interactive, invisible, managed
    name string
    Human readable widget name.
    offlabel boolean
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region string
    Region where this widget can be used.
    secret string
    Secret key for this widget.
    account_id str
    The account identifier to target for the resource.
    bot_fight_mode bool
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    domains Sequence[str]
    Domains where the widget is deployed
    mode str
    Widget Mode. Available values: non-interactive, invisible, managed
    name str
    Human readable widget name.
    offlabel bool
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region str
    Region where this widget can be used.
    secret str
    Secret key for this widget.
    accountId String
    The account identifier to target for the resource.
    botFightMode Boolean
    If botfightmode is set to true, Cloudflare issues computationally expensive challenges in response to malicious bots (Enterprise only).
    domains List<String>
    Domains where the widget is deployed
    mode String
    Widget Mode. Available values: non-interactive, invisible, managed
    name String
    Human readable widget name.
    offlabel Boolean
    Do not show any Cloudflare branding on the widget (Enterprise only).
    region String
    Region where this widget can be used.
    secret String
    Secret key for this widget.

    Import

    $ pulumi import cloudflare:index/turnstileWidget:TurnstileWidget example <account_id>/<site_key>
    

    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.
    cloudflare logo
    Cloudflare v5.33.1 published on Wednesday, Jun 26, 2024 by Pulumi