1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. PrivateIp
Oracle Cloud Infrastructure v2.32.0 published on Thursday, Apr 24, 2025 by Pulumi

oci.Core.PrivateIp

Explore with Pulumi AI

This resource provides the Private Ip resource in Oracle Cloud Infrastructure Core service.

Creates a secondary private IP for the specified VNIC. For more information about secondary private IPs, see IP Addresses.

Example Usage

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

const testPrivateIp = new oci.core.PrivateIp("test_private_ip", {
    definedTags: {
        "Operations.CostCenter": "42",
    },
    displayName: privateIpDisplayName,
    freeformTags: {
        Department: "Finance",
    },
    hostnameLabel: privateIpHostnameLabel,
    ipAddress: privateIpIpAddress,
    lifetime: privateIpLifetime,
    routeTableId: testRouteTable.id,
    subnetId: testSubnet.id,
    vlanId: testVlan.id,
    vnicId: testVnicAttachment.vnicId,
});
Copy
import pulumi
import pulumi_oci as oci

test_private_ip = oci.core.PrivateIp("test_private_ip",
    defined_tags={
        "Operations.CostCenter": "42",
    },
    display_name=private_ip_display_name,
    freeform_tags={
        "Department": "Finance",
    },
    hostname_label=private_ip_hostname_label,
    ip_address=private_ip_ip_address,
    lifetime=private_ip_lifetime,
    route_table_id=test_route_table["id"],
    subnet_id=test_subnet["id"],
    vlan_id=test_vlan["id"],
    vnic_id=test_vnic_attachment["vnicId"])
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.NewPrivateIp(ctx, "test_private_ip", &core.PrivateIpArgs{
			DefinedTags: pulumi.StringMap{
				"Operations.CostCenter": pulumi.String("42"),
			},
			DisplayName: pulumi.Any(privateIpDisplayName),
			FreeformTags: pulumi.StringMap{
				"Department": pulumi.String("Finance"),
			},
			HostnameLabel: pulumi.Any(privateIpHostnameLabel),
			IpAddress:     pulumi.Any(privateIpIpAddress),
			Lifetime:      pulumi.Any(privateIpLifetime),
			RouteTableId:  pulumi.Any(testRouteTable.Id),
			SubnetId:      pulumi.Any(testSubnet.Id),
			VlanId:        pulumi.Any(testVlan.Id),
			VnicId:        pulumi.Any(testVnicAttachment.VnicId),
		})
		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 = new Oci.Core.PrivateIp("test_private_ip", new()
    {
        DefinedTags = 
        {
            { "Operations.CostCenter", "42" },
        },
        DisplayName = privateIpDisplayName,
        FreeformTags = 
        {
            { "Department", "Finance" },
        },
        HostnameLabel = privateIpHostnameLabel,
        IpAddress = privateIpIpAddress,
        Lifetime = privateIpLifetime,
        RouteTableId = testRouteTable.Id,
        SubnetId = testSubnet.Id,
        VlanId = testVlan.Id,
        VnicId = testVnicAttachment.VnicId,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.PrivateIp;
import com.pulumi.oci.Core.PrivateIpArgs;
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) {
        var testPrivateIp = new PrivateIp("testPrivateIp", PrivateIpArgs.builder()
            .definedTags(Map.of("Operations.CostCenter", "42"))
            .displayName(privateIpDisplayName)
            .freeformTags(Map.of("Department", "Finance"))
            .hostnameLabel(privateIpHostnameLabel)
            .ipAddress(privateIpIpAddress)
            .lifetime(privateIpLifetime)
            .routeTableId(testRouteTable.id())
            .subnetId(testSubnet.id())
            .vlanId(testVlan.id())
            .vnicId(testVnicAttachment.vnicId())
            .build());

    }
}
Copy
resources:
  testPrivateIp:
    type: oci:Core:PrivateIp
    name: test_private_ip
    properties:
      definedTags:
        Operations.CostCenter: '42'
      displayName: ${privateIpDisplayName}
      freeformTags:
        Department: Finance
      hostnameLabel: ${privateIpHostnameLabel}
      ipAddress: ${privateIpIpAddress}
      lifetime: ${privateIpLifetime}
      routeTableId: ${testRouteTable.id}
      subnetId: ${testSubnet.id}
      vlanId: ${testVlan.id}
      vnicId: ${testVnicAttachment.vnicId}
Copy

Create PrivateIp Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new PrivateIp(name: string, args?: PrivateIpArgs, opts?: CustomResourceOptions);
@overload
def PrivateIp(resource_name: str,
              args: Optional[PrivateIpArgs] = None,
              opts: Optional[ResourceOptions] = None)

