» Data Source: oci_core_vcns

Other supported legacy names/aliases: * oci_core_virtual_network

This data source provides the list of Vcns in Oracle Cloud Infrastructure Core service.

Lists the virtual cloud networks (VCNs) in the specified compartment.

» Example Usage

data "oci_core_vcns" "test_vcns" {
    #Required
    compartment_id = "${var.compartment_id}"

    #Optional
    display_name = "${var.vcn_display_name}"
    state = "${var.vcn_state}"
}

» Argument Reference

The following arguments are supported:

  • compartment_id - (Required) The OCID of the compartment.
  • display_name - (Optional) A filter to return only resources that match the given display name exactly.
  • state - (Optional) A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.

» Attributes Reference

The following attributes are exported:

» Vcn Reference

The following attributes are exported:

  • cidr_block - The CIDR IP address block of the VCN. Example: 172.16.0.0/16
  • compartment_id - The OCID of the compartment containing the VCN.
  • default_dhcp_options_id - The OCID for the VCN's default set of DHCP options.
  • default_route_table_id - The OCID for the VCN's default route table.
  • default_security_list_id - The OCID for the VCN's default security list.
  • 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.
  • dns_label - 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 (for example, bminstance-1.subnet123.vcn1.oraclevcn.com). Must be an alphanumeric string that begins with a letter. The value cannot be changed.

    The absence of this parameter means the Internet and VCN Resolver will not work for this VCN.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: vcn1

  • 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"}

  • id - The VCN's Oracle ID (OCID).

  • state - The VCN's current state.

  • time_created - The date and time the VCN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

  • vcn_domain_name - The VCN's domain name, which consists of the VCN's DNS label, and the oraclevcn.com domain.

    For more information, see DNS in Your Virtual Cloud Network.

    Example: vcn1.oraclevcn.com