~> Deprecation Notice Equinix Metal will reach end of life on June 30, 2026. All Metal data sources will be removed in version 5.0.0 of this provider. Use version 4.x of this provider for continued use through sunset. See https://docs.equinix.com/metal/ for more information.
equinix_metal_device (Data Source)
The datasource can be used to fetch a single device.
If you need to fetch a list of devices which meet filter criteria, you can use the equinix_metal_devices 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
# Fetch a device data by hostname and show it's ID
data "equinix_metal_device" "test" {
project_id = local.project_id
hostname = "mydevice"
}
output "id" {
value = data.equinix_metal_device.test.id
}
# Fetch a device data by ID and show its public IPv4
data "equinix_metal_device" "test" {
device_id = "4c641195-25e5-4c3c-b2b7-4cd7a42c7b40"
}
output "ipv4" {
value = data.equinix_metal_device.test.access_public_ipv4
}
Schema
Optional
device_id(String) Device IDhostname(String) The device nameproject_id(String) The id of the project in which the devices exists
Read-Only
access_private_ipv4(String) The ipv4 private IP assigned to the deviceaccess_public_ipv4(String) The ipv4 management IP assigned to the deviceaccess_public_ipv6(String) The ipv6 management IP assigned to the devicealways_pxe(Boolean)billing_cycle(String) The billing cycle of the device (monthly or hourly)description(String) Description string for the devicefacility(String, Deprecated) The facility where the device is deployedhardware_reservation_id(String) The id of hardware reservation which this device occupiesid(String) The ID of this resource.ipxe_script_url(String)metro(String) The metro where the device is deployednetwork(List of Object) 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: ublic IPv4 at equinix_metal_device.name.network.0, IPv6 at equinix_metal_device.name.network.1 and private IPv4 at equinix_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). (see below for nested schema)network_type(String) L2 network type of the device, one oflayer3, hybrid, layer2-individual, layer2-bondedoperating_system(String) The operating system running on the deviceplan(String) The hardware config of the deviceports(List of Object) Ports assigned to the device (see below for nested schema)root_password(String, Sensitive) Root password to the server (if still available)sos_hostname(String) The hostname to use for Serial over SSH access to the devicessh_key_ids(List of String) List of IDs of SSH keys deployed in the device, can be both user or project SSH keysstate(String) The state of the devicestorage(String)tags(List of String) Tags attached to the device
Nested Schema for network
Read-Only:
address(String)cidr(Number)family(Number)gateway(String)public(Boolean)
Nested Schema for ports
Read-Only:
bonded(Boolean)id(String)mac(String)name(String)type(String)