1. Packages
  2. Tailscale Provider
  3. API Docs
  4. getDevices
Tailscale v0.18.0 published on Thursday, Feb 27, 2025 by Pulumi

tailscale.getDevices

Explore with Pulumi AI

Tailscale v0.18.0 published on Thursday, Feb 27, 2025 by Pulumi

The devices data source describes a list of devices in a tailnet

Example Usage

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

const sampleDevices = tailscale.getDevices({
    namePrefix: "example-",
});
Copy
import pulumi
import pulumi_tailscale as tailscale

sample_devices = tailscale.get_devices(name_prefix="example-")
Copy
package main

import (
	"github.com/pulumi/pulumi-tailscale/sdk/go/tailscale"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := tailscale.GetDevices(ctx, &tailscale.GetDevicesArgs{
			NamePrefix: pulumi.StringRef("example-"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Tailscale = Pulumi.Tailscale;

return await Deployment.RunAsync(() => 
{
    var sampleDevices = Tailscale.GetDevices.Invoke(new()
    {
        NamePrefix = "example-",
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.tailscale.TailscaleFunctions;
import com.pulumi.tailscale.inputs.GetDevicesArgs;
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 sampleDevices = TailscaleFunctions.getDevices(GetDevicesArgs.builder()
            .namePrefix("example-")
            .build());

    }
}
Copy
variables:
  sampleDevices:
    fn::invoke:
      function: tailscale:getDevices
      arguments:
        namePrefix: example-
Copy

Using getDevices

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 getDevices(args: GetDevicesArgs, opts?: InvokeOptions): Promise<GetDevicesResult>
function getDevicesOutput(args: GetDevicesOutputArgs, opts?: InvokeOptions): Output<GetDevicesResult>
Copy
def get_devices(name_prefix: Optional[str] = None,
                opts: Optional[InvokeOptions] = None) -> GetDevicesResult
def get_devices_output(name_prefix: Optional[pulumi.Input[str]] = None,
                opts: Optional[InvokeOptions] = None) -> Output[GetDevicesResult]
Copy
func GetDevices(ctx *Context, args *GetDevicesArgs, opts ...InvokeOption) (*GetDevicesResult, error)
func GetDevicesOutput(ctx *Context, args *GetDevicesOutputArgs, opts ...InvokeOption) GetDevicesResultOutput
Copy

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

public static class GetDevices 
{
    public static Task<GetDevicesResult> InvokeAsync(GetDevicesArgs args, InvokeOptions? opts = null)
    public static Output<GetDevicesResult> Invoke(GetDevicesInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetDevicesResult> getDevices(GetDevicesArgs args, InvokeOptions options)
public static Output<GetDevicesResult> getDevices(GetDevicesArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: tailscale:index/getDevices:getDevices
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

NamePrefix string
Filters the device list to elements whose name has the provided prefix
NamePrefix string
Filters the device list to elements whose name has the provided prefix
namePrefix String
Filters the device list to elements whose name has the provided prefix
namePrefix string
Filters the device list to elements whose name has the provided prefix
name_prefix str
Filters the device list to elements whose name has the provided prefix
namePrefix String
Filters the device list to elements whose name has the provided prefix

getDevices Result

The following output properties are available:

Devices List<GetDevicesDevice>
The list of devices in the tailnet
Id string
The provider-assigned unique ID for this managed resource.
NamePrefix string
Filters the device list to elements whose name has the provided prefix
Devices []GetDevicesDevice
The list of devices in the tailnet
Id string
The provider-assigned unique ID for this managed resource.
NamePrefix string
Filters the device list to elements whose name has the provided prefix
devices List<GetDevicesDevice>
The list of devices in the tailnet
id String
The provider-assigned unique ID for this managed resource.
namePrefix String
Filters the device list to elements whose name has the provided prefix
devices GetDevicesDevice[]
The list of devices in the tailnet
id string
The provider-assigned unique ID for this managed resource.
namePrefix string
Filters the device list to elements whose name has the provided prefix
devices Sequence[GetDevicesDevice]
The list of devices in the tailnet
id str
The provider-assigned unique ID for this managed resource.
name_prefix str
Filters the device list to elements whose name has the provided prefix
devices List<Property Map>
The list of devices in the tailnet
id String
The provider-assigned unique ID for this managed resource.
namePrefix String
Filters the device list to elements whose name has the provided prefix

Supporting Types

GetDevicesDevice

Addresses This property is required. List<string>
The list of device's IPs
Hostname This property is required. string
The short hostname of the device
Id This property is required. string
The unique identifier of the device
Name This property is required. string
The full name of the device (e.g. hostname.domain.ts.net)
Tags This property is required. List<string>
The tags applied to the device
User This property is required. string
The user associated with the device
Addresses This property is required. []string
The list of device's IPs
Hostname This property is required. string
The short hostname of the device
Id This property is required. string
The unique identifier of the device
Name This property is required. string
The full name of the device (e.g. hostname.domain.ts.net)
Tags This property is required. []string
The tags applied to the device
User This property is required. string
The user associated with the device
addresses This property is required. List<String>
The list of device's IPs
hostname This property is required. String
The short hostname of the device
id This property is required. String
The unique identifier of the device
name This property is required. String
The full name of the device (e.g. hostname.domain.ts.net)
tags This property is required. List<String>
The tags applied to the device
user This property is required. String
The user associated with the device
addresses This property is required. string[]
The list of device's IPs
hostname This property is required. string
The short hostname of the device
id This property is required. string
The unique identifier of the device
name This property is required. string
The full name of the device (e.g. hostname.domain.ts.net)
tags This property is required. string[]
The tags applied to the device
user This property is required. string
The user associated with the device
addresses This property is required. Sequence[str]
The list of device's IPs
hostname This property is required. str
The short hostname of the device
id This property is required. str
The unique identifier of the device
name This property is required. str
The full name of the device (e.g. hostname.domain.ts.net)
tags This property is required. Sequence[str]
The tags applied to the device
user This property is required. str
The user associated with the device
addresses This property is required. List<String>
The list of device's IPs
hostname This property is required. String
The short hostname of the device
id This property is required. String
The unique identifier of the device
name This property is required. String
The full name of the device (e.g. hostname.domain.ts.net)
tags This property is required. List<String>
The tags applied to the device
user This property is required. String
The user associated with the device

Package Details

Repository
tailscale pulumi/pulumi-tailscale
License
Apache-2.0
Notes
This Pulumi package is based on the tailscale Terraform Provider.
Tailscale v0.18.0 published on Thursday, Feb 27, 2025 by Pulumi