@overload
def PrivateIp(resource_name: str,
              opts: Optional[ResourceOptions] = None,
              defined_tags: Optional[Mapping[str, str]] = None,
              display_name: Optional[str] = None,
              freeform_tags: Optional[Mapping[str, str]] = None,
              hostname_label: Optional[str] = None,
              ip_address: Optional[str] = None,
              lifetime: Optional[str] = None,
              route_table_id: Optional[str] = None,
              subnet_id: Optional[str] = None,
              vlan_id: Optional[str] = None,
              vnic_id: Optional[str] = None)
func NewPrivateIp(ctx *Context, name string, args *PrivateIpArgs, opts ...ResourceOption) (*PrivateIp, error)
public PrivateIp(string name, PrivateIpArgs? args = null, CustomResourceOptions? opts = null)
public PrivateIp(String name, PrivateIpArgs args)
public PrivateIp(String name, PrivateIpArgs args, CustomResourceOptions options)
type: oci:Core:PrivateIp
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args PrivateIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args PrivateIpArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args PrivateIpArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args PrivateIpArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. PrivateIpArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var privateIpResource = new Oci.Core.PrivateIp("privateIpResource", new()
{
    DefinedTags = 
    {
        { "string", "string" },
    },
    DisplayName = "string",
    FreeformTags = 
    {
        { "string", "string" },
    },
    HostnameLabel = "string",
    IpAddress = "string",
    Lifetime = "string",
    RouteTableId = "string",
    SubnetId = "string",
    VlanId = "string",
    VnicId = "string",
});
Copy
example, err := core.NewPrivateIp(ctx, "privateIpResource", &core.PrivateIpArgs{
	DefinedTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	DisplayName: pulumi.String("string"),
	FreeformTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	HostnameLabel: pulumi.String("string"),
	IpAddress:     pulumi.String("string"),
	Lifetime:      pulumi.String("string"),
	RouteTableId:  pulumi.String("string"),
	SubnetId:      pulumi.String("string"),
	VlanId:        pulumi.String("string"),
	VnicId:        pulumi.String("string"),
})
Copy
var privateIpResource = new PrivateIp("privateIpResource", PrivateIpArgs.builder()
    .definedTags(Map.of("string", "string"))
    .displayName("string")
    .freeformTags(Map.of("string", "string"))
    .hostnameLabel("string")
    .ipAddress("string")
    .lifetime("string")
    .routeTableId("string")
    .subnetId("string")
    .vlanId("string")
    .vnicId("string")
    .build());
Copy
private_ip_resource = oci.core.PrivateIp("privateIpResource",
    defined_tags={
        "string": "string",
    },
    display_name="string",
    freeform_tags={
        "string": "string",
    },
    hostname_label="string",
    ip_address="string",
    lifetime="string",
    route_table_id="string",
    subnet_id="string",
    vlan_id="string",
    vnic_id="string")
Copy
const privateIpResource = new oci.core.PrivateIp("privateIpResource", {
    definedTags: {
        string: "string",
    },
    displayName: "string",
    freeformTags: {
        string: "string",
    },
    hostnameLabel: "string",
    ipAddress: "string",
    lifetime: "string",
    routeTableId: "string",
    subnetId: "string",
    vlanId: "string",
    vnicId: "string",
});
Copy
type: oci:Core:PrivateIp
properties:
    definedTags:
        string: string
    displayName: string
    freeformTags:
        string: string
    hostnameLabel: string
    ipAddress: string
    lifetime: string
    routeTableId: string
    subnetId: string
    vlanId: string
    vnicId: string
Copy

PrivateIp Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The PrivateIp resource accepts the following input properties:

DefinedTags Dictionary<string, string>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

IpAddress Changes to this property will trigger replacement. string
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
Lifetime string
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
RouteTableId string
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
SubnetId Changes to this property will trigger replacement. string
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
VlanId Changes to this property will trigger replacement. string

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

VnicId string

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

DefinedTags map[string]string
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags map[string]string
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

IpAddress Changes to this property will trigger replacement. string
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
Lifetime string
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
RouteTableId string
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
SubnetId Changes to this property will trigger replacement. string
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
VlanId Changes to this property will trigger replacement. string

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

VnicId string

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags Map<String,String>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String,String>
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ipAddress Changes to this property will trigger replacement. String
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
lifetime String
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
routeTableId String
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId Changes to this property will trigger replacement. String
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
vlanId Changes to this property will trigger replacement. String

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnicId String

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags {[key: string]: string}
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags {[key: string]: string}
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ipAddress Changes to this property will trigger replacement. string
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
lifetime string
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
routeTableId string
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId Changes to this property will trigger replacement. string
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
vlanId Changes to this property will trigger replacement. string

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnicId string

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

