Ready to level-up your engineering skills? Join a Pulumi Workshop. Register Now

getDevice

Provides an Equinix Metal device datasource.

Note: All arguments including the root_password and user_data will be stored in the raw state as plain-text. Read more about sensitive data in state.

Example Usage

using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;

class MyStack : Stack
{
    public MyStack()
    {
        var test = Output.Create(EquinixMetal.GetDevice.InvokeAsync(new EquinixMetal.GetDeviceArgs
        {
            ProjectId = local.Project_id,
            Hostname = "mydevice",
        }));
        this.Id = test.Apply(test => test.Id);
    }

    [Output("id")]
    public Output<string> Id { get; set; }
}
package main

import (
    "github.com/pulumi/pulumi-equinix-metal/sdk/go/equinix-metal"
    "github.com/pulumi/pulumi/sdk/v2/go/pulumi"
)

func main() {
    pulumi.Run(func(ctx *pulumi.Context) error {
        opt0 := local.Project_id
        opt1 := "mydevice"
        test, err := equinix - metal.LookupDevice(ctx, &equinix-metal.LookupDeviceArgs{
            ProjectId: &opt0,
            Hostname:  &opt1,
        }, nil)
        if err != nil {
            return err
        }
        ctx.Export("id", test.Id)
        return nil
    })
}
import pulumi
import pulumi_equinix_metal as equinix_metal

test = equinix_metal.get_device(project_id=local["project_id"],
    hostname="mydevice")
pulumi.export("id", test.id)
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";

const test = equinix_metal.getDevice({
    projectId: local.project_id,
    hostname: "mydevice",
});
export const id = test.then(test => test.id);

Using getDevice

function getDevice(args: GetDeviceArgs, opts?: InvokeOptions): Promise<GetDeviceResult>
def get_device(device_id: Optional[str] = None, hostname: Optional[str] = None, project_id: Optional[str] = None, opts: Optional[InvokeOptions] = None) -> GetDeviceResult
func LookupDevice(ctx *Context, args *LookupDeviceArgs, opts ...InvokeOption) (*LookupDeviceResult, error)

Note: This function is named LookupDevice in the Go SDK.

public static class GetDevice {
    public static Task<GetDeviceResult> InvokeAsync(GetDeviceArgs args, InvokeOptions? opts = null)
}

The following arguments are supported:

DeviceId string

Device ID

Hostname string

The device name

ProjectId string

The id of the project in which the devices exists

DeviceId string

Device ID

Hostname string

The device name

ProjectId string

The id of the project in which the devices exists

deviceId string

Device ID

hostname string

The device name

projectId string

The id of the project in which the devices exists

device_id str

Device ID

hostname str

The device name

project_id str

The id of the project in which the devices exists

getDevice Result

The following output properties are available:

AccessPrivateIpv4 string

The ipv4 private IP assigned to the device

AccessPublicIpv4 string

The ipv4 management IP assigned to the device

AccessPublicIpv6 string

The ipv6 management IP assigned to the device

AlwaysPxe bool
BillingCycle string

The billing cycle of the device (monthly or hourly)

Description string

Description string for the device

DeviceId string
Facility string

The facility where the device is deployed.

HardwareReservationId string

The id of hardware reservation which this device occupies

Hostname string
Id string

The provider-assigned unique ID for this managed resource.

IpxeScriptUrl string
NetworkType string

L2 network type of the device, one of “layer3”, “layer2-bonded”, “layer2-individual”, “hybrid”

Networks List<Pulumi.EquinixMetal.Outputs.GetDeviceNetwork>

The device’s private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks: * Public IPv4 at metal_device.name.network.0 * IPv6 at metal_device.name.network.1 * Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:

OperatingSystem string

The operating system running on the device

Plan string

The hardware config of the device

Ports List<Pulumi.EquinixMetal.Outputs.GetDevicePort>

Ports assigned to the device

ProjectId string
RootPassword string

Root password to the server (if still available)

SshKeyIds List<string>

List of IDs of SSH keys deployed in the device, can be both user or project SSH keys

State string

The state of the device

Storage string
Tags List<string>

Tags attached to the device

AccessPrivateIpv4 string

The ipv4 private IP assigned to the device

AccessPublicIpv4 string

The ipv4 management IP assigned to the device

AccessPublicIpv6 string

The ipv6 management IP assigned to the device

AlwaysPxe bool
BillingCycle string

The billing cycle of the device (monthly or hourly)

Description string

Description string for the device

DeviceId string
Facility string

The facility where the device is deployed.

HardwareReservationId string

The id of hardware reservation which this device occupies

Hostname string
Id string

The provider-assigned unique ID for this managed resource.

IpxeScriptUrl string
NetworkType string

L2 network type of the device, one of “layer3”, “layer2-bonded”, “layer2-individual”, “hybrid”

Networks []GetDeviceNetwork

The device’s private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks: * Public IPv4 at metal_device.name.network.0 * IPv6 at metal_device.name.network.1 * Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:

OperatingSystem string

The operating system running on the device

Plan string

The hardware config of the device

Ports []GetDevicePort

Ports assigned to the device

