diff --git a/VERSION b/VERSION index ae096aa2..e7d802d5 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1!10.14.0 +1!10.14.1 diff --git a/pycloudlib/oci/cloud.py b/pycloudlib/oci/cloud.py index 901503e7..9aeae65d 100644 --- a/pycloudlib/oci/cloud.py +++ b/pycloudlib/oci/cloud.py @@ -313,12 +313,14 @@ def launch( subnet = self.network_client.get_subnet(subnet_id).data vnic_kwargs = {} - # When no IPv4 CIDR is present, the value is assigned to '' str instead of None. - if "null" not in subnet.cidr_block: - vnic_kwargs["assign_public_ip"] = True - - if subnet.ipv6_cidr_block is not None: - vnic_kwargs["assign_ipv6_ip"] = True + # Only assign public IP if the subnet allows it + if not subnet.prohibit_public_ip_on_vnic: + # When no IPv4 CIDR is present, the value is assigned to '' str instead of None. + if "null" not in subnet.cidr_block: + vnic_kwargs["assign_public_ip"] = True + + if subnet.ipv6_cidr_block is not None: + vnic_kwargs["assign_ipv6_ip"] = True default_metadata = { "ssh_authorized_keys": self.key_pair.public_key_content,