tailscale logo
Tailscale v0.12.0, Jan 25 23

tailscale.getDevice

Explore with Pulumi AI

The device data source describes a single device in a tailnet

Example Usage

using System.Collections.Generic;
using Pulumi;
using Tailscale = Pulumi.Tailscale;

return await Deployment.RunAsync(() => 
{
    var sampleDevice = Tailscale.GetDevice.Invoke(new()
    {
        Name = "user1-device.example.com",
        WaitFor = "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:    "user1-device.example.com",
			WaitFor: pulumi.StringRef("60s"),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
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("user1-device.example.com")
            .waitFor("60s")
            .build());

    }
}
import pulumi
import pulumi_tailscale as tailscale

sample_device = tailscale.get_device(name="user1-device.example.com",
    wait_for="60s")
import * as pulumi from "@pulumi/pulumi";
import * as tailscale from "@pulumi/tailscale";

const sampleDevice = tailscale.getDevice({
    name: "user1-device.example.com",
    waitFor: "60s",
});
variables:
  sampleDevice:
    fn::invoke:
      Function: tailscale:getDevice
      Arguments:
        name: user1-device.example.com
        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(name: Optional[str] = None,
               wait_for: Optional[str] = None,
               opts: Optional[InvokeOptions] = None) -> GetDeviceResult
def get_device_output(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 dictionary

The following arguments are supported:

Name string

The name of the device

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

Name string

The name of the device

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

name String

The name of the device

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

name string

The name of the device

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

name str

The name of the device

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

name String

The name of the device

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

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the device

Tags List<string>

The tags applied to the device

User string

The user associated with the device

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

Id string

The provider-assigned unique ID for this managed resource.

Name string

The name of the device

Tags []string

The tags applied to the device

User string

The user associated with the device

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

id String

The provider-assigned unique ID for this managed resource.

name String

The name of the device

tags List<String>

The tags applied to the device

user String

The user associated with the device

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

id string

The provider-assigned unique ID for this managed resource.

name string

The name of the device

tags string[]

The tags applied to the device

user string

The user associated with the device

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

id str

The provider-assigned unique ID for this managed resource.

name str

The name of the device

tags Sequence[str]

The tags applied to the device

user str

The user associated with the device

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.

name String

The name of the device

tags List<String>

The tags applied to the device

user String

The user associated with the device

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.