okustera_port (Data Source)
Discovers details of an existing virtual network interface port in Okustera, including its MAC address, IP allocations, and attachment state.
Example Usage
Discover Port by Compute Instance Device ID
resource "okustera_compute_instance" "vm" {
name = "demo-instance"
flavor_id = data.okustera_compute_flavor.m1_small.id
image_id = data.okustera_image.ubuntu.id
}
# Discover the auto-created primary network port for the VM
data "okustera_port" "vm_port" {
device_id = okustera_compute_instance.vm.id
}
output "mac_address" {
value = data.okustera_port.vm_port.mac_address
}
output "port_id" {
value = data.okustera_port.vm_port.id
}
Schema
Optional
device_id(String) UUID of the attached compute instance or device.id(String) Port UUID identifier.
Read-Only
device_owner(String) Entity that owns the port (e.g., compute instance or router interface).fixed_ip_address(String) Primary allocated private IPv4 address on this port.mac_address(String) Hardware MAC address allocated to the network interface.name(String) Human-readable port name.status(String) Port operational status (e.g.ACTIVE,DOWN).