Data Source: oci_core_instances

This data source provides the list of Instances in Oracle Cloud Infrastructure Core service.

Lists the instances in the specified compartment and the specified availability domain. You can filter the results by specifying an instance name (the list will include all the identically-named instances in the compartment).

Note: To retrieve public and private IP addresses for an instance, use the ListVnicAttachments operation to get the VNIC ID for the instance, and then call GetVnic with the VNIC ID.

Example Usage

data "oci_core_instances" "test_instances" {
	#Required
	compartment_id = var.compartment_id

	#Optional
	availability_domain = var.instance_availability_domain
	capacity_reservation_id = oci_core_capacity_reservation.test_capacity_reservation.id
	compute_cluster_id = oci_core_compute_cluster.test_compute_cluster.id
	display_name = var.instance_display_name
	state = var.instance_state
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

Instance Reference

The following attributes are exported: