1. Packages
  2. Tailscale Provider
  3. API Docs
  4. getDevices
Tailscale v0.26.0 published on Thursday, Feb 12, 2026 by Pulumi
tailscale logo
Tailscale v0.26.0 published on Thursday, Feb 12, 2026 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-",
        filters: [
            {
                name: "isEphemeral",
                values: ["true"],
            },
            {
                name: "tags",
                values: [
                    "tag:server",
                    "tag:test",
                ],
            },
        ],
    });
    
    import pulumi
    import pulumi_tailscale as tailscale
    
    sample_devices = tailscale.get_devices(name_prefix="example-",
        filters=[
            {
                "name": "isEphemeral",
                "values": ["true"],
            },
            {
                "name": "tags",
                "values": [
                    "tag:server",
                    "tag:test",
                ],
            },
        ])
    
    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-"),
    			Filters: []tailscale.GetDevicesFilter{
    				{
    					Name: "isEphemeral",
    					Values: []string{
    						"true",
    					},
    				},
    				{
    					Name: "tags",
    					Values: []string{
    						"tag:server",
    						"tag:test",
    					},
    				},
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    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-",
            Filters = new[]
            {
                new Tailscale.Inputs.GetDevicesFilterInputArgs
                {
                    Name = "isEphemeral",
                    Values = new[]
                    {
                        "true",
                    },
                },
                new Tailscale.Inputs.GetDevicesFilterInputArgs
                {
                    Name = "tags",
                    Values = new[]
                    {
                        "tag:server",
                        "tag:test",
                    },
                },
            },
        });
    
    });
    
    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-")
                .filters(            
                    GetDevicesFilterArgs.builder()
                        .name("isEphemeral")
                        .values("true")
                        .build(),
                    GetDevicesFilterArgs.builder()
                        .name("tags")
                        .values(                    
                            "tag:server",
                            "tag:test")
                        .build())
                .build());
    
        }
    }
    
    variables:
      sampleDevices:
        fn::invoke:
          function: tailscale:getDevices
          arguments:
            namePrefix: example-
            filters:
              - name: isEphemeral
                values:
                  - 'true'
              - name: tags
                values:
                  - tag:server
                  - tag:test
    

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

    > 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)
    }
    public static CompletableFuture<GetDevicesResult> getDevices(GetDevicesArgs args, InvokeOptions options)
    public static Output<GetDevicesResult> getDevices(GetDevicesArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tailscale:index/getDevices:getDevices
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Filters List<GetDevicesFilter>
    Filters the device list to elements devices whose fields match the provided values.
    NamePrefix string
    Filters the device list to elements whose name has the provided prefix
    Filters []GetDevicesFilter
    Filters the device list to elements devices whose fields match the provided values.
    NamePrefix string
    Filters the device list to elements whose name has the provided prefix
    filters List<GetDevicesFilter>
    Filters the device list to elements devices whose fields match the provided values.
    namePrefix String
    Filters the device list to elements whose name has the provided prefix
    filters GetDevicesFilter[]
    Filters the device list to elements devices whose fields match the provided values.
    namePrefix string
    Filters the device list to elements whose name has the provided prefix
    filters Sequence[GetDevicesFilter]
    Filters the device list to elements devices whose fields match the provided values.
    name_prefix str
    Filters the device list to elements whose name has the provided prefix
    filters List<Property Map>
    Filters the device list to elements devices whose fields match the provided values.
    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.
    Filters List<GetDevicesFilter>
    Filters the device list to elements devices whose fields match the provided values.
    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.
    Filters []GetDevicesFilter
    Filters the device list to elements devices whose fields match the provided values.
    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.
    filters List<GetDevicesFilter>
    Filters the device list to elements devices whose fields match the provided values.
    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.
    filters GetDevicesFilter[]
    Filters the device list to elements devices whose fields match the provided values.
    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.
    filters Sequence[GetDevicesFilter]
    Filters the device list to elements devices whose fields match the provided values.
    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.
    filters List<Property Map>
    Filters the device list to elements devices whose fields match the provided values.
    namePrefix String
    Filters the device list to elements whose name has the provided prefix

    Supporting Types

    GetDevicesDevice

    Addresses List<string>
    The list of device's IPs
    Authorized bool
    Whether the device is authorized to access the tailnet
    BlocksIncomingConnections bool
    Whether the device blocks incoming connections
    ClientVersion string
    The Tailscale client version running on the device
    Created string
    The creation time of the device
    Expires string
    The expiry time of the device's key
    Hostname string
    The short hostname of the device
    Id string
    The legacy identifier of the device. Use node_id instead for new resources.
    IsExternal bool
    Whether the device is marked as external
    KeyExpiryDisabled bool
    Whether the device's key expiry is disabled
    LastSeen string
    The last seen time of the device
    MachineKey string
    The machine key of the device
    Name string
    The full name of the device (e.g. hostname.domain.ts.net)
    NodeId string
    The preferred indentifier for a device.
    NodeKey string
    The node key of the device
    Os string
    The operating system of the device
    Tags List<string>
    The tags applied to the device
    TailnetLockError string
    The tailnet lock error for the device, if any
    TailnetLockKey string
    The tailnet lock key for the device, if any
    UpdateAvailable bool
    Whether an update is available for the device
    User string
    The user associated with the device
    Addresses []string
    The list of device's IPs
    Authorized bool
    Whether the device is authorized to access the tailnet
    BlocksIncomingConnections bool
    Whether the device blocks incoming connections
    ClientVersion string
    The Tailscale client version running on the device
    Created string
    The creation time of the device
    Expires string
    The expiry time of the device's key
    Hostname string
    The short hostname of the device
    Id string
    The legacy identifier of the device. Use node_id instead for new resources.
    IsExternal bool
    Whether the device is marked as external
    KeyExpiryDisabled bool
    Whether the device's key expiry is disabled
    LastSeen string
    The last seen time of the device
    MachineKey string
    The machine key of the device
    Name string
    The full name of the device (e.g. hostname.domain.ts.net)
    NodeId string
    The preferred indentifier for a device.
    NodeKey string
    The node key of the device
    Os string
    The operating system of the device
    Tags []string
    The tags applied to the device
    TailnetLockError string
    The tailnet lock error for the device, if any
    TailnetLockKey string
    The tailnet lock key for the device, if any
    UpdateAvailable bool
    Whether an update is available for the device
    User string
    The user associated with the device
    addresses List<String>
    The list of device's IPs
    authorized Boolean
    Whether the device is authorized to access the tailnet
    blocksIncomingConnections Boolean
    Whether the device blocks incoming connections
    clientVersion String
    The Tailscale client version running on the device
    created String
    The creation time of the device
    expires String
    The expiry time of the device's key
    hostname String
    The short hostname of the device
    id String
    The legacy identifier of the device. Use node_id instead for new resources.
    isExternal Boolean
    Whether the device is marked as external
    keyExpiryDisabled Boolean
    Whether the device's key expiry is disabled
    lastSeen String
    The last seen time of the device
    machineKey String
    The machine key of the device
    name String
    The full name of the device (e.g. hostname.domain.ts.net)
    nodeId String
    The preferred indentifier for a device.
    nodeKey String
    The node key of the device
    os String
    The operating system of the device
    tags List<String>
    The tags applied to the device
    tailnetLockError String
    The tailnet lock error for the device, if any
    tailnetLockKey String
    The tailnet lock key for the device, if any
    updateAvailable Boolean
    Whether an update is available for the device
    user String
    The user associated with the device
    addresses string[]
    The list of device's IPs
    authorized boolean
    Whether the device is authorized to access the tailnet
    blocksIncomingConnections boolean
    Whether the device blocks incoming connections
    clientVersion string
    The Tailscale client version running on the device
    created string
    The creation time of the device
    expires string
    The expiry time of the device's key
    hostname string
    The short hostname of the device
    id string
    The legacy identifier of the device. Use node_id instead for new resources.
    isExternal boolean
    Whether the device is marked as external
    keyExpiryDisabled boolean
    Whether the device's key expiry is disabled
    lastSeen string
    The last seen time of the device
    machineKey string
    The machine key of the device
    name string
    The full name of the device (e.g. hostname.domain.ts.net)
    nodeId string
    The preferred indentifier for a device.
    nodeKey string
    The node key of the device
    os string
    The operating system of the device
    tags string[]
    The tags applied to the device
    tailnetLockError string
    The tailnet lock error for the device, if any
    tailnetLockKey string
    The tailnet lock key for the device, if any
    updateAvailable boolean
    Whether an update is available for the device
    user string
    The user associated with the device
    addresses Sequence[str]
    The list of device's IPs
    authorized bool
    Whether the device is authorized to access the tailnet
    blocks_incoming_connections bool
    Whether the device blocks incoming connections
    client_version str
    The Tailscale client version running on the device
    created str
    The creation time of the device
    expires str
    The expiry time of the device's key
    hostname str
    The short hostname of the device
    id str
    The legacy identifier of the device. Use node_id instead for new resources.
    is_external bool
    Whether the device is marked as external
    key_expiry_disabled bool
    Whether the device's key expiry is disabled
    last_seen str
    The last seen time of the device
    machine_key str
    The machine key of the device
    name str
    The full name of the device (e.g. hostname.domain.ts.net)
    node_id str
    The preferred indentifier for a device.
    node_key str
    The node key of the device
    os str
    The operating system of the device
    tags Sequence[str]
    The tags applied to the device
    tailnet_lock_error str
    The tailnet lock error for the device, if any
    tailnet_lock_key str
    The tailnet lock key for the device, if any
    update_available bool
    Whether an update is available for the device
    user str
    The user associated with the device
    addresses List<String>
    The list of device's IPs
    authorized Boolean
    Whether the device is authorized to access the tailnet
    blocksIncomingConnections Boolean
    Whether the device blocks incoming connections
    clientVersion String
    The Tailscale client version running on the device
    created String
    The creation time of the device
    expires String
    The expiry time of the device's key
    hostname String
    The short hostname of the device
    id String
    The legacy identifier of the device. Use node_id instead for new resources.
    isExternal Boolean
    Whether the device is marked as external
    keyExpiryDisabled Boolean
    Whether the device's key expiry is disabled
    lastSeen String
    The last seen time of the device
    machineKey String
    The machine key of the device
    name String
    The full name of the device (e.g. hostname.domain.ts.net)
    nodeId String
    The preferred indentifier for a device.
    nodeKey String
    The node key of the device
    os String
    The operating system of the device
    tags List<String>
    The tags applied to the device
    tailnetLockError String
    The tailnet lock error for the device, if any
    tailnetLockKey String
    The tailnet lock key for the device, if any
    updateAvailable Boolean
    Whether an update is available for the device
    user String
    The user associated with the device

    GetDevicesFilter

    Name string
    The name must be a top-level device property, e.g. isEphemeral, tags, hostname, etc.
    Values List<string>
    The list of values to filter for. Values are matched as exact matches.
    Name string
    The name must be a top-level device property, e.g. isEphemeral, tags, hostname, etc.
    Values []string
    The list of values to filter for. Values are matched as exact matches.
    name String
    The name must be a top-level device property, e.g. isEphemeral, tags, hostname, etc.
    values List<String>
    The list of values to filter for. Values are matched as exact matches.
    name string
    The name must be a top-level device property, e.g. isEphemeral, tags, hostname, etc.
    values string[]
    The list of values to filter for. Values are matched as exact matches.
    name str
    The name must be a top-level device property, e.g. isEphemeral, tags, hostname, etc.
    values Sequence[str]
    The list of values to filter for. Values are matched as exact matches.
    name String
    The name must be a top-level device property, e.g. isEphemeral, tags, hostname, etc.
    values List<String>
    The list of values to filter for. Values are matched as exact matches.

    Package Details

    Repository
    tailscale pulumi/pulumi-tailscale
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the tailscale Terraform Provider.
    tailscale logo
    Tailscale v0.26.0 published on Thursday, Feb 12, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate