1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. PublicIp
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

oci.Core.PublicIp

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi

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

    Creates a public IP. Use the lifetime property to specify whether it’s an ephemeral or reserved public IP. For information about limits on how many you can create, see Public IP Addresses.

    • For an ephemeral public IP assigned to a private IP: You must also specify a privateIpId with the OCID of the primary private IP you want to assign the public IP to. The public IP is created in the same availability domain as the private IP. An ephemeral public IP must always be assigned to a private IP, and only to the primary private IP on a VNIC, not a secondary private IP. Exception: If you create a NatGateway, Oracle automatically assigns the NAT gateway a regional ephemeral public IP that you cannot remove.

    • For a reserved public IP: You may also optionally assign the public IP to a private IP by specifying privateIpId. Or you can later assign the public IP with UpdatePublicIp.

    Note: When assigning a public IP to a private IP, the private IP must not already have a public IP with lifecycleState = ASSIGNING or ASSIGNED. If it does, an error is returned.

    Also, for reserved public IPs, the optional assignment part of this operation is asynchronous. Poll the public IP’s lifecycleState to determine if the assignment succeeded.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testPublicIp = new oci.core.PublicIp("test_public_ip", {
        compartmentId: compartmentId,
        lifetime: publicIpLifetime,
        definedTags: {
            "Operations.CostCenter": "42",
        },
        displayName: publicIpDisplayName,
        freeformTags: {
            Department: "Finance",
        },
        privateIpId: testPrivateIp.id,
        publicIpPoolId: testPublicIpPool.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_public_ip = oci.core.PublicIp("test_public_ip",
        compartment_id=compartment_id,
        lifetime=public_ip_lifetime,
        defined_tags={
            "Operations.CostCenter": "42",
        },
        display_name=public_ip_display_name,
        freeform_tags={
            "Department": "Finance",
        },
        private_ip_id=test_private_ip["id"],
        public_ip_pool_id=test_public_ip_pool["id"])
    
    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.NewPublicIp(ctx, "test_public_ip", &Core.PublicIpArgs{
    			CompartmentId: pulumi.Any(compartmentId),
    			Lifetime:      pulumi.Any(publicIpLifetime),
    			DefinedTags: pulumi.StringMap{
    				"Operations.CostCenter": pulumi.String("42"),
    			},
    			DisplayName: pulumi.Any(publicIpDisplayName),
    			FreeformTags: pulumi.StringMap{
    				"Department": pulumi.String("Finance"),
    			},
    			PrivateIpId:    pulumi.Any(testPrivateIp.Id),
    			PublicIpPoolId: pulumi.Any(testPublicIpPool.Id),
    		})
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using Oci = Pulumi.Oci;
    
    return await Deployment.RunAsync(() => 
    {
        var testPublicIp = new Oci.Core.PublicIp("test_public_ip", new()
        {
            CompartmentId = compartmentId,
            Lifetime = publicIpLifetime,
            DefinedTags = 
            {
                { "Operations.CostCenter", "42" },
            },
            DisplayName = publicIpDisplayName,
            FreeformTags = 
            {
                { "Department", "Finance" },
            },
            PrivateIpId = testPrivateIp.Id,
            PublicIpPoolId = testPublicIpPool.Id,
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.oci.Core.PublicIp;
    import com.pulumi.oci.Core.PublicIpArgs;
    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 testPublicIp = new PublicIp("testPublicIp", PublicIpArgs.builder()
                .compartmentId(compartmentId)
                .lifetime(publicIpLifetime)
                .definedTags(Map.of("Operations.CostCenter", "42"))
                .displayName(publicIpDisplayName)
                .freeformTags(Map.of("Department", "Finance"))
                .privateIpId(testPrivateIp.id())
                .publicIpPoolId(testPublicIpPool.id())
                .build());
    
        }
    }
    
    resources:
      testPublicIp:
        type: oci:Core:PublicIp
        name: test_public_ip
        properties:
          compartmentId: ${compartmentId}
          lifetime: ${publicIpLifetime}
          definedTags:
            Operations.CostCenter: '42'
          displayName: ${publicIpDisplayName}
          freeformTags:
            Department: Finance
          privateIpId: ${testPrivateIp.id}
          publicIpPoolId: ${testPublicIpPool.id}
    

    Create PublicIp Resource

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

    Constructor syntax

    new PublicIp(name: string, args: PublicIpArgs, opts?: CustomResourceOptions);
    @overload
    def PublicIp(resource_name: str,
                 args: PublicIpArgs,
                 opts: Optional[ResourceOptions] = None)
    
    @overload
    def PublicIp(resource_name: str,
                 opts: Optional[ResourceOptions] = None,
                 compartment_id: Optional[str] = None,
                 lifetime: Optional[str] = None,
                 defined_tags: Optional[Mapping[str, str]] = None,
                 display_name: Optional[str] = None,
                 freeform_tags: Optional[Mapping[str, str]] = None,
                 private_ip_id: Optional[str] = None,
                 public_ip_pool_id: Optional[str] = None)
    func NewPublicIp(ctx *Context, name string, args PublicIpArgs, opts ...ResourceOption) (*PublicIp, error)
    public PublicIp(string name, PublicIpArgs args, CustomResourceOptions? opts = null)
    public PublicIp(String name, PublicIpArgs args)
    public PublicIp(String name, PublicIpArgs args, CustomResourceOptions options)
    
    type: oci:Core:PublicIp
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args PublicIpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    resource_name str
    The unique name of the resource.
    args PublicIpArgs
    The arguments to resource properties.
    opts ResourceOptions
    Bag of options to control resource's behavior.
    ctx Context
    Context object for the current deployment.
    name string
    The unique name of the resource.
    args PublicIpArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args PublicIpArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args PublicIpArgs
    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 publicIpResource = new Oci.Core.PublicIp("publicIpResource", new()
    {
        CompartmentId = "string",
        Lifetime = "string",
        DefinedTags = 
        {
            { "string", "string" },
        },
        DisplayName = "string",
        FreeformTags = 
        {
            { "string", "string" },
        },
        PrivateIpId = "string",
        PublicIpPoolId = "string",
    });
    
    example, err := Core.NewPublicIp(ctx, "publicIpResource", &Core.PublicIpArgs{
    	CompartmentId: pulumi.String("string"),
    	Lifetime:      pulumi.String("string"),
    	DefinedTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	DisplayName: pulumi.String("string"),
    	FreeformTags: pulumi.StringMap{
    		"string": pulumi.String("string"),
    	},
    	PrivateIpId:    pulumi.String("string"),
    	PublicIpPoolId: pulumi.String("string"),
    })
    
    var publicIpResource = new PublicIp("publicIpResource", PublicIpArgs.builder()
        .compartmentId("string")
        .lifetime("string")
        .definedTags(Map.of("string", "string"))
        .displayName("string")
        .freeformTags(Map.of("string", "string"))
        .privateIpId("string")
        .publicIpPoolId("string")
        .build());
    
    public_ip_resource = oci.core.PublicIp("publicIpResource",
        compartment_id="string",
        lifetime="string",
        defined_tags={
            "string": "string",
        },
        display_name="string",
        freeform_tags={
            "string": "string",
        },
        private_ip_id="string",
        public_ip_pool_id="string")
    
    const publicIpResource = new oci.core.PublicIp("publicIpResource", {
        compartmentId: "string",
        lifetime: "string",
        definedTags: {
            string: "string",
        },
        displayName: "string",
        freeformTags: {
            string: "string",
        },
        privateIpId: "string",
        publicIpPoolId: "string",
    });
    
    type: oci:Core:PublicIp
    properties:
        compartmentId: string
        definedTags:
            string: string
        displayName: string
        freeformTags:
            string: string
        lifetime: string
        privateIpId: string
        publicIpPoolId: string
    

    PublicIp Resource Properties

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

    Inputs

    The PublicIp resource accepts the following input properties:

    CompartmentId string
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    Lifetime string
    Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    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"}
    PrivateIpId string

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    PublicIpPoolId string

    The OCID of the public IP pool.

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

    CompartmentId string
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    Lifetime string
    Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    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"}
    PrivateIpId string

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    PublicIpPoolId string

    The OCID of the public IP pool.

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

    compartmentId String
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    lifetime String
    Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    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"}
    privateIpId String

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    publicIpPoolId String

    The OCID of the public IP pool.

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

    compartmentId string
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    lifetime string
    Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    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"}
    privateIpId string

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    publicIpPoolId string

    The OCID of the public IP pool.

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

    compartment_id str
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    lifetime str
    Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    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"}
    private_ip_id str

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    public_ip_pool_id str

    The OCID of the public IP pool.

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

    compartmentId String
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    lifetime String
    Defines when the public IP is deleted and released back to the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    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"}
    privateIpId String

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    publicIpPoolId String

    The OCID of the public IP pool.

    ** 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 PublicIp resource produces the following output properties:

    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
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddress string
    The public IP address of the publicIp object. Example: 203.0.113.2
    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
    Id string
    The provider-assigned unique ID for this managed resource.
    IpAddress string
    The public IP address of the publicIp object. Example: 203.0.113.2
    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
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddress String
    The public IP address of the publicIp object. Example: 203.0.113.2
    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
    id string
    The provider-assigned unique ID for this managed resource.
    ipAddress string
    The public IP address of the publicIp object. Example: 203.0.113.2
    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
    id str
    The provider-assigned unique ID for this managed resource.
    ip_address str
    The public IP address of the publicIp object. Example: 203.0.113.2
    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
    id String
    The provider-assigned unique ID for this managed resource.
    ipAddress String
    The public IP address of the publicIp object. Example: 203.0.113.2
    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

    Look up Existing PublicIp Resource

    Get an existing PublicIp 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?: PublicIpState, opts?: CustomResourceOptions): PublicIp
    @staticmethod
    def get(resource_name: str,
            id: str,
            opts: Optional[ResourceOptions] = None,
            assigned_entity_id: Optional[str] = None,
            assigned_entity_type: Optional[str] = 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,
            ip_address: Optional[str] = None,
            lifetime: Optional[str] = None,
            private_ip_id: Optional[str] = None,
            public_ip_pool_id: Optional[str] = None,
            scope: Optional[str] = None,
            state: Optional[str] = None,
            time_created: Optional[str] = None) -> PublicIp
    func GetPublicIp(ctx *Context, name string, id IDInput, state *PublicIpState, opts ...ResourceOption) (*PublicIp, error)
    public static PublicIp Get(string name, Input<string> id, PublicIpState? state, CustomResourceOptions? opts = null)
    public static PublicIp get(String name, Output<String> id, PublicIpState state, CustomResourceOptions options)
    Resource lookup is not supported in YAML
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    The unique provider ID of the resource to lookup.
    name
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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
    The unique name of the resulting resource.
    id
    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:
    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
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    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"}
    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 the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    PrivateIpId string

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    PublicIpPoolId string

    The OCID of the public IP pool.

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

    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
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    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"}
    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 the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    PrivateIpId string

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    PublicIpPoolId string

    The OCID of the public IP pool.

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

    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
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    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"}
    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 the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    privateIpId String

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    publicIpPoolId String

    The OCID of the public IP pool.

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

    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
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    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"}
    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 the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    privateIpId string

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    publicIpPoolId string

    The OCID of the public IP pool.

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

    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
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    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"}
    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 the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    private_ip_id str

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    public_ip_pool_id str

    The OCID of the public IP pool.

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

    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
    (Updatable) The OCID of the compartment to contain the public IP. For ephemeral public IPs, you must set this to the private IP's compartment OCID.
    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"}
    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 the Oracle Cloud Infrastructure public IP pool. For more information, see Public IP Addresses.
    privateIpId String

    (Updatable) The OCID of the private IP to assign the public IP to.

    Required for an ephemeral public IP because it must always be assigned to a private IP (specifically a primary private IP).

    Optional for a reserved public IP. If you don't provide it, the public IP is created but not assigned to a private IP. You can later assign the public IP with UpdatePublicIp.

    publicIpPoolId String

    The OCID of the public IP pool.

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

    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

    Import

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

    $ pulumi import oci:Core/publicIp:PublicIp test_public_ip "id"
    

    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.
    oci logo
    Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi