cloudflare logo
Cloudflare v5.2.1, May 23 23

cloudflare.Tunnel

Explore with Pulumi AI

Tunnel exposes applications running on your local web server on any network with an internet connection without manually adding DNS records or configuring a firewall or router.

Example Usage

using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;

return await Deployment.RunAsync(() => 
{
    var example = new Cloudflare.Tunnel("example", new()
    {
        AccountId = "f037e56e89293a057740de681ac9abbe",
        Name = "my-tunnel",
        Secret = "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=",
    });

});
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.NewTunnel(ctx, "example", &cloudflare.TunnelArgs{
			AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
			Name:      pulumi.String("my-tunnel"),
			Secret:    pulumi.String("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.Tunnel;
import com.pulumi.cloudflare.TunnelArgs;
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 Tunnel("example", TunnelArgs.builder()        
            .accountId("f037e56e89293a057740de681ac9abbe")
            .name("my-tunnel")
            .secret("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=")
            .build());

    }
}
import pulumi
import pulumi_cloudflare as cloudflare

example = cloudflare.Tunnel("example",
    account_id="f037e56e89293a057740de681ac9abbe",
    name="my-tunnel",
    secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=")
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";

const example = new cloudflare.Tunnel("example", {
    accountId: "f037e56e89293a057740de681ac9abbe",
    name: "my-tunnel",
    secret: "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=",
});
resources:
  example:
    type: cloudflare:Tunnel
    properties:
      accountId: f037e56e89293a057740de681ac9abbe
      name: my-tunnel
      secret: AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=

Create Tunnel Resource

new Tunnel(name: string, args: TunnelArgs, opts?: CustomResourceOptions);
@overload
def Tunnel(resource_name: str,
           opts: Optional[ResourceOptions] = None,
           account_id: Optional[str] = None,
           config_src: Optional[str] = None,
           name: Optional[str] = None,
           secret: Optional[str] = None)
@overload
def Tunnel(resource_name: str,
           args: TunnelArgs,
           opts: Optional[ResourceOptions] = None)
func NewTunnel(ctx *Context, name string, args TunnelArgs, opts ...ResourceOption) (*Tunnel, error)
public Tunnel(string name, TunnelArgs args, CustomResourceOptions? opts = null)
public Tunnel(String name, TunnelArgs args)
public Tunnel(String name, TunnelArgs args, CustomResourceOptions options)
type: cloudflare:Tunnel
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args TunnelArgs
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 TunnelArgs
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 TunnelArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args TunnelArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args TunnelArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

AccountId string

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

Name string

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

Secret string

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

ConfigSrc string

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

AccountId string

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

Name string

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

Secret string

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

ConfigSrc string

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

accountId String

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

name String

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret String

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

configSrc String

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

accountId string

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

name string

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret string

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

configSrc string

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

account_id str

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

name str

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret str

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

config_src str

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

accountId String

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

name String

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret String

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

configSrc String

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

Outputs

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

Cname string

Usable CNAME for accessing the Tunnel.

Id string

The provider-assigned unique ID for this managed resource.

TunnelToken string

Token used by a connector to authenticate and run the tunnel.

Cname string

Usable CNAME for accessing the Tunnel.

Id string

The provider-assigned unique ID for this managed resource.

TunnelToken string

Token used by a connector to authenticate and run the tunnel.

cname String

Usable CNAME for accessing the Tunnel.

id String

The provider-assigned unique ID for this managed resource.

tunnelToken String

Token used by a connector to authenticate and run the tunnel.

cname string

Usable CNAME for accessing the Tunnel.

id string

The provider-assigned unique ID for this managed resource.

tunnelToken string

Token used by a connector to authenticate and run the tunnel.

cname str

Usable CNAME for accessing the Tunnel.

id str

The provider-assigned unique ID for this managed resource.

tunnel_token str

Token used by a connector to authenticate and run the tunnel.

cname String

Usable CNAME for accessing the Tunnel.

id String

The provider-assigned unique ID for this managed resource.

tunnelToken String

Token used by a connector to authenticate and run the tunnel.

Look up Existing Tunnel Resource

Get an existing Tunnel 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?: TunnelState, opts?: CustomResourceOptions): Tunnel
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        cname: Optional[str] = None,
        config_src: Optional[str] = None,
        name: Optional[str] = None,
        secret: Optional[str] = None,
        tunnel_token: Optional[str] = None) -> Tunnel
func GetTunnel(ctx *Context, name string, id IDInput, state *TunnelState, opts ...ResourceOption) (*Tunnel, error)
public static Tunnel Get(string name, Input<string> id, TunnelState? state, CustomResourceOptions? opts = null)
public static Tunnel get(String name, Output<String> id, TunnelState 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. Modifying this attribute will force creation of a new resource.

Cname string

Usable CNAME for accessing the Tunnel.

ConfigSrc string

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

Name string

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

Secret string

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

TunnelToken string

Token used by a connector to authenticate and run the tunnel.

AccountId string

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

Cname string

Usable CNAME for accessing the Tunnel.

ConfigSrc string

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

Name string

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

Secret string

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

TunnelToken string

Token used by a connector to authenticate and run the tunnel.

accountId String

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

cname String

Usable CNAME for accessing the Tunnel.

configSrc String

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

name String

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret String

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

tunnelToken String

Token used by a connector to authenticate and run the tunnel.

accountId string

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

cname string

Usable CNAME for accessing the Tunnel.

configSrc string

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

name string

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret string

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

tunnelToken string

Token used by a connector to authenticate and run the tunnel.

account_id str

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

cname str

Usable CNAME for accessing the Tunnel.

config_src str

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

name str

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret str

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

tunnel_token str

Token used by a connector to authenticate and run the tunnel.

accountId String

The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.

cname String

Usable CNAME for accessing the Tunnel.

configSrc String

Indicates if this is a locally or remotely configured tunnel. If local, manage the tunnel using a YAML file on the origin machine. If cloudflare, manage the tunnel on the Zero Trust dashboard or using tunnelconfig, tunnelroute or tunnelvirtualnetwork resources. Available values: local, cloudflare. Modifying this attribute will force creation of a new resource.

name String

A user-friendly name chosen when the tunnel is created. Modifying this attribute will force creation of a new resource.

secret String

32 or more bytes, encoded as a base64 string. The Create Argo Tunnel endpoint sets this as the tunnel's password. Anyone wishing to run the tunnel needs this password. Modifying this attribute will force creation of a new resource.

tunnelToken String

Token used by a connector to authenticate and run the tunnel.

Import

 $ pulumi import cloudflare:index/tunnel:Tunnel example <account_id>/<tunnel_id>

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes

This Pulumi package is based on the cloudflare Terraform Provider.