This package is deprecated. We recommend using the new Equinix package.
equinix-metal.getDevice
Explore with Pulumi AI
This package is deprecated. We recommend using the new Equinix package.
Provides an Equinix Metal device datasource.
Note: All arguments including the
root_password
anduser_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/v3/go/equinix-metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
opt0 := local.Project_id
opt1 := "mydevice"
test, err := equinix - metal.LookupDevice(ctx, &GetDeviceArgs{
ProjectId: &opt0,
Hostname: &opt1,
}, nil)
if err != nil {
return err
}
ctx.Export("id", test.Id)
return nil
})
}
Coming soon!
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);
Coming soon!
using Pulumi;
using EquinixMetal = Pulumi.EquinixMetal;
class MyStack : Stack
{
public MyStack()
{
var test = Output.Create(EquinixMetal.GetDevice.InvokeAsync());
this.Ipv4 = test.Apply(test => test.AccessPublicIpv4);
}
[Output("ipv4")]
public Output<string> Ipv4 { get; set; }
}
package main
import (
"github.com/pulumi/pulumi-equinix-metal/sdk/v3/go/equinix-metal"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
test, err := equinix - metal.LookupDevice(ctx, nil, nil)
if err != nil {
return err
}
ctx.Export("ipv4", test.AccessPublicIpv4)
return nil
})
}
Coming soon!
import pulumi
import pulumi_equinix_metal as equinix_metal
test = equinix_metal.get_device()
pulumi.export("ipv4", test.access_public_ipv4)
import * as pulumi from "@pulumi/pulumi";
import * as equinix_metal from "@pulumi/equinix-metal";
const test = equinix_metal.getDevice({});
export const ipv4 = test.then(test => test.accessPublicIpv4);
Coming soon!
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(device_id: Optional[str] = None,
hostname: Optional[str] = None,
project_id: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetDeviceResult
def get_device_output(device_id: Optional[pulumi.Input[str]] = None,
hostname: Optional[pulumi.Input[str]] = None,
project_id: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetDeviceResult]
func LookupDevice(ctx *Context, args *LookupDeviceArgs, opts ...InvokeOption) (*LookupDeviceResult, error)
func LookupDeviceOutput(ctx *Context, args *LookupDeviceOutputArgs, opts ...InvokeOption) LookupDeviceResultOutput
> Note: This function is named LookupDevice
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: equinix-metal:index/getDevice:getDevice
arguments:
# arguments dictionary
The following arguments are supported:
- 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:
- Access
Private stringIpv4 - The ipv4 private IP assigned to the device
- Access
Public stringIpv4 - The ipv4 management IP assigned to the device
- Access
Public stringIpv6 - The ipv6 management IP assigned to the device
- Always
Pxe bool - Billing
Cycle string - The billing cycle of the device (monthly or hourly)
- Description string
- Description string for the device
- Device
Id string - Facility string
- The facility where the device is deployed.
- Hardware
Reservation stringId - The id of hardware reservation which this device occupies
- Hostname string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipxe
Script stringUrl - Metro string
- The metro where the device is deployed
- Network
Type string - L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
- Networks
List<Pulumi.
Equinix Metal. Outputs. Get Device Network> - 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:
- Public IPv4 at
- Operating
System string - The operating system running on the device
- Plan string
- The hardware config of the device
- Ports
List<Pulumi.
Equinix Metal. Outputs. Get Device Port> - Ports assigned to the device
- Project
Id string - Root
Password string - Root password to the server (if still available)
- Ssh
Key List<string>Ids - 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
- List<string>
- Tags attached to the device
- Access
Private stringIpv4 - The ipv4 private IP assigned to the device
- Access
Public stringIpv4 - The ipv4 management IP assigned to the device
- Access
Public stringIpv6 - The ipv6 management IP assigned to the device
- Always
Pxe bool - Billing
Cycle string - The billing cycle of the device (monthly or hourly)
- Description string
- Description string for the device
- Device
Id string - Facility string
- The facility where the device is deployed.
- Hardware
Reservation stringId - The id of hardware reservation which this device occupies
- Hostname string
- Id string
- The provider-assigned unique ID for this managed resource.
- Ipxe
Script stringUrl - Metro string
- The metro where the device is deployed
- Network
Type string - L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
- Networks
[]Get
Device Network - 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:
- Public IPv4 at
- Operating
System string - The operating system running on the device
- Plan string
- The hardware config of the device
- Ports
[]Get
Device Port - Ports assigned to the device
- Project
Id string - Root
Password string - Root password to the server (if still available)
- Ssh
Key []stringIds - 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
- []string
- Tags attached to the device
- access
Private StringIpv4 - The ipv4 private IP assigned to the device
- access
Public StringIpv4 - The ipv4 management IP assigned to the device
- access
Public StringIpv6 - The ipv6 management IP assigned to the device
- always
Pxe Boolean - billing
Cycle String - The billing cycle of the device (monthly or hourly)
- description String
- Description string for the device
- device
Id String - facility String
- The facility where the device is deployed.
- hardware
Reservation StringId - The id of hardware reservation which this device occupies
- hostname String
- id String
- The provider-assigned unique ID for this managed resource.
- ipxe
Script StringUrl - metro String
- The metro where the device is deployed
- network
Type String - L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
- networks
List<Get
Device Network> - 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:
- Public IPv4 at
- operating
System String - The operating system running on the device
- plan String
- The hardware config of the device
- ports
List<Get
Device Port> - Ports assigned to the device
- project
Id String - root
Password String - Root password to the server (if still available)
- ssh
Key List<String>Ids - 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
- List<String>
- Tags attached to the device
- access
Private stringIpv4 - The ipv4 private IP assigned to the device
- access
Public stringIpv4 - The ipv4 management IP assigned to the device
- access
Public stringIpv6 - The ipv6 management IP assigned to the device
- always
Pxe boolean - billing
Cycle string - The billing cycle of the device (monthly or hourly)
- description string
- Description string for the device
- device
Id string - facility string
- The facility where the device is deployed.
- hardware
Reservation stringId - The id of hardware reservation which this device occupies
- hostname string
- id string
- The provider-assigned unique ID for this managed resource.
- ipxe
Script stringUrl - metro string
- The metro where the device is deployed
- network
Type string - L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
- networks
Get
Device Network[] - 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:
- Public IPv4 at
- operating
System string - The operating system running on the device
- plan string
- The hardware config of the device
- ports
Get
Device Port[] - Ports assigned to the device
- project
Id string - root
Password string - Root password to the server (if still available)
- ssh
Key string[]Ids - 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
- string[]
- Tags attached to the device
- access_
private_ stripv4 - The ipv4 private IP assigned to the device
- access_
public_ stripv4 - The ipv4 management IP assigned to the device
- access_
public_ stripv6 - 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_ strid - The id of hardware reservation which this device occupies
- hostname str
- id str
- The provider-assigned unique ID for this managed resource.
- ipxe_
script_ strurl - metro str
- The metro where the device is deployed
- network_
type str - L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
- networks
Sequence[Get
Device Network] - 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:
- Public IPv4 at
- operating_
system str - The operating system running on the device
- plan str
- The hardware config of the device
- ports
Sequence[Get
Device Port] - Ports assigned to the device
- project_
id str - root_
password str - Root password to the server (if still available)
- ssh_
key_ Sequence[str]ids - 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
- Sequence[str]
- Tags attached to the device
- access
Private StringIpv4 - The ipv4 private IP assigned to the device
- access
Public StringIpv4 - The ipv4 management IP assigned to the device
- access
Public StringIpv6 - The ipv6 management IP assigned to the device
- always
Pxe Boolean - billing
Cycle String - The billing cycle of the device (monthly or hourly)
- description String
- Description string for the device
- device
Id String - facility String
- The facility where the device is deployed.
- hardware
Reservation StringId - The id of hardware reservation which this device occupies
- hostname String
- id String
- The provider-assigned unique ID for this managed resource.
- ipxe
Script StringUrl - metro String
- The metro where the device is deployed
- network
Type String - L2 network type of the device, one of "layer3", "layer2-bonded", "layer2-individual", "hybrid"
- networks List<Property Map>
- 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:
- Public IPv4 at
- operating
System String - The operating system running on the device
- plan String
- The hardware config of the device
- ports List<Property Map>
- Ports assigned to the device
- project
Id String - root
Password String - Root password to the server (if still available)
- ssh
Key List<String>Ids - 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
- List<String>
- Tags attached to the device
Supporting Types
GetDeviceNetwork
GetDevicePort
Package Details
- Repository
- Equinix Metal pulumi/pulumi-equinix-metal
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
metal
Terraform Provider.
This package is deprecated. We recommend using the new Equinix package.