defined_tags Mapping[str, str]
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeform_tags Mapping[str, str]
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ip_address Changes to this property will trigger replacement. str
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
lifetime str
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
route_table_id str
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnet_id Changes to this property will trigger replacement. str
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
vlan_id Changes to this property will trigger replacement. str

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnic_id str

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

definedTags Map<String>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String>
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ipAddress Changes to this property will trigger replacement. String
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
lifetime String
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
routeTableId String
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId Changes to this property will trigger replacement. String
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
vlanId Changes to this property will trigger replacement. String

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnicId String

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Outputs

All input properties are implicitly available as output properties. Additionally, the PrivateIp resource produces the following output properties:

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.
Id string
The provider-assigned unique ID for this managed resource.
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
TimeCreated string
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
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.
Id string
The provider-assigned unique ID for this managed resource.
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
TimeCreated string
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
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.
id String
The provider-assigned unique ID for this managed resource.
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
timeCreated String
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
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.
id string
The provider-assigned unique ID for this managed resource.
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
timeCreated string
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
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.
id str
The provider-assigned unique ID for this managed resource.
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
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
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.
id String
The provider-assigned unique ID for this managed resource.
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
timeCreated String
The date and time the private IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Look up Existing PrivateIp Resource

Get an existing PrivateIp resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: PrivateIpState, opts?: CustomResourceOptions): PrivateIp
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        availability_domain: Optional[str] = None,
        compartment_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, str]] = None,
        display_name: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, str]] = None,
        hostname_label: Optional[str] = None,
        ip_address: Optional[str] = None,
        ip_state: Optional[str] = None,
        is_primary: Optional[bool] = None,
        is_reserved: Optional[bool] = None,
        lifetime: Optional[str] = None,
        route_table_id: Optional[str] = None,
        subnet_id: Optional[str] = None,
        time_created: Optional[str] = None,
        vlan_id: Optional[str] = None,
        vnic_id: Optional[str] = None) -> PrivateIp
func GetPrivateIp(ctx *Context, name string, id IDInput, state *PrivateIpState, opts ...ResourceOption) (*PrivateIp, error)
public static PrivateIp Get(string name, Input<string> id, PrivateIpState? state, CustomResourceOptions? opts = null)
public static PrivateIp get(String name, Output<String> id, PrivateIpState state, CustomResourceOptions options)
resources:  _:    type: oci:Core:PrivateIp    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
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>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

IpAddress Changes to this property will trigger replacement. string
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
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
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
RouteTableId string
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
SubnetId Changes to this property will trigger replacement. string
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
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 Changes to this property will trigger replacement. string

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

VnicId string

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

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
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags map[string]string
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

IpAddress Changes to this property will trigger replacement. string
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
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
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
RouteTableId string
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
SubnetId Changes to this property will trigger replacement. string
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
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 Changes to this property will trigger replacement. string

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

VnicId string

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

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>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String,String>
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ipAddress Changes to this property will trigger replacement. String
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
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
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
routeTableId String
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId Changes to this property will trigger replacement. String
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
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 Changes to this property will trigger replacement. String

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnicId String

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

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}
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags {[key: string]: string}
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ipAddress Changes to this property will trigger replacement. string
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
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
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
routeTableId string
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId Changes to this property will trigger replacement. string
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
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 Changes to this property will trigger replacement. string

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnicId string

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

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]
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeform_tags Mapping[str, str]
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ip_address Changes to this property will trigger replacement. str
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
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
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
route_table_id str
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnet_id Changes to this property will trigger replacement. str
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
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 Changes to this property will trigger replacement. str

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnic_id str

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

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>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String>
(Updatable) 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

(Updatable) 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.

For more information, see DNS in Your Virtual Cloud Network.

Example: bminstance1

ipAddress Changes to this property will trigger replacement. String
A private IP address of your choice. Must be an available IP address within the subnet's CIDR. If you don't specify a value, Oracle automatically assigns a private IP address from the subnet. Example: 10.0.3.3
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
(Updatable) Lifetime of the IP address. There are two types of IPv6 IPs:

  • Ephemeral
  • Reserved
routeTableId String
(Updatable) The OCID of the route table the IP address or VNIC will use. For more information, see Source Based Routing.
subnetId Changes to this property will trigger replacement. String
The OCID of the subnet from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given subnet.
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 Changes to this property will trigger replacement. String

Use this attribute only with the Oracle Cloud VMware Solution.

The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.

vnicId String

(Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Import

PrivateIps can be imported using the id, e.g.

$ pulumi import oci:Core/privateIp:PrivateIp test_private_ip "id"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.