ProjectId string
RootPassword string

Root password to the server (if still available)

SshKeyIds []string

List of IDs of SSH keys deployed in the device, can be both user or project SSH keys

State string

The state of the device

Storage string
Tags []string

Tags attached to the device

accessPrivateIpv4 string

The ipv4 private IP assigned to the device

accessPublicIpv4 string

The ipv4 management IP assigned to the device

accessPublicIpv6 string

The ipv6 management IP assigned to the device

alwaysPxe boolean
billingCycle string

The billing cycle of the device (monthly or hourly)

description string

Description string for the device

deviceId string
facility string

The facility where the device is deployed.

hardwareReservationId string

The id of hardware reservation which this device occupies

hostname string
id string

The provider-assigned unique ID for this managed resource.

ipxeScriptUrl string
networkType string

L2 network type of the device, one of “layer3”, “layer2-bonded”, “layer2-individual”, “hybrid”

networks GetDeviceNetwork[]

The device’s private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks: * Public IPv4 at metal_device.name.network.0 * IPv6 at metal_device.name.network.1 * Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:

operatingSystem string

The operating system running on the device

plan string

The hardware config of the device

ports GetDevicePort[]

Ports assigned to the device

projectId string
rootPassword string

Root password to the server (if still available)

sshKeyIds string[]

List of IDs of SSH keys deployed in the device, can be both user or project SSH keys

state string

The state of the device

storage string
tags string[]

Tags attached to the device

access_private_ipv4 str

The ipv4 private IP assigned to the device

access_public_ipv4 str

The ipv4 management IP assigned to the device

access_public_ipv6 str

The ipv6 management IP assigned to the device

always_pxe bool
billing_cycle str

The billing cycle of the device (monthly or hourly)

description str

Description string for the device

device_id str
facility str

The facility where the device is deployed.

hardware_reservation_id str

The id of hardware reservation which this device occupies

hostname str
id str

The provider-assigned unique ID for this managed resource.

ipxe_script_url str
network_type str

L2 network type of the device, one of “layer3”, “layer2-bonded”, “layer2-individual”, “hybrid”

networks Sequence[GetDeviceNetwork]

The device’s private and public IP (v4 and v6) network details. When a device is run without any special network configuration, it will have 3 networks: * Public IPv4 at metal_device.name.network.0 * IPv6 at metal_device.name.network.1 * Private IPv4 at metal_device.name.network.2 Elastic addresses then stack by type - an assigned public IPv4 will go after the management public IPv4 (to index 1), and will then shift the indices of the IPv6 and private IPv4. Assigned private IPv4 will go after the management private IPv4 (to the end of the network list). The fields of the network attributes are:

operating_system str

The operating system running on the device

plan str

The hardware config of the device

ports Sequence[GetDevicePort]

Ports assigned to the device

project_id str
root_password str

Root password to the server (if still available)

ssh_key_ids Sequence[str]

List of IDs of SSH keys deployed in the device, can be both user or project SSH keys

state str

The state of the device

storage str
tags Sequence[str]

Tags attached to the device

Supporting Types

GetDeviceNetwork

Address string

IPv4 or IPv6 address string

Cidr int

Bit length of the network mask of the address

Family int

IP version - “4” or “6”

Gateway string

Address of router

Public bool

Whether the address is routable from the Internet

Address string

IPv4 or IPv6 address string

Cidr int

Bit length of the network mask of the address

Family int

IP version - “4” or “6”

Gateway string

Address of router

Public bool

Whether the address is routable from the Internet

address string

IPv4 or IPv6 address string

cidr number

Bit length of the network mask of the address

family number

IP version - “4” or “6”

gateway string

Address of router

public boolean

Whether the address is routable from the Internet

address str

IPv4 or IPv6 address string

cidr int

Bit length of the network mask of the address

family int

IP version - “4” or “6”

gateway str

Address of router

public bool

Whether the address is routable from the Internet

GetDevicePort

Bonded bool

Whether this port is part of a bond in bonded network setup

Id string

ID of the port

Mac string

MAC address assigned to the port

Name string

Name of the port (e.g. eth0, or bond0)

Type string

Type of the port (e.g. NetworkPort or NetworkBondPort)

Bonded bool

Whether this port is part of a bond in bonded network setup

Id string

ID of the port

Mac string

MAC address assigned to the port

Name string

Name of the port (e.g. eth0, or bond0)

Type string

Type of the port (e.g. NetworkPort or NetworkBondPort)

bonded boolean

Whether this port is part of a bond in bonded network setup

id string

ID of the port

mac string

MAC address assigned to the port

name string

Name of the port (e.g. eth0, or bond0)

type string

Type of the port (e.g. NetworkPort or NetworkBondPort)

bonded bool

Whether this port is part of a bond in bonded network setup

id str

ID of the port

mac str

MAC address assigned to the port

name str

Name of the port (e.g. eth0, or bond0)

type str

Type of the port (e.g. NetworkPort or NetworkBondPort)

Package Details

Repository
https://github.com/pulumi/pulumi-equinix-metal
License
Apache-2.0
Notes
This Pulumi package is based on the metal Terraform Provider.