steampipe plugin install oci

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_created
from
oci_core_vnic_attachment;
select
id,
display_name,
instance_id,
availability_domain,
lifecycle_state,
private_ip,
public_ip,
time_created
from
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_state
from
oci_core_vnic_attachment
where
lifecycle_state = 'DETACHED';
select
id,
display_name,
lifecycle_state
from
oci_core_vnic_attachment
where
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_primary
from
oci_core_vnic_attachment
where
is_primary;
select
id,
display_name,
is_primary
from
oci_core_vnic_attachment
where
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_check
from
oci_core_vnic_attachment
where
skip_source_dest_check;
select
id,
display_name,
skip_source_dest_check
from
oci_core_vnic_attachment
where
skip_source_dest_check = 1;

Schema for oci_core_vnic_attachment

NameTypeOperatorsDescription
_ctxjsonbSteampipe context in JSON form, e.g. connection_name.
availability_domaintext=The availability domain of the instance.
compartment_idtext=The OCID of the compartment in Tenant in which the resource is located.
defined_tagsjsonbDefined 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_nametextA user-friendly name for the VNIC attachment.
freeform_tagsjsonbFree-form tags for resource. This tags can be applied by any user with permissions on the resource.
hostname_labeltextThe hostname for the VNIC's primary private IP.
idtext=The OCID of the VNIC attachment.
instance_idtext=The OCID of the instance.
is_primarybooleanWhether the VNIC is the primary VNIC (the VNIC that is automatically created and attached during instance launch).
lifecycle_statetextThe current state of the VNIC attachment. Possible values include: 'ATTACHING', 'ATTACHED', 'DETACHING', 'DETACHED'.
mac_addresstextThe MAC address of the VNIC.
nic_indexbigintThe physical network interface card (NIC) the VNIC uses.
nsg_idsjsonbA list of the OCIDs of the network security groups that the VNIC belongs to.
private_iptextThe private IP address of the primary `privateIp` object on the VNIC.
public_iptextThe public IP address of the VNIC, if one is assigned.
regiontextThe OCI region in which the resource is located.
skip_source_dest_checkbooleanWhether the source/destination check is disabled on the VNIC. Defaults to `false`, which means the check is performed.
subnet_idtextThe OCID of the subnet to create the VNIC in.
tagsjsonbA map of tags for the resource.
tenant_idtextThe OCID of the Tenant in which the resource is located.
tenant_nametextThe name of the Tenant in which the resource is located.
time_createdtimestamp with time zoneThe date and time the VNIC attachment was created.
titletextTitle of the resource.
vlan_idtextThe OCID of the VLAN to create the VNIC in.
vlan_tagbigintThe OCID of the VNIC.
vnic_idtextThe OCID of the VNIC.
vnic_nametextA 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