Tailscale v0.16.0 published on Monday, May 6, 2024 by Pulumi
tailscale.getDevice
Explore with Pulumi AI
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)
// Output-based functions aren't available in Java yet
fn::invoke:
  function: tailscale:index/getDevice:getDevice
  arguments:
    # arguments dictionaryThe 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) - Wait
For 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) - Wait
For 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) - wait
For 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) - wait
For 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) - wait
For 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
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - List<string>
 - The tags applied to 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) - Wait
For 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
 - Id string
 - The provider-assigned unique ID for this managed resource.
 - []string
 - The tags applied to 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) - Wait
For 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
 - id String
 - The provider-assigned unique ID for this managed resource.
 - List<String>
 - The tags applied to 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) - wait
For 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
 - id string
 - The provider-assigned unique ID for this managed resource.
 - string[]
 - The tags applied to 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) - wait
For 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
 - id str
 - The provider-assigned unique ID for this managed resource.
 - Sequence[str]
 - The tags applied to 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
 - id String
 - The provider-assigned unique ID for this managed resource.
 - List<String>
 - The tags applied to 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) - wait
For 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 
tailscaleTerraform Provider.