Table: oci_core_vcn - Query OCI Core Virtual Cloud Networks using SQL
A Virtual Cloud Network (VCN) is a customizable, private network in OCI. It closely resembles a traditional network, with firewall rules and specific types of communication gateways that you can choose to use. A VCN resides in a single OCI region and covers a single, contiguous CIDR block of your choice.
Table Usage Guide
The oci_core_vcn
table provides insights into Virtual Cloud Networks within Oracle Cloud Infrastructure (OCI). As a network administrator, you can explore network-specific details through this table, including the state of the VCN, its CIDR block, and associated DNS label. Utilize it to uncover information about your VCNs, such as their default security list, route table, and whether they are using DNS resolution.
Examples
Basic info
Explore which Virtual Cloud Networks (VCNs) are active and the associated metadata for each. This can be useful in gaining insights into your network's configuration and identifying any potential issues or areas for optimization.
select display_name, id, lifecycle_state, cidr_block, freeform_tagsfrom oci_core_vcn;
select display_name, id, lifecycle_state, cidr_block, freeform_tagsfrom oci_core_vcn;
List unavailable virtual cloud networks
Explore which virtual cloud networks are currently unavailable. This can be useful in identifying potential issues with network connectivity or resource allocation.
select display_name, id, lifecycle_statefrom oci_core_vcnwhere lifecycle_state <> 'AVAILABLE';
select display_name, id, lifecycle_statefrom oci_core_vcnwhere lifecycle_state <> 'AVAILABLE';
Query examples
Control examples
- CIS v1.1.0 > 2 Networking > 2.5 Ensure the default security list of every VCN restricts all traffic except ICMP
- CIS v1.2.0 > 2 Networking > 2.5 Ensure the default security list of every VCN restricts all traffic except ICMP
- CIS v2.0.0 > 2 Networking > 2.5 Ensure the default security list of every VCN restricts all traffic except ICMP
Schema for oci_core_vcn
Name | Type | Operators | Description |
---|---|---|---|
_ctx | jsonb | Steampipe context in JSON form. | |
cidr_block | cidr | The first CIDR IP address from cidrBlocks. | |
cidr_blocks | jsonb | The list of IPv4 CIDR blocks the VCN will use. | |
compartment_id | text | = | The OCID of the compartment in Tenant in which the resource is located. |
default_dhcp_options_id | text | The OCID for the VCN's default set of DHCP options. | |
default_route_table_id | text | The OCID of the instance. | |
default_security_list_id | text | The OCID for the VCN's default security list. | |
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. Does not have to be unique, and it's changeable. |
dns_label | text | A DNS label for the VCN, used in conjunction with the VNIC's hostname and subnet's DNS label to form a fully qualified domain name (FQDN) for each VNIC within this subnet. | |
freeform_tags | jsonb | Free-form tags for resource. This tags can be applied by any user with permissions on the resource. | |
id | text | = | The VCN's Oracle ID (OCID). |
ipv6_cidr_block | cidr | For an IPv6-enabled VCN, this is the IPv6 CIDR block for the VCN's private IP address space. | |
ipv6_cidr_blocks | jsonb | For an IPv6-enabled VCN, this is the list of IPv6 CIDR blocks for the VCN's IP address space. The CIDRs are provided by Oracle and the sizes are always /56. | |
ipv6_public_cidr_block | text | For an IPv6-enabled VCN, this is the IPv6 CIDR block for the VCN's public IP address space. | |
lifecycle_state | text | = | The VCN's current state. |
region | text | The OCI region in which the resource is located. | |
sp_connection_name | text | =, !=, ~~, ~~*, !~~, !~~* | Steampipe connection name. |
sp_ctx | jsonb | Steampipe context in JSON form. | |
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 VCN was created. | |
title | text | Title of the resource. | |
vcn_domain_name | text | The VCN's domain name, which consists of the VCN's DNS label, and the oraclevcn.com domain. |
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_vcn