cloudflare.TunnelRoute
Explore with Pulumi AI
Provides a resource, that manages Cloudflare tunnel routes for Zero Trust. Tunnel routes are used to direct IP traffic through Cloudflare Tunnels.
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as cloudflare from "@pulumi/cloudflare";
// Tunnel route
const exampleTunnelRoute = new cloudflare.TunnelRoute("exampleTunnelRoute", {
accountId: "f037e56e89293a057740de681ac9abbe",
tunnelId: "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
network: "192.0.2.24/32",
comment: "New tunnel route for documentation",
virtualNetworkId: "bdc39a3c-3104-4c23-8ac0-9f455dda691a",
});
// Tunnel with tunnel route
const tunnel = new cloudflare.Tunnel("tunnel", {
accountId: "f037e56e89293a057740de681ac9abbe",
name: "my_tunnel",
secret: "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=",
});
const exampleIndex_tunnelRouteTunnelRoute = new cloudflare.TunnelRoute("exampleIndex/tunnelRouteTunnelRoute", {
accountId: "f037e56e89293a057740de681ac9abbe",
tunnelId: tunnel.id,
network: "192.0.2.24/32",
comment: "New tunnel route for documentation",
virtualNetworkId: "bdc39a3c-3104-4c23-8ac0-9f455dda691a",
});
import pulumi
import pulumi_cloudflare as cloudflare
# Tunnel route
example_tunnel_route = cloudflare.TunnelRoute("exampleTunnelRoute",
account_id="f037e56e89293a057740de681ac9abbe",
tunnel_id="f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
network="192.0.2.24/32",
comment="New tunnel route for documentation",
virtual_network_id="bdc39a3c-3104-4c23-8ac0-9f455dda691a")
# Tunnel with tunnel route
tunnel = cloudflare.Tunnel("tunnel",
account_id="f037e56e89293a057740de681ac9abbe",
name="my_tunnel",
secret="AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=")
example_index_tunnel_route_tunnel_route = cloudflare.TunnelRoute("exampleIndex/tunnelRouteTunnelRoute",
account_id="f037e56e89293a057740de681ac9abbe",
tunnel_id=tunnel.id,
network="192.0.2.24/32",
comment="New tunnel route for documentation",
virtual_network_id="bdc39a3c-3104-4c23-8ac0-9f455dda691a")
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 {
// Tunnel route
_, err := cloudflare.NewTunnelRoute(ctx, "exampleTunnelRoute", &cloudflare.TunnelRouteArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
TunnelId: pulumi.String("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415"),
Network: pulumi.String("192.0.2.24/32"),
Comment: pulumi.String("New tunnel route for documentation"),
VirtualNetworkId: pulumi.String("bdc39a3c-3104-4c23-8ac0-9f455dda691a"),
})
if err != nil {
return err
}
// Tunnel with tunnel route
tunnel, err := cloudflare.NewTunnel(ctx, "tunnel", &cloudflare.TunnelArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
Name: pulumi.String("my_tunnel"),
Secret: pulumi.String("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg="),
})
if err != nil {
return err
}
_, err = cloudflare.NewTunnelRoute(ctx, "exampleIndex/tunnelRouteTunnelRoute", &cloudflare.TunnelRouteArgs{
AccountId: pulumi.String("f037e56e89293a057740de681ac9abbe"),
TunnelId: tunnel.ID(),
Network: pulumi.String("192.0.2.24/32"),
Comment: pulumi.String("New tunnel route for documentation"),
VirtualNetworkId: pulumi.String("bdc39a3c-3104-4c23-8ac0-9f455dda691a"),
})
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Cloudflare = Pulumi.Cloudflare;
return await Deployment.RunAsync(() =>
{
// Tunnel route
var exampleTunnelRoute = new Cloudflare.TunnelRoute("exampleTunnelRoute", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
TunnelId = "f70ff985-a4ef-4643-bbbc-4a0ed4fc8415",
Network = "192.0.2.24/32",
Comment = "New tunnel route for documentation",
VirtualNetworkId = "bdc39a3c-3104-4c23-8ac0-9f455dda691a",
});
// Tunnel with tunnel route
var tunnel = new Cloudflare.Tunnel("tunnel", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
Name = "my_tunnel",
Secret = "AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=",
});
var exampleIndex_tunnelRouteTunnelRoute = new Cloudflare.TunnelRoute("exampleIndex/tunnelRouteTunnelRoute", new()
{
AccountId = "f037e56e89293a057740de681ac9abbe",
TunnelId = tunnel.Id,
Network = "192.0.2.24/32",
Comment = "New tunnel route for documentation",
VirtualNetworkId = "bdc39a3c-3104-4c23-8ac0-9f455dda691a",
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.TunnelRoute;
import com.pulumi.cloudflare.TunnelRouteArgs;
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) {
// Tunnel route
var exampleTunnelRoute = new TunnelRoute("exampleTunnelRoute", TunnelRouteArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.tunnelId("f70ff985-a4ef-4643-bbbc-4a0ed4fc8415")
.network("192.0.2.24/32")
.comment("New tunnel route for documentation")
.virtualNetworkId("bdc39a3c-3104-4c23-8ac0-9f455dda691a")
.build());
// Tunnel with tunnel route
var tunnel = new Tunnel("tunnel", TunnelArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.name("my_tunnel")
.secret("AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=")
.build());
var exampleIndex_tunnelRouteTunnelRoute = new TunnelRoute("exampleIndex/tunnelRouteTunnelRoute", TunnelRouteArgs.builder()
.accountId("f037e56e89293a057740de681ac9abbe")
.tunnelId(tunnel.id())
.network("192.0.2.24/32")
.comment("New tunnel route for documentation")
.virtualNetworkId("bdc39a3c-3104-4c23-8ac0-9f455dda691a")
.build());
}
}
resources:
# Tunnel route
exampleTunnelRoute:
type: cloudflare:TunnelRoute
properties:
accountId: f037e56e89293a057740de681ac9abbe
tunnelId: f70ff985-a4ef-4643-bbbc-4a0ed4fc8415
network: 192.0.2.24/32
comment: New tunnel route for documentation
virtualNetworkId: bdc39a3c-3104-4c23-8ac0-9f455dda691a
# Tunnel with tunnel route
tunnel:
type: cloudflare:Tunnel
properties:
accountId: f037e56e89293a057740de681ac9abbe
name: my_tunnel
secret: AQIDBAUGBwgBAgMEBQYHCAECAwQFBgcIAQIDBAUGBwg=
exampleIndex/tunnelRouteTunnelRoute:
type: cloudflare:TunnelRoute
properties:
accountId: f037e56e89293a057740de681ac9abbe
tunnelId: ${tunnel.id}
network: 192.0.2.24/32
comment: New tunnel route for documentation
virtualNetworkId: bdc39a3c-3104-4c23-8ac0-9f455dda691a
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,
network: Optional[str] = None,
tunnel_id: Optional[str] = None,
comment: 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 string
- The unique name of the resource.
- args TunnelRouteArgs
- 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 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 string
- The unique name of the resource.
- args TunnelRouteArgs
- The arguments to resource properties.
- opts ResourceOption
- Bag of options to control resource's behavior.
- name string
- The unique name of the resource.
- args TunnelRouteArgs
- The arguments to resource properties.
- opts CustomResourceOptions
- Bag of options to control resource's behavior.
- name String
- The unique name of the resource.
- args TunnelRouteArgs
- The arguments to resource properties.
- options CustomResourceOptions
- Bag of options to control resource's behavior.
Example
The following reference example uses placeholder values for all input properties.
var tunnelRouteResource = new Cloudflare.TunnelRoute("tunnelRouteResource", new()
{
AccountId = "string",
Network = "string",
TunnelId = "string",
Comment = "string",
VirtualNetworkId = "string",
});
example, err := cloudflare.NewTunnelRoute(ctx, "tunnelRouteResource", &cloudflare.TunnelRouteArgs{
AccountId: pulumi.String("string"),
Network: pulumi.String("string"),
TunnelId: pulumi.String("string"),
Comment: pulumi.String("string"),
VirtualNetworkId: pulumi.String("string"),
})
var tunnelRouteResource = new TunnelRoute("tunnelRouteResource", TunnelRouteArgs.builder()
.accountId("string")
.network("string")
.tunnelId("string")
.comment("string")
.virtualNetworkId("string")
.build());
tunnel_route_resource = cloudflare.TunnelRoute("tunnelRouteResource",
account_id="string",
network="string",
tunnel_id="string",
comment="string",
virtual_network_id="string")
const tunnelRouteResource = new cloudflare.TunnelRoute("tunnelRouteResource", {
accountId: "string",
network: "string",
tunnelId: "string",
comment: "string",
virtualNetworkId: "string",
});
type: cloudflare:TunnelRoute
properties:
accountId: string
comment: string
network: string
tunnelId: string
virtualNetworkId: string
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
The TunnelRoute resource accepts the following input properties:
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Network string
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- Tunnel
Id string - The ID of the tunnel that will service the tunnel route.
- Comment string
- Description of the tunnel route.
- Virtual
Network stringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Network string
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- Tunnel
Id string - The ID of the tunnel that will service the tunnel route.
- Comment string
- Description of the tunnel route.
- Virtual
Network stringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- network String
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel
Id String - The ID of the tunnel that will service the tunnel route.
- comment String
- Description of the tunnel route.
- virtual
Network StringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- network string
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel
Id string - The ID of the tunnel that will service the tunnel route.
- comment string
- Description of the tunnel route.
- virtual
Network stringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. 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.
- network str
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel_
id str - The ID of the tunnel that will service the tunnel route.
- comment str
- Description of the tunnel route.
- virtual_
network_ strid - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- network String
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel
Id String - The ID of the tunnel that will service the tunnel route.
- comment String
- Description of the tunnel route.
- virtual
Network StringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
Outputs
All input properties are implicitly available as output properties. Additionally, the TunnelRoute 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 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,
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)
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.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Comment string
- Description of the tunnel route.
- Network string
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- Tunnel
Id string - The ID of the tunnel that will service the tunnel route.
- Virtual
Network stringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- Account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- Comment string
- Description of the tunnel route.
- Network string
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- Tunnel
Id string - The ID of the tunnel that will service the tunnel route.
- Virtual
Network stringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- comment String
- Description of the tunnel route.
- network String
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel
Id String - The ID of the tunnel that will service the tunnel route.
- virtual
Network StringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- account
Id string - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- comment string
- Description of the tunnel route.
- network string
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel
Id string - The ID of the tunnel that will service the tunnel route.
- virtual
Network stringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. 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.
- comment str
- Description of the tunnel route.
- network str
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel_
id str - The ID of the tunnel that will service the tunnel route.
- virtual_
network_ strid - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
- account
Id String - The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
- comment String
- Description of the tunnel route.
- network String
- The IPv4 or IPv6 network that should use this tunnel route, in CIDR notation.
- tunnel
Id String - The ID of the tunnel that will service the tunnel route.
- virtual
Network StringId - The ID of the virtual network for which this route is being added; uses the default virtual network of the account if none is provided. Modifying this attribute will force creation of a new resource.
Import
$ pulumi import cloudflare:index/tunnelRoute:TunnelRoute example <account_id>/<network_cidr>/<virtual_network_id>
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.