oci.Core.PublicIp
Explore with Pulumi AI
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
In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.
The PublicIp resource accepts the following input properties:
- Compartment
Id 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.
- 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"}
- Display
Name string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- Private
Ip stringId (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 stringPool Id 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 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.
- 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"}
- Display
Name string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- Private
Ip stringId (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 stringPool Id 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 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.
- 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"}
- display
Name String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- private
Ip StringId (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 StringPool Id 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 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.
- {[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"}
- display
Name string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- {[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"}
- private
Ip stringId (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 stringPool Id 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.
- 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.
- 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_ strid (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_ strpool_ id 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 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.
- 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"}
- display
Name String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- private
Ip StringId (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 StringPool Id 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:
- Assigned
Entity stringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- Assigned
Entity stringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- Availability
Domain 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.
- Ip
Address 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- State string
- The public IP's current state.
- Time
Created 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 stringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- Assigned
Entity stringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- Availability
Domain 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.
- Ip
Address 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- State string
- The public IP's current state.
- Time
Created 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 StringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned
Entity StringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- availability
Domain 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.
- ip
Address 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- state String
- The public IP's current state.
- time
Created 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 stringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned
Entity stringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- availability
Domain 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.
- ip
Address 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- state string
- The public IP's current state.
- time
Created 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_ strid - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned_
entity_ strtype - 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=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
- assigned
Entity StringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned
Entity StringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- availability
Domain 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.
- ip
Address 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- state String
- The public IP's current state.
- time
Created 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.
- Assigned
Entity stringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- Assigned
Entity stringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- Availability
Domain 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
- Compartment
Id 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.
- 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"}
- Display
Name string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- Ip
Address 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.
- Private
Ip stringId (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 stringPool Id 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- State string
- The public IP's current state.
- Time
Created 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 stringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- Assigned
Entity stringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- Availability
Domain 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
- Compartment
Id 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.
- 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"}
- Display
Name string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- Ip
Address 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.
- Private
Ip stringId (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 stringPool Id 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- State string
- The public IP's current state.
- Time
Created 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 StringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned
Entity StringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- availability
Domain 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
- compartment
Id 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.
- 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"}
- display
Name String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- ip
Address 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.
- private
Ip StringId (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 StringPool Id 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- state String
- The public IP's current state.
- time
Created 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 stringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned
Entity stringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- availability
Domain 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
- compartment
Id 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.
- {[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"}
- display
Name string - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- {[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"}
- ip
Address 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.
- private
Ip stringId (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 stringPool Id 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- state string
- The public IP's current state.
- time
Created 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_ strid - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned_
entity_ strtype - 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.
- 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.
- 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_ strid (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_ strpool_ id 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=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
- assigned
Entity StringId - The OCID of the entity the public IP is assigned to, or in the process of being assigned to.
- assigned
Entity StringType - The type of entity the public IP is assigned to, or in the process of being assigned to.
- availability
Domain 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
- compartment
Id 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.
- 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"}
- display
Name String - (Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- 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"}
- ip
Address 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.
- private
Ip StringId (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 StringPool Id 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 havescope
=REGION
.AVAILABILITY_DOMAIN
: The public IP exists within the availability domain of the entity it's assigned to, which is specified by theavailabilityDomain
property of the public IP object. Ephemeral public IPs that are assigned to private IPs havescope
=AVAILABILITY_DOMAIN
.
- state String
- The public IP's current state.
- time
Created 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.