oci_core_private_ip
This resource provides the Private Ip resource in Oracle Cloud Infrastructure Core service.
Creates a secondary private IP for the specified VNIC. For more information about secondary private IPs, see IP Addresses.
Example Usage
resource "oci_core_private_ip" "test_private_ip" {
#Optional
defined_tags = {"Operations.CostCenter"= "42"}
display_name = var.private_ip_display_name
freeform_tags = {"Department"= "Finance"}
hostname_label = var.private_ip_hostname_label
ip_address = var.private_ip_ip_address
vlan_id = oci_core_vlan.test_vlan.id
vnic_id = oci_core_vnic_attachment.test_vnic_attachment.vnic_id
}
Argument Reference
The following arguments are supported:
defined_tags
- (Optional) (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
- (Optional) (Updatable) A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.freeform_tags
- (Optional) (Updatable) Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}
hostname_label
- (Optional) (Updatable) The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP’s fully qualified domain name (FQDN) (for example,bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.For more information, see DNS in Your Virtual Cloud Network.
Example:
bminstance1
ip_address
- (Optional) A private IP address of your choice. Must be an available IP address within the subnet’s CIDR. If you don’t specify a value, Oracle automatically assigns a private IP address from the subnet. Example:10.0.3.3
vlan_id
- (Optional) Use this attribute only with the Oracle Cloud VMware Solution.The OCID of the VLAN from which the private IP is to be drawn. The IP address, if supplied, must be valid for the given VLAN. See Vlan.
vnic_id
- (Optional) (Updatable) The OCID of the VNIC to assign the private IP to. The VNIC and private IP must be in the same subnet.
** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values
Attributes Reference
The following attributes are exported:
availability_domain
- The private IP’s availability domain. This attribute will be null if this is a secondary private IP assigned to a VNIC that is in a regional subnet. Example:Uocm:PHX-AD-1
compartment_id
- The OCID of the compartment containing the private IP.defined_tags
- 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
- A user-friendly name. Does not have to be unique, and it’s changeable. Avoid entering confidential information.freeform_tags
- Free-form tags for this resource. Each tag is a simple key-value pair with no predefined name, type, or namespace. For more information, see Resource Tags. Example:{"Department": "Finance"}
hostname_label
- The hostname for the private IP. Used for DNS. The value is the hostname portion of the private IP’s fully qualified domain name (FQDN) (for example,bminstance1
in FQDNbminstance1.subnet123.vcn1.oraclevcn.com
). Must be unique across all VNICs in the subnet and comply with RFC 952 and RFC 1123.For more information, see DNS in Your Virtual Cloud Network.
Example:
bminstance1
id
- The private IP’s Oracle ID (OCID).ip_address
- The private IP address of theprivateIp
object. The address is within the CIDR of the VNIC’s subnet.However, if the
PrivateIp
object is being used with a VLAN as part of the Oracle Cloud VMware Solution, the address is from the range specified by thecidrBlock
attribute for the VLAN. See Vlan.Example:
10.0.3.3
is_primary
- Whether this private IP is the primary one on the VNIC. Primary private IPs are unassigned and deleted automatically when the VNIC is terminated. Example:true
is_reserved
- true if the IP is reserved and can exist detached from vnicsubnet_id
- The OCID of the subnet the VNIC is in.However, if the
PrivateIp
object is being used with a VLAN as part of the Oracle Cloud VMware Solution, thesubnetId
is null.time_created
- The date and time the private IP was created, in the format defined by RFC3339. Example:2016-08-25T21:10:29.600Z
vlan_id
- Applicable only if thePrivateIp
object is being used with a VLAN as part of the Oracle Cloud VMware Solution. ThevlanId
is the OCID of the VLAN. See Vlan.vnic_id
- The OCID of the VNIC the private IP is assigned to. The VNIC and private IP must be in the same subnet. However, if thePrivateIp
object is being used with a VLAN as part of the Oracle Cloud VMware Solution, thevnicId
is null.
Timeouts
The timeouts
block allows you to specify timeouts for certain operations:
* create
- (Defaults to 20 minutes), when creating the Private Ip
* update
- (Defaults to 20 minutes), when updating the Private Ip
* delete
- (Defaults to 20 minutes), when destroying the Private Ip
Import
PrivateIps can be imported using the id
, e.g.
$ terraform import oci_core_private_ip.test_private_ip "id"