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

cloudflare.getTunnel

Explore with Pulumi AI

Cloudflare v5.49.1 published on Tuesday, Feb 18, 2025 by Pulumi

Use this datasource to lookup a tunnel in an account.

Example Usage

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

const example = cloudflare.getTunnel({
    accountId: "f037e56e89293a057740de681ac9abbe",
    name: "my-tunnel",
});
Copy
import pulumi
import pulumi_cloudflare as cloudflare

example = cloudflare.get_tunnel(account_id="f037e56e89293a057740de681ac9abbe",
    name="my-tunnel")
Copy
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.LookupTunnel(ctx, &cloudflare.LookupTunnelArgs{
			AccountId: "f037e56e89293a057740de681ac9abbe",
			Name:      "my-tunnel",
		}, nil)
		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 example = Cloudflare.GetTunnel.Invoke(new()
    {
        AccountId = "f037e56e89293a057740de681ac9abbe",
        Name = "my-tunnel",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.cloudflare.CloudflareFunctions;
import com.pulumi.cloudflare.inputs.GetTunnelArgs;
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) {
        final var example = CloudflareFunctions.getTunnel(GetTunnelArgs.builder()
            .accountId("f037e56e89293a057740de681ac9abbe")
            .name("my-tunnel")
            .build());

    }
}
Copy
variables:
  example:
    fn::invoke:
      function: cloudflare:getTunnel
      arguments:
        accountId: f037e56e89293a057740de681ac9abbe
        name: my-tunnel
Copy

Using getTunnel

Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

function getTunnel(args: GetTunnelArgs, opts?: InvokeOptions): Promise<GetTunnelResult>
function getTunnelOutput(args: GetTunnelOutputArgs, opts?: InvokeOptions): Output<GetTunnelResult>
Copy
def get_tunnel(account_id: Optional[str] = None,
               is_deleted: Optional[bool] = None,
               name: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetTunnelResult
def get_tunnel_output(account_id: Optional[pulumi.Input[str]] = None,
               is_deleted: Optional[pulumi.Input[bool]] = None,
               name: Optional[pulumi.Input[str]] = None,
               opts: Optional[InvokeOptions] = None) -> Output[GetTunnelResult]
Copy
func LookupTunnel(ctx *Context, args *LookupTunnelArgs, opts ...InvokeOption) (*LookupTunnelResult, error)
func LookupTunnelOutput(ctx *Context, args *LookupTunnelOutputArgs, opts ...InvokeOption) LookupTunnelResultOutput
Copy

> Note: This function is named LookupTunnel in the Go SDK.

public static class GetTunnel 
{
    public static Task<GetTunnelResult> InvokeAsync(GetTunnelArgs args, InvokeOptions? opts = null)
    public static Output<GetTunnelResult> Invoke(GetTunnelInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetTunnelResult> getTunnel(GetTunnelArgs args, InvokeOptions options)
public static Output<GetTunnelResult> getTunnel(GetTunnelArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: cloudflare:index/getTunnel:getTunnel
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

AccountId
This property is required.
Changes to this property will trigger replacement.
string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Name
This property is required.
Changes to this property will trigger replacement.
string
Name of the tunnel. Modifying this attribute will force creation of a new resource.
IsDeleted Changes to this property will trigger replacement. bool
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.
AccountId
This property is required.
Changes to this property will trigger replacement.
string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Name
This property is required.
Changes to this property will trigger replacement.
string
Name of the tunnel. Modifying this attribute will force creation of a new resource.
IsDeleted Changes to this property will trigger replacement. bool
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.
accountId
This property is required.
Changes to this property will trigger replacement.
String
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
name
This property is required.
Changes to this property will trigger replacement.
String
Name of the tunnel. Modifying this attribute will force creation of a new resource.
isDeleted Changes to this property will trigger replacement. Boolean
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.
accountId
This property is required.
Changes to this property will trigger replacement.
string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
name
This property is required.
Changes to this property will trigger replacement.
string
Name of the tunnel. Modifying this attribute will force creation of a new resource.
isDeleted Changes to this property will trigger replacement. boolean
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.
account_id
This property is required.
Changes to this property will trigger replacement.
str
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
name
This property is required.
Changes to this property will trigger replacement.
str
Name of the tunnel. Modifying this attribute will force creation of a new resource.
is_deleted Changes to this property will trigger replacement. bool
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.
accountId
This property is required.
Changes to this property will trigger replacement.
String
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
name
This property is required.
Changes to this property will trigger replacement.
String
Name of the tunnel. Modifying this attribute will force creation of a new resource.
isDeleted Changes to this property will trigger replacement. Boolean
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.

getTunnel Result

The following output properties are available:

AccountId string
The account identifier to target for the resource. Modifying this attribute will force creation of a new resource.
Id string
ID of the tunnel.
Name string
Name of the tunnel. Modifying this attribute will force creation of a new resource.
RemoteConfig bool
Whether the tunnel can be configured remotely from the Zero Trust dashboard.
Status string
The status of the tunnel. Available values: inactive, degraded, healthy, down.
TunnelType string
The type of the tunnel. Available values: cfd_tunnel, warp_connector.
IsDeleted bool
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. 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.
Id string
ID of the tunnel.
Name string
Name of the tunnel. Modifying this attribute will force creation of a new resource.
RemoteConfig bool
Whether the tunnel can be configured remotely from the Zero Trust dashboard.
Status string
The status of the tunnel. Available values: inactive, degraded, healthy, down.
TunnelType string
The type of the tunnel. Available values: cfd_tunnel, warp_connector.
IsDeleted bool
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. 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.
id String
ID of the tunnel.
name String
Name of the tunnel. Modifying this attribute will force creation of a new resource.
remoteConfig Boolean
Whether the tunnel can be configured remotely from the Zero Trust dashboard.
status String
The status of the tunnel. Available values: inactive, degraded, healthy, down.
tunnelType String
The type of the tunnel. Available values: cfd_tunnel, warp_connector.
isDeleted Boolean
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. 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.
id string
ID of the tunnel.
name string
Name of the tunnel. Modifying this attribute will force creation of a new resource.
remoteConfig boolean
Whether the tunnel can be configured remotely from the Zero Trust dashboard.
status string
The status of the tunnel. Available values: inactive, degraded, healthy, down.
tunnelType string
The type of the tunnel. Available values: cfd_tunnel, warp_connector.
isDeleted boolean
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. 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.
id str
ID of the tunnel.
name str
Name of the tunnel. Modifying this attribute will force creation of a new resource.
remote_config bool
Whether the tunnel can be configured remotely from the Zero Trust dashboard.
status str
The status of the tunnel. Available values: inactive, degraded, healthy, down.
tunnel_type str
The type of the tunnel. Available values: cfd_tunnel, warp_connector.
is_deleted bool
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. 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.
id String
ID of the tunnel.
name String
Name of the tunnel. Modifying this attribute will force creation of a new resource.
remoteConfig Boolean
Whether the tunnel can be configured remotely from the Zero Trust dashboard.
status String
The status of the tunnel. Available values: inactive, degraded, healthy, down.
tunnelType String
The type of the tunnel. Available values: cfd_tunnel, warp_connector.
isDeleted Boolean
If true, only include deleted tunnels. If false, exclude deleted tunnels. If empty, all tunnels will be included. Modifying this attribute will force creation of a new resource.

Package Details

Repository
Cloudflare pulumi/pulumi-cloudflare
License
Apache-2.0
Notes
This Pulumi package is based on the cloudflare Terraform Provider.
Cloudflare v5.49.1 published on Tuesday, Feb 18, 2025 by Pulumi