Table: oci_core_vnic_attachment - Query OCI Core VNIC Attachments using SQL
A VNIC attachment represents the attachment of a VNIC to an instance. It is a part of Oracle Cloud Infrastructure's (OCI) Core Services. This resource is used to manage and control the network interface cards (NICs) attached to the instances in your virtual cloud network (VCN).
Table Usage Guide
The oci_core_vnic_attachment
table provides insights into VNIC attachments within OCI Core Services. As a Network Administrator, you can explore detailed information about each VNIC attachment, including its lifecycle state, availability domain, and associated instance. Utilize this table to manage and monitor the network interface cards attached to your instances, ensuring optimal network performance and security.
Examples
Basic info
Explore which virtual network interface cards (VNICs) are attached to your instances in Oracle Cloud Infrastructure, allowing you to assess their lifecycle states and connectivity details. This information can assist in managing network configurations and troubleshooting network-related issues.
select id, display_name, instance_id, availability_domain, lifecycle_state, private_ip, public_ip, time_createdfrom oci_core_vnic_attachment;
select id, display_name, instance_id, availability_domain, lifecycle_state, private_ip, public_ip, time_createdfrom oci_core_vnic_attachment;
List detached VNICs
Explore which VNIC attachments are currently in a 'detached' state. This can be useful for identifying unused resources or potential configuration issues within your OCI environment.
select id, display_name, lifecycle_statefrom oci_core_vnic_attachmentwhere lifecycle_state = 'DETACHED';
select id, display_name, lifecycle_statefrom oci_core_vnic_attachmentwhere lifecycle_state = 'DETACHED';
List automatically created and attached VNICs
Explore which Virtual Network Interface Cards (VNICs) were automatically generated and attached. This is useful for understanding how your network resources are being utilized and managed within your cloud environment.
select id, display_name, is_primaryfrom oci_core_vnic_attachmentwhere is_primary;
select id, display_name, is_primaryfrom oci_core_vnic_attachmentwhere is_primary = 1;
List VNICs with disabled source/destination check
Explore which Virtual Network Interface Cards (VNICs) have their source/destination check disabled. This is useful in situations where you need to route traffic through your instances, such as setting up a NAT (Network Address Translation) instance or configuring a firewall.
select id, display_name, skip_source_dest_checkfrom oci_core_vnic_attachmentwhere skip_source_dest_check;
select id, display_name, skip_source_dest_checkfrom oci_core_vnic_attachmentwhere skip_source_dest_check = 1;
Query examples
- compute_instance_by_public_ip
- compute_instance_public
- compute_instance_public_instance_count
- compute_instance_security_groups
- compute_instance_vnic
- compute_instances_for_vcn_network_security_group
- compute_instances_for_vcn_subnet
- compute_instances_for_vcn_vcn
- vcn_load_balancers_for_compute_instance
- vcn_network_load_balancers_for_compute_instance
- vcn_network_security_group_assoc
- vcn_network_security_groups_for_compute_instance
- vcn_subnets_for_compute_instance
- vcn_vcns_for_compute_instance
- vcn_vnics_for_compute_instance
- vcn_vnics_for_vcn_network_security_group
Schema for oci_core_vnic_attachment
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
availability_domain | text | = | The availability domain of the instance. |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
defined_tags | jsonb | Defined tags for resource. Defined tags are set up in your tenancy by an administrator. Only users granted permission to work with the defined tags can apply them to resources. | |
display_name | text | A user-friendly name for the VNIC attachment. | |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
hostname_label | text | The hostname for the VNIC's primary private IP. | |
id | text | = | The OCID of the VNIC attachment. |
instance_id | text | = | The OCID of the instance. |
is_primary | boolean | Whether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch). | |
lifecycle_state | text | The current state of the VNIC attachment. Possible values include: 'ATTACHING', 'ATTACHED', 'DETACHING', 'DETACHED'. | |
mac_address | text | The MAC address of the VNIC. | |
nic_index | bigint | The physical network interface card (NIC) the VNIC uses. | |
nsg_ids | jsonb | A list of the OCIDs of the network security groups that the VNIC belongs to. | |
private_ip | text | The private IP address of the primary `privateIp` object on the VNIC. | |
public_ip | text | The public IP address of the VNIC, if one is assigned. | |
region | text | The OCI region in which the resource is located. | |
skip_source_dest_check | boolean | Whether the source/destination check is disabled on the VNIC. Defaults to `false`, which means the check is performed. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
subnet_id | text | The OCID of the subnet to create the VNIC in. | |
tags | jsonb | A map of tags for the resource. | |
tenant_id | text | =, !=, ~~, ~~*, !~~, !~~* | The OCID of the Tenant in which the resource is located. |
tenant_name | text | The name of the Tenant in which the resource is located. | |
time_created | timestamp with time zone | The date and time the VNIC attachment was created. | |
title | text | Title of the resource. | |
vlan_id | text | The OCID of the VLAN to create the VNIC in. | |
vlan_tag | bigint | The OCID of the VNIC. | |
vnic_id | text | The OCID of the VNIC. | |
vnic_name | text | A user-friendly name for the VNIC. |
Export
This table is available as a standalone Exporter CLI. Steampipe exporters are stand-alone binaries that allow you to extract data using Steampipe plugins without a database.
You can download the tarball for your platform from the Releases page, but it is simplest to install them with the steampipe_export_installer.sh
script:
/bin/sh -c "$(curl -fsSL https://steampipe.io/install/export.sh)" -- oci
You can pass the configuration to the command with the --config
argument:
steampipe_export_oci --config '<your_config>' oci_core_vnic_attachment