1. Packages
  2. Cloudflare Provider
  3. API Docs
  4. SplitTunnel
Cloudflare v5.49.1 published on Tuesday, Feb 18, 2025 by Pulumi

cloudflare.SplitTunnel

Explore with Pulumi AI

Provides a Cloudflare Split Tunnel resource. Split tunnels are used to either include or exclude lists of routes from the WARP client’s tunnel.

Create SplitTunnel Resource

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

Constructor syntax

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

@overload
def SplitTunnel(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                account_id: Optional[str] = None,
                mode: Optional[str] = None,
                tunnels: Optional[Sequence[SplitTunnelTunnelArgs]] = None,
                policy_id: Optional[str] = None)
func NewSplitTunnel(ctx *Context, name string, args SplitTunnelArgs, opts ...ResourceOption) (*SplitTunnel, error)
public SplitTunnel(string name, SplitTunnelArgs args, CustomResourceOptions? opts = null)
public SplitTunnel(String name, SplitTunnelArgs args)
public SplitTunnel(String name, SplitTunnelArgs args, CustomResourceOptions options)
type: cloudflare:SplitTunnel
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. SplitTunnelArgs
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. SplitTunnelArgs
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. SplitTunnelArgs
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. SplitTunnelArgs
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. SplitTunnelArgs
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 splitTunnelResource = new Cloudflare.SplitTunnel("splitTunnelResource", new()
{
    AccountId = "string",
    Mode = "string",
    Tunnels = new[]
    {
        new Cloudflare.Inputs.SplitTunnelTunnelArgs
        {
            Address = "string",
            Description = "string",
            Host = "string",
        },
    },
    PolicyId = "string",
});
Copy
example, err := cloudflare.NewSplitTunnel(ctx, "splitTunnelResource", &cloudflare.SplitTunnelArgs{
	AccountId: pulumi.String("string"),
	Mode:      pulumi.String("string"),
	Tunnels: cloudflare.SplitTunnelTunnelArray{
		&cloudflare.SplitTunnelTunnelArgs{
			Address:     pulumi.String("string"),
			Description: pulumi.String("string"),
			Host:        pulumi.String("string"),
		},
	},
	PolicyId: pulumi.String("string"),
})
Copy
var splitTunnelResource = new SplitTunnel("splitTunnelResource", SplitTunnelArgs.builder()
    .accountId("string")
    .mode("string")
    .tunnels(SplitTunnelTunnelArgs.builder()
        .address("string")
        .description("string")
        .host("string")
        .build())
    .policyId("string")
    .build());
Copy
split_tunnel_resource = cloudflare.SplitTunnel("splitTunnelResource",
    account_id="string",
    mode="string",
    tunnels=[{
        "address": "string",
        "description": "string",
        "host": "string",
    }],
    policy_id="string")
Copy
const splitTunnelResource = new cloudflare.SplitTunnel("splitTunnelResource", {
    accountId: "string",
    mode: "string",
    tunnels: [{
        address: "string",
        description: "string",
        host: "string",
    }],
    policyId: "string",
});
Copy
type: cloudflare:SplitTunnel
properties:
    accountId: string
    mode: string
    policyId: string
    tunnels:
        - address: string
          description: string
          host: string
Copy

SplitTunnel 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 SplitTunnel resource accepts the following input properties:

