Oracle Cloud Infrastructure

Pulumi Official
Package maintained by Pulumi
v0.1.1 published on Tuesday, May 3, 2022 by Pulumi

getPublicIp

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

Gets the specified public IP. You must specify the object’s OCID.

Alternatively, you can get the object by using GetPublicIpByIpAddress with the public IP address (for example, 203.0.113.2).

Or you can use GetPublicIpByPrivateIpId with the OCID of the private IP that the public IP is assigned to.

Note: If you’re fetching a reserved public IP that is in the process of being moved to a different private IP, the service returns the public IP object with lifecycleState = ASSIGNING and assignedEntityId = OCID of the target private IP.

Example Usage

Get a public ip by public ip id

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testOciCorePublicIpById = Output.Create(Oci.Core.GetPublicIp.InvokeAsync(new Oci.Core.GetPublicIpArgs
        {
            Id = @var.Test_public_ip_id,
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Core.GetPublicIp(ctx, &core.GetPublicIpArgs{
			Id: pulumi.StringRef(_var.Test_public_ip_id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_oci_core_public_ip_by_id = oci.Core.get_public_ip(id=var["test_public_ip_id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testOciCorePublicIpById = oci.Core.getPublicIp({
    id: _var.test_public_ip_id,
});

Coming soon!

Get a public ip by private ip id

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testOciCorePublicIpByPrivateIpId = Output.Create(Oci.Core.GetPublicIp.InvokeAsync(new Oci.Core.GetPublicIpArgs
        {
            PrivateIpId = @var.Test_public_ip_private_ip_id,
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Core.GetPublicIp(ctx, &core.GetPublicIpArgs{
			PrivateIpId: pulumi.StringRef(_var.Test_public_ip_private_ip_id),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_oci_core_public_ip_by_private_ip_id = oci.Core.get_public_ip(private_ip_id=var["test_public_ip_private_ip_id"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testOciCorePublicIpByPrivateIpId = oci.Core.getPublicIp({
    privateIpId: _var.test_public_ip_private_ip_id,
});

Coming soon!

Get a public ip by public ip address

using Pulumi;
using Oci = Pulumi.Oci;

class MyStack : Stack
{
    public MyStack()
    {
        var testOciCorePublicIpByIp = Output.Create(Oci.Core.GetPublicIp.InvokeAsync(new Oci.Core.GetPublicIpArgs
        {
            IpAddress = @var.Test_public_ip_ip_address,
        }));
    }

}
package main

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

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		_, err := Core.GetPublicIp(ctx, &core.GetPublicIpArgs{
			IpAddress: pulumi.StringRef(_var.Test_public_ip_ip_address),
		}, nil)
		if err != nil {
			return err
		}
		return nil
	})
}

Coming soon!

import pulumi
import pulumi_oci as oci

test_oci_core_public_ip_by_ip = oci.Core.get_public_ip(ip_address=var["test_public_ip_ip_address"])
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testOciCorePublicIpByIp = oci.Core.getPublicIp({
    ipAddress: _var.test_public_ip_ip_address,
});

Coming soon!

Using getPublicIp

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 getPublicIp(args: GetPublicIpArgs, opts?: InvokeOptions): Promise<GetPublicIpResult>
function getPublicIpOutput(args: GetPublicIpOutputArgs, opts?: InvokeOptions): Output<GetPublicIpResult>
def get_public_ip(id: Optional[str] = None,
                  ip_address: Optional[str] = None,
                  private_ip_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetPublicIpResult
def get_public_ip_output(id: Optional[pulumi.Input[str]] = None,
                  ip_address: Optional[pulumi.Input[str]] = None,
                  private_ip_id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetPublicIpResult]
func GetPublicIp(ctx *Context, args *GetPublicIpArgs, opts ...InvokeOption) (*GetPublicIpResult, error)
func GetPublicIpOutput(ctx *Context, args *GetPublicIpOutputArgs, opts ...InvokeOption) GetPublicIpResultOutput

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

public static class GetPublicIp 
{
    public static Task<GetPublicIpResult> InvokeAsync(GetPublicIpArgs args, InvokeOptions? opts = null)
    public static Output<GetPublicIpResult> Invoke(GetPublicIpInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetPublicIpResult> getPublicIp(GetPublicIpArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
Fn::Invoke:
  Function: oci:Core/getPublicIp:getPublicIp
  Arguments:
    # Arguments dictionary

The following arguments are supported:

Id string

The OCID of the public IP.

IpAddress string

Gets the public IP based on the public IP address (for example, 129.146.2.1).

PrivateIpId string

Gets the public IP assigned to the specified private IP. You must specify the OCID of the private IP. If no public IP is assigned, a 404 is returned.

Id string

The OCID of the public IP.

IpAddress string

Gets the public IP based on the public IP address (for example, 129.146.2.1).

PrivateIpId string

Gets the public IP assigned to the specified private IP. You must specify the OCID of the private IP. If no public IP is assigned, a 404 is returned.

id String

The OCID of the public IP.

ipAddress String

Gets the public IP based on the public IP address (for example, 129.146.2.1).

privateIpId String

Gets the public IP assigned to the specified private IP. You must specify the OCID of the private IP. If no public IP is assigned, a 404 is returned.

id string

The OCID of the public IP.

ipAddress string

Gets the public IP based on the public IP address (for example, 129.146.2.1).

privateIpId string

Gets the public IP assigned to the specified private IP. You must specify the OCID of the private IP. If no public IP is assigned, a 404 is returned.

id str

The OCID of the public IP.

ip_address str

Gets the public IP based on the public IP address (for example, 129.146.2.1).

private_ip_id str

Gets the public IP assigned to the specified private IP. You must specify the OCID of the private IP. If no public IP is assigned, a 404 is returned.

id String

The OCID of the public IP.

ipAddress String

Gets the public IP based on the public IP address (for example, 129.146.2.1).

privateIpId String

Gets the public IP assigned to the specified private IP. You must specify the OCID of the private IP. If no public IP is assigned, a 404 is returned.

getPublicIp Result

The following output properties are available:

AssignedEntityId string

The OCID of the entity the public IP is assigned to, or in the process of being assigned to.

AssignedEntityType string

The type of entity the public IP is assigned to, or in the process of being assigned to.

AvailabilityDomain string

The public IP's availability domain. This property is set only for ephemeral public IPs that are assigned to a private IP (that is, when the scope of the public IP is set to AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. Example: Uocm:PHX-AD-1

CompartmentId string

The OCID of the compartment containing the public IP. For an ephemeral public IP, this is the compartment of its assigned entity (which can be a private IP or a regional entity such as a NAT gateway). For a reserved public IP that is currently assigned, its compartment can be different from the assigned private IP's.

DefinedTags Dictionary<string, object>

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, object>

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"}

Id string

The public IP's Oracle ID (OCID).

IpAddress string

The public IP address of the publicIp object. Example: 203.0.113.2

Lifetime string

Defines when the public IP is deleted and released back to Oracle's public IP pool.

  • EPHEMERAL: The lifetime is tied to the lifetime of its assigned entity. An ephemeral public IP must always be assigned to an entity. If the assigned entity is a private IP, the ephemeral public IP is automatically deleted when the private IP is deleted, when the VNIC is terminated, or when the instance is terminated. If the assigned entity is a NatGateway, the ephemeral public IP is automatically deleted when the NAT gateway is terminated.
  • RESERVED: You control the public IP's lifetime. You can delete a reserved public IP whenever you like. It does not need to be assigned to a private IP at all times.
PrivateIpId string

Deprecated. Use assignedEntityId instead.

PublicIpPoolId string

The OCID of the pool object created in the current tenancy.

Scope string

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs assigned to a regional entity have scope = REGION.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it's assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.
State string

The public IP's current state.

TimeCreated string

The date and time the public IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

AssignedEntityId string

The OCID of the entity the public IP is assigned to, or in the process of being assigned to.

AssignedEntityType string

The type of entity the public IP is assigned to, or in the process of being assigned to.

AvailabilityDomain string

The public IP's availability domain. This property is set only for ephemeral public IPs that are assigned to a private IP (that is, when the scope of the public IP is set to AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. Example: Uocm:PHX-AD-1

CompartmentId string

The OCID of the compartment containing the public IP. For an ephemeral public IP, this is the compartment of its assigned entity (which can be a private IP or a regional entity such as a NAT gateway). For a reserved public IP that is currently assigned, its compartment can be different from the assigned private IP's.

DefinedTags map[string]interface{}

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]interface{}

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"}

Id string

The public IP's Oracle ID (OCID).

IpAddress string

The public IP address of the publicIp object. Example: 203.0.113.2

Lifetime string

Defines when the public IP is deleted and released back to Oracle's public IP pool.

  • EPHEMERAL: The lifetime is tied to the lifetime of its assigned entity. An ephemeral public IP must always be assigned to an entity. If the assigned entity is a private IP, the ephemeral public IP is automatically deleted when the private IP is deleted, when the VNIC is terminated, or when the instance is terminated. If the assigned entity is a NatGateway, the ephemeral public IP is automatically deleted when the NAT gateway is terminated.
  • RESERVED: You control the public IP's lifetime. You can delete a reserved public IP whenever you like. It does not need to be assigned to a private IP at all times.
PrivateIpId string

Deprecated. Use assignedEntityId instead.

PublicIpPoolId string

The OCID of the pool object created in the current tenancy.

Scope string

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs assigned to a regional entity have scope = REGION.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it's assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.
State string

The public IP's current state.

TimeCreated string

The date and time the public IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

assignedEntityId String

The OCID of the entity the public IP is assigned to, or in the process of being assigned to.

assignedEntityType String

The type of entity the public IP is assigned to, or in the process of being assigned to.

availabilityDomain String

The public IP's availability domain. This property is set only for ephemeral public IPs that are assigned to a private IP (that is, when the scope of the public IP is set to AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. Example: Uocm:PHX-AD-1

compartmentId String

The OCID of the compartment containing the public IP. For an ephemeral public IP, this is the compartment of its assigned entity (which can be a private IP or a regional entity such as a NAT gateway). For a reserved public IP that is currently assigned, its compartment can be different from the assigned private IP's.

definedTags Map<String,Object>

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,Object>

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"}

id String

The public IP's Oracle ID (OCID).

ipAddress String

The public IP address of the publicIp object. Example: 203.0.113.2

lifetime String

Defines when the public IP is deleted and released back to Oracle's public IP pool.

  • EPHEMERAL: The lifetime is tied to the lifetime of its assigned entity. An ephemeral public IP must always be assigned to an entity. If the assigned entity is a private IP, the ephemeral public IP is automatically deleted when the private IP is deleted, when the VNIC is terminated, or when the instance is terminated. If the assigned entity is a NatGateway, the ephemeral public IP is automatically deleted when the NAT gateway is terminated.
  • RESERVED: You control the public IP's lifetime. You can delete a reserved public IP whenever you like. It does not need to be assigned to a private IP at all times.
privateIpId String

Deprecated. Use assignedEntityId instead.

publicIpPoolId String

The OCID of the pool object created in the current tenancy.

scope String

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs assigned to a regional entity have scope = REGION.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it's assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.
state String

The public IP's current state.

timeCreated String

The date and time the public IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

assignedEntityId string

The OCID of the entity the public IP is assigned to, or in the process of being assigned to.

assignedEntityType string

The type of entity the public IP is assigned to, or in the process of being assigned to.

availabilityDomain string

The public IP's availability domain. This property is set only for ephemeral public IPs that are assigned to a private IP (that is, when the scope of the public IP is set to AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. Example: Uocm:PHX-AD-1

compartmentId string

The OCID of the compartment containing the public IP. For an ephemeral public IP, this is the compartment of its assigned entity (which can be a private IP or a regional entity such as a NAT gateway). For a reserved public IP that is currently assigned, its compartment can be different from the assigned private IP's.

definedTags {[key: string]: any}

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]: any}

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"}

id string

The public IP's Oracle ID (OCID).

ipAddress string

The public IP address of the publicIp object. Example: 203.0.113.2

lifetime string

Defines when the public IP is deleted and released back to Oracle's public IP pool.

  • EPHEMERAL: The lifetime is tied to the lifetime of its assigned entity. An ephemeral public IP must always be assigned to an entity. If the assigned entity is a private IP, the ephemeral public IP is automatically deleted when the private IP is deleted, when the VNIC is terminated, or when the instance is terminated. If the assigned entity is a NatGateway, the ephemeral public IP is automatically deleted when the NAT gateway is terminated.
  • RESERVED: You control the public IP's lifetime. You can delete a reserved public IP whenever you like. It does not need to be assigned to a private IP at all times.
privateIpId string

Deprecated. Use assignedEntityId instead.

publicIpPoolId string

The OCID of the pool object created in the current tenancy.

scope string

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs assigned to a regional entity have scope = REGION.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it's assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.
state string

The public IP's current state.

timeCreated string

The date and time the public IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

assigned_entity_id str

The OCID of the entity the public IP is assigned to, or in the process of being assigned to.

assigned_entity_type str

The type of entity the public IP is assigned to, or in the process of being assigned to.

availability_domain str

The public IP's availability domain. This property is set only for ephemeral public IPs that are assigned to a private IP (that is, when the scope of the public IP is set to AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. Example: Uocm:PHX-AD-1

compartment_id str

The OCID of the compartment containing the public IP. For an ephemeral public IP, this is the compartment of its assigned entity (which can be a private IP or a regional entity such as a NAT gateway). For a reserved public IP that is currently assigned, its compartment can be different from the assigned private IP's.

defined_tags Mapping[str, Any]

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, Any]

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"}

id str

The public IP's Oracle ID (OCID).

ip_address str

The public IP address of the publicIp object. Example: 203.0.113.2

lifetime str

Defines when the public IP is deleted and released back to Oracle's public IP pool.

  • EPHEMERAL: The lifetime is tied to the lifetime of its assigned entity. An ephemeral public IP must always be assigned to an entity. If the assigned entity is a private IP, the ephemeral public IP is automatically deleted when the private IP is deleted, when the VNIC is terminated, or when the instance is terminated. If the assigned entity is a NatGateway, the ephemeral public IP is automatically deleted when the NAT gateway is terminated.
  • RESERVED: You control the public IP's lifetime. You can delete a reserved public IP whenever you like. It does not need to be assigned to a private IP at all times.
private_ip_id str

Deprecated. Use assignedEntityId instead.

public_ip_pool_id str

The OCID of the pool object created in the current tenancy.

scope str

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs assigned to a regional entity have scope = REGION.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it's assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.
state str

The public IP's current state.

time_created str

The date and time the public IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

assignedEntityId String

The OCID of the entity the public IP is assigned to, or in the process of being assigned to.

assignedEntityType String

The type of entity the public IP is assigned to, or in the process of being assigned to.

availabilityDomain String

The public IP's availability domain. This property is set only for ephemeral public IPs that are assigned to a private IP (that is, when the scope of the public IP is set to AVAILABILITY_DOMAIN). The value is the availability domain of the assigned private IP. Example: Uocm:PHX-AD-1

compartmentId String

The OCID of the compartment containing the public IP. For an ephemeral public IP, this is the compartment of its assigned entity (which can be a private IP or a regional entity such as a NAT gateway). For a reserved public IP that is currently assigned, its compartment can be different from the assigned private IP's.

definedTags Map<Any>

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<Any>

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"}

id String

The public IP's Oracle ID (OCID).

ipAddress String

The public IP address of the publicIp object. Example: 203.0.113.2

lifetime String

Defines when the public IP is deleted and released back to Oracle's public IP pool.

  • EPHEMERAL: The lifetime is tied to the lifetime of its assigned entity. An ephemeral public IP must always be assigned to an entity. If the assigned entity is a private IP, the ephemeral public IP is automatically deleted when the private IP is deleted, when the VNIC is terminated, or when the instance is terminated. If the assigned entity is a NatGateway, the ephemeral public IP is automatically deleted when the NAT gateway is terminated.
  • RESERVED: You control the public IP's lifetime. You can delete a reserved public IP whenever you like. It does not need to be assigned to a private IP at all times.
privateIpId String

Deprecated. Use assignedEntityId instead.

publicIpPoolId String

The OCID of the pool object created in the current tenancy.

scope String

Whether the public IP is regional or specific to a particular availability domain.

  • REGION: The public IP exists within a region and is assigned to a regional entity (such as a NatGateway), or can be assigned to a private IP in any availability domain in the region. Reserved public IPs and ephemeral public IPs assigned to a regional entity have scope = REGION.
  • AVAILABILITY_DOMAIN: The public IP exists within the availability domain of the entity it's assigned to, which is specified by the availabilityDomain property of the public IP object. Ephemeral public IPs that are assigned to private IPs have scope = AVAILABILITY_DOMAIN.
state String

The public IP's current state.

timeCreated String

The date and time the public IP was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Package Details

Repository
https://github.com/pulumi/pulumi-oci
License
Apache-2.0
Notes

This Pulumi package is based on the oci Terraform Provider.