1. Packages
  2. Tailscale Provider
  3. API Docs
  4. getDevice
Tailscale v0.27.0 published on Friday, Feb 20, 2026 by Pulumi
tailscale logo
Tailscale v0.27.0 published on Friday, Feb 20, 2026 by Pulumi

    The device data source describes a single device in a tailnet

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as tailscale from "@pulumi/tailscale";
    
    const sampleDevice = tailscale.getDevice({
        name: "device1.example.ts.net",
        waitFor: "60s",
    });
    const sampleDevice2 = tailscale.getDevice({
        hostname: "device2",
        waitFor: "60s",
    });
    
    import pulumi
    import pulumi_tailscale as tailscale
    
    sample_device = tailscale.get_device(name="device1.example.ts.net",
        wait_for="60s")
    sample_device2 = tailscale.get_device(hostname="device2",
        wait_for="60s")
    
    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.GetDevice(ctx, &tailscale.GetDeviceArgs{
    			Name:    pulumi.StringRef("device1.example.ts.net"),
    			WaitFor: pulumi.StringRef("60s"),
    		}, nil)
    		if err != nil {
    			return err
    		}
    		_, err = tailscale.GetDevice(ctx, &tailscale.GetDeviceArgs{
    			Hostname: pulumi.StringRef("device2"),
    			WaitFor:  pulumi.StringRef("60s"),
    		}, 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 sampleDevice = Tailscale.GetDevice.Invoke(new()
        {
            Name = "device1.example.ts.net",
            WaitFor = "60s",
        });
    
        var sampleDevice2 = Tailscale.GetDevice.Invoke(new()
        {
            Hostname = "device2",
            WaitFor = "60s",
        });
    
    });
    
    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.GetDeviceArgs;
    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 sampleDevice = TailscaleFunctions.getDevice(GetDeviceArgs.builder()
                .name("device1.example.ts.net")
                .waitFor("60s")
                .build());
    
            final var sampleDevice2 = TailscaleFunctions.getDevice(GetDeviceArgs.builder()
                .hostname("device2")
                .waitFor("60s")
                .build());
    
        }
    }
    
    variables:
      sampleDevice:
        fn::invoke:
          function: tailscale:getDevice
          arguments:
            name: device1.example.ts.net
            waitFor: 60s
      sampleDevice2:
        fn::invoke:
          function: tailscale:getDevice
          arguments:
            hostname: device2
            waitFor: 60s
    

    Using getDevice

    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 getDevice(args: GetDeviceArgs, opts?: InvokeOptions): Promise<GetDeviceResult>
    function getDeviceOutput(args: GetDeviceOutputArgs, opts?: InvokeOptions): Output<GetDeviceResult>
    def get_device(hostname: Optional[str] = None,
                   name: Optional[str] = None,
                   wait_for: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetDeviceResult
    def get_device_output(hostname: Optional[pulumi.Input[str]] = None,
                   name: Optional[pulumi.Input[str]] = None,
                   wait_for: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetDeviceResult]
    func GetDevice(ctx *Context, args *GetDeviceArgs, opts ...InvokeOption) (*GetDeviceResult, error)
    func GetDeviceOutput(ctx *Context, args *GetDeviceOutputArgs, opts ...InvokeOption) GetDeviceResultOutput

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

    public static class GetDevice 
    {
        public static Task<GetDeviceResult> InvokeAsync(GetDeviceArgs args, InvokeOptions? opts = null)
        public static Output<GetDeviceResult> Invoke(GetDeviceInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetDeviceResult> getDevice(GetDeviceArgs args, InvokeOptions options)
    public static Output<GetDeviceResult> getDevice(GetDeviceArgs args, InvokeOptions options)
    
    fn::invoke:
      function: tailscale:index/getDevice:getDevice
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Hostname string
    The short hostname of the device
    Name string
    The full name of the device (e.g. hostname.domain.ts.net)
    WaitFor string
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    Hostname string
    The short hostname of the device
    Name string
    The full name of the device (e.g. hostname.domain.ts.net)
    WaitFor string
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    hostname String
    The short hostname of the device
    name String
    The full name of the device (e.g. hostname.domain.ts.net)
    waitFor String
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    hostname string
    The short hostname of the device
    name string
    The full name of the device (e.g. hostname.domain.ts.net)
    waitFor string
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    hostname str
    The short hostname of the device
    name str
    The full name of the device (e.g. hostname.domain.ts.net)
    wait_for str
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    hostname String
    The short hostname of the device
    name String
    The full name of the device (e.g. hostname.domain.ts.net)
    waitFor String
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s

    getDevice Result

    The following output properties are available:

    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
    Id string
    The provider-assigned unique ID for this managed resource.
    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
    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
    Hostname string
    The short hostname of the device
    Name string
    The full name of the device (e.g. hostname.domain.ts.net)
    WaitFor string
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    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
    Id string
    The provider-assigned unique ID for this managed resource.
    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
    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
    Hostname string
    The short hostname of the device
    Name string
    The full name of the device (e.g. hostname.domain.ts.net)
    WaitFor string
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    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
    id String
    The provider-assigned unique ID for this managed resource.
    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
    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
    hostname String
    The short hostname of the device
    name String
    The full name of the device (e.g. hostname.domain.ts.net)
    waitFor String
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    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
    id string
    The provider-assigned unique ID for this managed resource.
    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
    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
    hostname string
    The short hostname of the device
    name string
    The full name of the device (e.g. hostname.domain.ts.net)
    waitFor string
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    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
    id str
    The provider-assigned unique ID for this managed resource.
    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
    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
    hostname str
    The short hostname of the device
    name str
    The full name of the device (e.g. hostname.domain.ts.net)
    wait_for str
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s
    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
    id String
    The provider-assigned unique ID for this managed resource.
    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
    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
    hostname String
    The short hostname of the device
    name String
    The full name of the device (e.g. hostname.domain.ts.net)
    waitFor String
    If specified, the provider will make multiple attempts to obtain the data source until the wait_for duration is reached. Retries are made every second so this value should be greater than 1s

    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.27.0 published on Friday, Feb 20, 2026 by Pulumi
      Meet Neo: Your AI Platform Teammate