AccountId This property is required. string
The account identifier to target for the resource.
Mode This property is required. string
The mode of the split tunnel policy. Available values: include, exclude.
Tunnels This property is required. List<SplitTunnelTunnel>
The value of the tunnel attributes.
PolicyId string
The settings policy for which to configure this split tunnel policy.
AccountId This property is required. string
The account identifier to target for the resource.
Mode This property is required. string
The mode of the split tunnel policy. Available values: include, exclude.
Tunnels This property is required. []SplitTunnelTunnelArgs
The value of the tunnel attributes.
PolicyId string
The settings policy for which to configure this split tunnel policy.
accountId This property is required. String
The account identifier to target for the resource.
mode This property is required. String
The mode of the split tunnel policy. Available values: include, exclude.
tunnels This property is required. List<SplitTunnelTunnel>
The value of the tunnel attributes.
policyId String
The settings policy for which to configure this split tunnel policy.
accountId This property is required. string
The account identifier to target for the resource.
mode This property is required. string
The mode of the split tunnel policy. Available values: include, exclude.
tunnels This property is required. SplitTunnelTunnel[]
The value of the tunnel attributes.
policyId string
The settings policy for which to configure this split tunnel policy.
account_id This property is required. str
The account identifier to target for the resource.
mode This property is required. str
The mode of the split tunnel policy. Available values: include, exclude.
tunnels This property is required. Sequence[SplitTunnelTunnelArgs]
The value of the tunnel attributes.
policy_id str
The settings policy for which to configure this split tunnel policy.
accountId This property is required. String
The account identifier to target for the resource.
mode This property is required. String
The mode of the split tunnel policy. Available values: include, exclude.
tunnels This property is required. List<Property Map>
The value of the tunnel attributes.
policyId String
The settings policy for which to configure this split tunnel policy.

Outputs

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

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

Look up Existing SplitTunnel Resource

Get an existing SplitTunnel 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?: SplitTunnelState, opts?: CustomResourceOptions): SplitTunnel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        mode: Optional[str] = None,
        policy_id: Optional[str] = None,
        tunnels: Optional[Sequence[SplitTunnelTunnelArgs]] = None) -> SplitTunnel
func GetSplitTunnel(ctx *Context, name string, id IDInput, state *SplitTunnelState, opts ...ResourceOption) (*SplitTunnel, error)
public static SplitTunnel Get(string name, Input<string> id, SplitTunnelState? state, CustomResourceOptions? opts = null)
public static SplitTunnel get(String name, Output<String> id, SplitTunnelState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:SplitTunnel    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
The account identifier to target for the resource.
Mode string
The mode of the split tunnel policy. Available values: include, exclude.
PolicyId string
The settings policy for which to configure this split tunnel policy.
Tunnels List<SplitTunnelTunnel>
The value of the tunnel attributes.
AccountId string
The account identifier to target for the resource.
Mode string
The mode of the split tunnel policy. Available values: include, exclude.
PolicyId string
The settings policy for which to configure this split tunnel policy.
Tunnels []SplitTunnelTunnelArgs
The value of the tunnel attributes.
accountId String
The account identifier to target for the resource.
mode String
The mode of the split tunnel policy. Available values: include, exclude.
policyId String
The settings policy for which to configure this split tunnel policy.
tunnels List<SplitTunnelTunnel>
The value of the tunnel attributes.
accountId string
The account identifier to target for the resource.
mode string
The mode of the split tunnel policy. Available values: include, exclude.
policyId string
The settings policy for which to configure this split tunnel policy.
tunnels SplitTunnelTunnel[]
The value of the tunnel attributes.
account_id str
The account identifier to target for the resource.
mode str
The mode of the split tunnel policy. Available values: include, exclude.
policy_id str
The settings policy for which to configure this split tunnel policy.
tunnels Sequence[SplitTunnelTunnelArgs]
The value of the tunnel attributes.
accountId String
The account identifier to target for the resource.
mode String
The mode of the split tunnel policy. Available values: include, exclude.
policyId String
The settings policy for which to configure this split tunnel policy.
tunnels List<Property Map>
The value of the tunnel attributes.

Supporting Types

SplitTunnelTunnel
, SplitTunnelTunnelArgs

Address string
The address for the tunnel.
Description string
A description for the tunnel.
Host string
The domain name for the tunnel.
Address string
The address for the tunnel.
Description string
A description for the tunnel.
Host string
The domain name for the tunnel.
address String
The address for the tunnel.
description String
A description for the tunnel.
host String
The domain name for the tunnel.
address string
The address for the tunnel.
description string
A description for the tunnel.
host string
The domain name for the tunnel.
address str
The address for the tunnel.
description str
A description for the tunnel.
host str
The domain name for the tunnel.
address String
The address for the tunnel.
description String
A description for the tunnel.
host String
The domain name for the tunnel.

Import

Split Tunnels for default device policies must use “default” as the policy ID.

$ pulumi import cloudflare:index/splitTunnel:SplitTunnel example <account_id>/<policy_id>/<mode>
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.