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

cloudflare.TunnelRoute

Explore with Pulumi AI

Deprecated: cloudflare.index/tunnelroute.TunnelRoute has been deprecated in favor of cloudflare.index/zerotrusttunnelcloudflaredroute.ZeroTrustTunnelCloudflaredRoute

Example Usage

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

const exampleZeroTrustTunnelCloudflaredRoute = new cloudflare.ZeroTrustTunnelCloudflaredRoute("example_zero_trust_tunnel_cloudflared_route", {
    accountId: "699d98642c564d2e855e9661899b7252",
    network: "172.16.0.0/16",
    tunnelId: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
    comment: "Example comment for this route.",
    virtualNetworkId: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example_zero_trust_tunnel_cloudflared_route = cloudflare.ZeroTrustTunnelCloudflaredRoute("example_zero_trust_tunnel_cloudflared_route",
    account_id="699d98642c564d2e855e9661899b7252",
    network="172.16.0.0/16",
    tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
    comment="Example comment for this route.",
    virtual_network_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415")
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.NewZeroTrustTunnelCloudflaredRoute(ctx, "example_zero_trust_tunnel_cloudflared_route", &cloudflare.ZeroTrustTunnelCloudflaredRouteArgs{
			AccountId:        pulumi.String("699d98642c564d2e855e9661899b7252"),
			Network:          pulumi.String("172.16.0.0/16"),
			TunnelId:         pulumi.String("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"),
			Comment:          pulumi.String("Example comment for this route."),
			VirtualNetworkId: pulumi.String("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"),
		})
		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 exampleZeroTrustTunnelCloudflaredRoute = new Cloudflare.ZeroTrustTunnelCloudflaredRoute("example_zero_trust_tunnel_cloudflared_route", new()
    {
        AccountId = "699d98642c564d2e855e9661899b7252",
        Network = "172.16.0.0/16",
        TunnelId = "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
        Comment = "Example comment for this route.",
        VirtualNetworkId = "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.ZeroTrustTunnelCloudflaredRoute;
import com.pulumi.cloudflare.ZeroTrustTunnelCloudflaredRouteArgs;
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 exampleZeroTrustTunnelCloudflaredRoute = new ZeroTrustTunnelCloudflaredRoute("exampleZeroTrustTunnelCloudflaredRoute", ZeroTrustTunnelCloudflaredRouteArgs.builder()
            .accountId("699d98642c564d2e855e9661899b7252")
            .network("172.16.0.0/16")
            .tunnelId("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415")
            .comment("Example comment for this route.")
            .virtualNetworkId("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415")
            .build());

    }
}
Copy
resources:
  exampleZeroTrustTunnelCloudflaredRoute:
    type: cloudflare:ZeroTrustTunnelCloudflaredRoute
    name: example_zero_trust_tunnel_cloudflared_route
    properties:
      accountId: 699d98642c564d2e855e9661899b7252
      network: 172.16.0.0/16
      tunnelId: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415
      comment: Example comment for this route.
      virtualNetworkId: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415
Copy

Create TunnelRoute Resource

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

Constructor syntax

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

@overload
def TunnelRoute(resource_name: str,
                opts: Optional[ResourceOptions] = None,
                account_id: Optional[str] = None,
                comment: Optional[str] = None,
                network: Optional[str] = None,
                tunnel_id: Optional[str] = None,
                virtual_network_id: Optional[str] = None)
func NewTunnelRoute(ctx *Context, name string, args TunnelRouteArgs, opts ...ResourceOption) (*TunnelRoute, error)
public TunnelRoute(string name, TunnelRouteArgs args, CustomResourceOptions? opts = null)
public TunnelRoute(String name, TunnelRouteArgs args)
public TunnelRoute(String name, TunnelRouteArgs args, CustomResourceOptions options)
type: cloudflare:TunnelRoute
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. TunnelRouteArgs
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. TunnelRouteArgs
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. TunnelRouteArgs
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. TunnelRouteArgs
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. TunnelRouteArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

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

AccountId This property is required. string
Cloudflare account ID
Network This property is required. string
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
TunnelId This property is required. string
UUID of the tunnel.
Comment string
Optional remark describing the route.
VirtualNetworkId string
UUID of the virtual network.
AccountId This property is required. string
Cloudflare account ID
Network This property is required. string
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
TunnelId This property is required. string
UUID of the tunnel.
Comment string
Optional remark describing the route.
VirtualNetworkId string
UUID of the virtual network.
accountId This property is required. String
Cloudflare account ID
network This property is required. String
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnelId This property is required. String
UUID of the tunnel.
comment String
Optional remark describing the route.
virtualNetworkId String
UUID of the virtual network.
accountId This property is required. string
Cloudflare account ID
network This property is required. string
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnelId This property is required. string
UUID of the tunnel.
comment string
Optional remark describing the route.
virtualNetworkId string
UUID of the virtual network.
account_id This property is required. str
Cloudflare account ID
network This property is required. str
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnel_id This property is required. str
UUID of the tunnel.
comment str
Optional remark describing the route.
virtual_network_id str
UUID of the virtual network.
accountId This property is required. String
Cloudflare account ID
network This property is required. String
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnelId This property is required. String
UUID of the tunnel.
comment String
Optional remark describing the route.
virtualNetworkId String
UUID of the virtual network.

Outputs

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

CreatedAt string
Timestamp of when the resource was created.
DeletedAt string
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
Id string
The provider-assigned unique ID for this managed resource.
CreatedAt string
Timestamp of when the resource was created.
DeletedAt string
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
Id string
The provider-assigned unique ID for this managed resource.
createdAt String
Timestamp of when the resource was created.
deletedAt String
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
id String
The provider-assigned unique ID for this managed resource.
createdAt string
Timestamp of when the resource was created.
deletedAt string
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
id string
The provider-assigned unique ID for this managed resource.
created_at str
Timestamp of when the resource was created.
deleted_at str
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
id str
The provider-assigned unique ID for this managed resource.
createdAt String
Timestamp of when the resource was created.
deletedAt String
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
id String
The provider-assigned unique ID for this managed resource.

Look up Existing TunnelRoute Resource

Get an existing TunnelRoute 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?: TunnelRouteState, opts?: CustomResourceOptions): TunnelRoute
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        account_id: Optional[str] = None,
        comment: Optional[str] = None,
        created_at: Optional[str] = None,
        deleted_at: Optional[str] = None,
        network: Optional[str] = None,
        tunnel_id: Optional[str] = None,
        virtual_network_id: Optional[str] = None) -> TunnelRoute
func GetTunnelRoute(ctx *Context, name string, id IDInput, state *TunnelRouteState, opts ...ResourceOption) (*TunnelRoute, error)
public static TunnelRoute Get(string name, Input<string> id, TunnelRouteState? state, CustomResourceOptions? opts = null)
public static TunnelRoute get(String name, Output<String> id, TunnelRouteState state, CustomResourceOptions options)
resources:  _:    type: cloudflare:TunnelRoute    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
Cloudflare account ID
Comment string
Optional remark describing the route.
CreatedAt string
Timestamp of when the resource was created.
DeletedAt string
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
Network string
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
TunnelId string
UUID of the tunnel.
VirtualNetworkId string
UUID of the virtual network.
AccountId string
Cloudflare account ID
Comment string
Optional remark describing the route.
CreatedAt string
Timestamp of when the resource was created.
DeletedAt string
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
Network string
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
TunnelId string
UUID of the tunnel.
VirtualNetworkId string
UUID of the virtual network.
accountId String
Cloudflare account ID
comment String
Optional remark describing the route.
createdAt String
Timestamp of when the resource was created.
deletedAt String
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
network String
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnelId String
UUID of the tunnel.
virtualNetworkId String
UUID of the virtual network.
accountId string
Cloudflare account ID
comment string
Optional remark describing the route.
createdAt string
Timestamp of when the resource was created.
deletedAt string
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
network string
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnelId string
UUID of the tunnel.
virtualNetworkId string
UUID of the virtual network.
account_id str
Cloudflare account ID
comment str
Optional remark describing the route.
created_at str
Timestamp of when the resource was created.
deleted_at str
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
network str
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnel_id str
UUID of the tunnel.
virtual_network_id str
UUID of the virtual network.
accountId String
Cloudflare account ID
comment String
Optional remark describing the route.
createdAt String
Timestamp of when the resource was created.
deletedAt String
Timestamp of when the resource was deleted. If null, the resource has not been deleted.
network String
The private IPv4 or IPv6 range connected by the route, in CIDR notation.
tunnelId String
UUID of the tunnel.
virtualNetworkId String
UUID of the virtual network.

Import

$ pulumi import cloudflare:index/tunnelRoute:TunnelRoute example '<account_id>/<route_id>'
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.