1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getPrivateIp
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

oci.Core.getPrivateIp

Explore with Pulumi AI

Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi

This data source provides details about a specific Private Ip resource in Oracle Cloud Infrastructure Core service.

Gets the specified private IP. You must specify the object’s OCID. Alternatively, you can get the object by using ListPrivateIps with the private IP address (for example, 10.0.3.3) and subnet OCID.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testPrivateIp = oci.Core.getPrivateIp({
    privateIpId: testPrivateIpOciCorePrivateIp.id,
});
Copy
import pulumi
import pulumi_oci as oci

test_private_ip = oci.Core.get_private_ip(private_ip_id=test_private_ip_oci_core_private_ip["id"])
Copy
package main

import (
	"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/core"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := core.GetPrivateIp(ctx, &core.GetPrivateIpArgs{
			PrivateIpId: testPrivateIpOciCorePrivateIp.Id,
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testPrivateIp = Oci.Core.GetPrivateIp.Invoke(new()
    {
        PrivateIpId = testPrivateIpOciCorePrivateIp.Id,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetPrivateIpArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        final var testPrivateIp = CoreFunctions.getPrivateIp(GetPrivateIpArgs.builder()
            .privateIpId(testPrivateIpOciCorePrivateIp.id())
            .build());

    }
}
Copy
variables:
  testPrivateIp:
    fn::invoke:
      function: oci:Core:getPrivateIp
      arguments:
        privateIpId: ${testPrivateIpOciCorePrivateIp.id}
Copy

Using getPrivateIp

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 getPrivateIp(args: GetPrivateIpArgs, opts?: InvokeOptions): Promise<GetPrivateIpResult>
function getPrivateIpOutput(args: GetPrivateIpOutputArgs, opts?: InvokeOptions): Output<GetPrivateIpResult>
Copy
def get_private_ip(private_ip_id: Optional[str] = None,
                   opts: Optional[InvokeOptions] = None) -> GetPrivateIpResult
def get_private_ip_output(private_ip_id: Optional[pulumi.Input[str]] = None,
                   opts: Optional[InvokeOptions] = None) -> Output[GetPrivateIpResult]
Copy
func GetPrivateIp(ctx *Context, args *GetPrivateIpArgs, opts ...InvokeOption) (*GetPrivateIpResult, error)
func GetPrivateIpOutput(ctx *Context, args *GetPrivateIpOutputArgs, opts ...InvokeOption) GetPrivateIpResultOutput
Copy

> Note: This function is named GetPrivateIp in the Go SDK.

public static class GetPrivateIp 
{
    public static Task<GetPrivateIpResult> InvokeAsync(GetPrivateIpArgs args, InvokeOptions? opts = null)
    public static Output<GetPrivateIpResult> Invoke(GetPrivateIpInvokeArgs args, InvokeOptions? opts = null)
}
Copy
public static CompletableFuture<GetPrivateIpResult> getPrivateIp(GetPrivateIpArgs args, InvokeOptions options)
public static Output<GetPrivateIpResult> getPrivateIp(GetPrivateIpArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: oci:Core/getPrivateIp:getPrivateIp
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

PrivateIpId This property is required. string
The OCID of the private IP or IPv6.
PrivateIpId This property is required. string
The OCID of the private IP or IPv6.
privateIpId This property is required. String
The OCID of the private IP or IPv6.
privateIpId This property is required. string
The OCID of the private IP or IPv6.
private_ip_id This property is required. str
The OCID of the private IP or IPv6.
privateIpId This property is required. String
The OCID of the private IP or IPv6.

getPrivateIp Result

The following output properties are available:

AvailabilityDomain string
The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example: Uocm:PHX-AD-1
CompartmentId string
The OCID of the compartment containing the private IP.
DefinedTags Dictionary<string, string>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
HostnameLabel string
The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance1 in FQDN bminstance1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
Id string
The private IP's Oracle ID (OCID).
IpAddress string
The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.
IpState string
State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
IsPrimary bool
Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example: true
IsReserved bool
Lifetime string
Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
PrivateIpId string
RouteTableId string
The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
SubnetId string
The OCID of the subnet the VNIC is in.
TimeCreated string
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VlanId string
Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See Vlan.
VnicId string
The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.
AvailabilityDomain string
The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example: Uocm:PHX-AD-1
CompartmentId string
The OCID of the compartment containing the private IP.
DefinedTags map[string]string
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
DisplayName string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags map[string]string
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
HostnameLabel string
The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance1 in FQDN bminstance1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
Id string
The private IP's Oracle ID (OCID).
IpAddress string
The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.
IpState string
State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
IsPrimary bool
Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example: true
IsReserved bool
Lifetime string
Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
PrivateIpId string
RouteTableId string
The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
SubnetId string
The OCID of the subnet the VNIC is in.
TimeCreated string
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VlanId string
Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See Vlan.
VnicId string
The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.
availabilityDomain String
The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example: Uocm:PHX-AD-1
compartmentId String
The OCID of the compartment containing the private IP.
definedTags Map<String,String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String,String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
hostnameLabel String
The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance1 in FQDN bminstance1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
id String
The private IP's Oracle ID (OCID).
ipAddress String
The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.
ipState String
State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
isPrimary Boolean
Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example: true
isReserved Boolean
lifetime String
Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
privateIpId String
routeTableId String
The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId String
The OCID of the subnet the VNIC is in.
timeCreated String
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vlanId String
Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See Vlan.
vnicId String
The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.
availabilityDomain string
The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example: Uocm:PHX-AD-1
compartmentId string
The OCID of the compartment containing the private IP.
definedTags {[key: string]: string}
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName string
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags {[key: string]: string}
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
hostnameLabel string
The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance1 in FQDN bminstance1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
id string
The private IP's Oracle ID (OCID).
ipAddress string
The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.
ipState string
State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
isPrimary boolean
Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example: true
isReserved boolean
lifetime string
Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
privateIpId string
routeTableId string
The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId string
The OCID of the subnet the VNIC is in.
timeCreated string
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vlanId string
Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See Vlan.
vnicId string
The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.
availability_domain str
The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example: Uocm:PHX-AD-1
compartment_id str
The OCID of the compartment containing the private IP.
defined_tags Mapping[str, str]
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
display_name str
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeform_tags Mapping[str, str]
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
hostname_label str
The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance1 in FQDN bminstance1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
id str
The private IP's Oracle ID (OCID).
ip_address str
The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.
ip_state str
State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
is_primary bool
Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example: true
is_reserved bool
lifetime str
Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
private_ip_id str
route_table_id str
The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnet_id str
The OCID of the subnet the VNIC is in.
time_created str
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vlan_id str
Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See Vlan.
vnic_id str
The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.
availabilityDomain String
The private IP's availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example: Uocm:PHX-AD-1
compartmentId String
The OCID of the compartment containing the private IP.
definedTags Map<String>
Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
displayName String
A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String>
Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example: {"Department": "Finance"}
hostnameLabel String
The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP's fully qualified domain name (FQDN) (for example, bminstance1 in FQDN bminstance1.subnet123.vcn1.oraclevcn.com). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.
id String
The private IP's Oracle ID (OCID).
ipAddress String
The private IP address of the privateIp object. The address is within the CIDR of the VNIC's subnet.
ipState String
State of the IP address. If an IP address is assigned to a VNIC it is ASSIGNED, otherwise it is AVAILABLE.
isPrimary Boolean
Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example: true
isReserved Boolean
lifetime String
Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
privateIpId String
routeTableId String
The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId String
The OCID of the subnet the VNIC is in.
timeCreated String
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vlanId String
Applicable only if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution. The vlanId is the OCID of the VLAN. See Vlan.
vnicId String
The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if the PrivateIp object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the vnicId is null.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.
Oracle Cloud Infrastructure v2.30.0 published on Monday, Apr 14, 2025 by Pulumi