oci_core_public_ip

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.

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

resource "oci_core_public_ip" "test_public_ip" {
	#Required
	compartment_id = var.compartment_id
	lifetime = var.public_ip_lifetime

	#Optional
	defined_tags = {"Operations.CostCenter"= "42"}
	display_name = var.public_ip_display_name
	freeform_tags = {"Department"= "Finance"}
	private_ip_id = oci_core_private_ip.test_private_ip.id
	public_ip_pool_id = oci_core_public_ip_pool.test_public_ip_pool.id
}

Argument Reference

The following arguments are supported:

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

Attributes Reference

The following attributes are exported:

Timeouts

The timeouts block allows you to specify timeouts for certain operations: * create - (Defaults to 20 minutes), when creating the Public Ip * update - (Defaults to 20 minutes), when updating the Public Ip * delete - (Defaults to 20 minutes), when destroying the Public Ip

Import

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

$ terraform import oci_core_public_ip.test_public_ip "id"