Data Source: oci_core_public_ips

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

Lists the PublicIp objects in the specified compartment. You can filter the list by using query parameters.

To list your reserved public IPs: * Set scope = REGION (required) * Leave the availabilityDomain parameter empty * Set lifetime = RESERVED

To list the ephemeral public IPs assigned to a regional entity such as a NAT gateway: * Set scope = REGION (required) * Leave the availabilityDomain parameter empty * Set lifetime = EPHEMERAL

To list the ephemeral public IPs assigned to private IPs: * Set scope = AVAILABILITY_DOMAIN (required) * Set the availabilityDomain parameter to the desired availability domain (required) * Set lifetime = EPHEMERAL

Note: An ephemeral public IP assigned to a private IP is always in the same availability domain and compartment as the private IP.

Example Usage

data "oci_core_public_ips" "test_public_ips" {
	#Required
	compartment_id = var.compartment_id
	scope = var.public_ip_scope

	#Optional
	availability_domain = var.public_ip_availability_domain
	lifetime = var.public_ip_lifetime
	public_ip_pool_id = oci_core_public_ip_pool.test_public_ip_pool.id
}

Argument Reference

The following arguments are supported:

Attributes Reference

The following attributes are exported:

PublicIp Reference

The following attributes are exported: