Oracle Cloud Infrastructure v2.11.0 published on Thursday, Sep 19, 2024 by Pulumi
oci.Core.getVcns
Explore with Pulumi AI
This data source provides the list of Vcns in Oracle Cloud Infrastructure Core service.
Lists the virtual cloud networks (VCNs) in the specified compartment.
Supported Aliases
oci.Core.getVirtualNetworks
Example Usage
import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";
const testVcns = oci.Core.getVcns({
compartmentId: compartmentId,
displayName: vcnDisplayName,
state: vcnState,
});
import pulumi
import pulumi_oci as oci
test_vcns = oci.Core.get_vcns(compartment_id=compartment_id,
display_name=vcn_display_name,
state=vcn_state)
package main
import (
"github.com/pulumi/pulumi-oci/sdk/v2/go/oci/Core"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := Core.GetVcns(ctx, &core.GetVcnsArgs{
CompartmentId: compartmentId,
DisplayName: pulumi.StringRef(vcnDisplayName),
State: pulumi.StringRef(vcnState),
}, nil)
if err != nil {
return err
}
return nil
})
}
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;
return await Deployment.RunAsync(() =>
{
var testVcns = Oci.Core.GetVcns.Invoke(new()
{
CompartmentId = compartmentId,
DisplayName = vcnDisplayName,
State = vcnState,
});
});
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.CoreFunctions;
import com.pulumi.oci.Core.inputs.GetVcnsArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;
public class App {
public static void main(String[] args) {
Pulumi.run(App::stack);
}
public static void stack(Context ctx) {
final var testVcns = CoreFunctions.getVcns(GetVcnsArgs.builder()
.compartmentId(compartmentId)
.displayName(vcnDisplayName)
.state(vcnState)
.build());
}
}
variables:
testVcns:
fn::invoke:
Function: oci:Core:getVcns
Arguments:
compartmentId: ${compartmentId}
displayName: ${vcnDisplayName}
state: ${vcnState}
Using getVcns
Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.
function getVcns(args: GetVcnsArgs, opts?: InvokeOptions): Promise<GetVcnsResult>
function getVcnsOutput(args: GetVcnsOutputArgs, opts?: InvokeOptions): Output<GetVcnsResult>
def get_vcns(compartment_id: Optional[str] = None,
display_name: Optional[str] = None,
filters: Optional[Sequence[_core.GetVcnsFilter]] = None,
state: Optional[str] = None,
opts: Optional[InvokeOptions] = None) -> GetVcnsResult
def get_vcns_output(compartment_id: Optional[pulumi.Input[str]] = None,
display_name: Optional[pulumi.Input[str]] = None,
filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetVcnsFilterArgs]]]] = None,
state: Optional[pulumi.Input[str]] = None,
opts: Optional[InvokeOptions] = None) -> Output[GetVcnsResult]
func GetVcns(ctx *Context, args *GetVcnsArgs, opts ...InvokeOption) (*GetVcnsResult, error)
func GetVcnsOutput(ctx *Context, args *GetVcnsOutputArgs, opts ...InvokeOption) GetVcnsResultOutput
> Note: This function is named GetVcns
in the Go SDK.
public static class GetVcns
{
public static Task<GetVcnsResult> InvokeAsync(GetVcnsArgs args, InvokeOptions? opts = null)
public static Output<GetVcnsResult> Invoke(GetVcnsInvokeArgs args, InvokeOptions? opts = null)
}
public static CompletableFuture<GetVcnsResult> getVcns(GetVcnsArgs args, InvokeOptions options)
// Output-based functions aren't available in Java yet
fn::invoke:
function: oci:Core/getVcns:getVcns
arguments:
# arguments dictionary
The following arguments are supported:
- Compartment
Id string - The OCID of the compartment.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Filters
List<Get
Vcns Filter> - State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Compartment
Id string - The OCID of the compartment.
- Display
Name string - A filter to return only resources that match the given display name exactly.
- Filters
[]Get
Vcns Filter - State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartment
Id String - The OCID of the compartment.
- display
Name String - A filter to return only resources that match the given display name exactly.
- filters
List<Get
Vcns Filter> - state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartment
Id string - The OCID of the compartment.
- display
Name string - A filter to return only resources that match the given display name exactly.
- filters
Get
Vcns Filter[] - state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartment_
id str - The OCID of the compartment.
- display_
name str - A filter to return only resources that match the given display name exactly.
- filters
Sequence[core.
Get Vcns Filter] - state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- compartment
Id String - The OCID of the compartment.
- display
Name String - A filter to return only resources that match the given display name exactly.
- filters List<Property Map>
- state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
getVcns Result
The following output properties are available:
- Compartment
Id string - The OCID of the compartment containing the VCN.
- Id string
- The provider-assigned unique ID for this managed resource.
- Virtual
Networks List<GetVcns Virtual Network> - The list of virtual_networks.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
List<Get
Vcns Filter> - State string
- The VCN's current state.
- Compartment
Id string - The OCID of the compartment containing the VCN.
- Id string
- The provider-assigned unique ID for this managed resource.
- Virtual
Networks []GetVcns Virtual Network - The list of virtual_networks.
- Display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- Filters
[]Get
Vcns Filter - State string
- The VCN's current state.
- compartment
Id String - The OCID of the compartment containing the VCN.
- id String
- The provider-assigned unique ID for this managed resource.
- virtual
Networks List<GetVcns Virtual Network> - The list of virtual_networks.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
List<Get
Vcns Filter> - state String
- The VCN's current state.
- compartment
Id string - The OCID of the compartment containing the VCN.
- id string
- The provider-assigned unique ID for this managed resource.
- virtual
Networks GetVcns Virtual Network[] - The list of virtual_networks.
- display
Name string - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Get
Vcns Filter[] - state string
- The VCN's current state.
- compartment_
id str - The OCID of the compartment containing the VCN.
- id str
- The provider-assigned unique ID for this managed resource.
- virtual_
networks Sequence[core.Get Vcns Virtual Network] - The list of virtual_networks.
- display_
name str - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters
Sequence[core.
Get Vcns Filter] - state str
- The VCN's current state.
- compartment
Id String - The OCID of the compartment containing the VCN.
- id String
- The provider-assigned unique ID for this managed resource.
- virtual
Networks List<Property Map> - The list of virtual_networks.
- display
Name String - A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
- filters List<Property Map>
- state String
- The VCN's current state.
Supporting Types
GetVcnsFilter
GetVcnsVirtualNetwork
- Byoipv6cidr
Blocks List<string> - The list of BYOIPv6 prefixes required to create a VCN that uses BYOIPv6 ranges.
- Byoipv6cidr
Details List<GetVcns Virtual Network Byoipv6cidr Detail> - Cidr
Block string - Deprecated. The first CIDR IP address from cidr_blocks. Example:
172.16.0.0/16
- Cidr
Blocks List<string> - The list of IPv4 CIDR blocks the VCN will use.
- Compartment
Id string - The OCID of the compartment.
- Default
Dhcp stringOptions Id - The OCID for the VCN's default set of DHCP options.
- Default
Route stringTable Id - The OCID for the VCN's default route table.
- Default
Security stringList Id - The OCID for the VCN's default security list.
- Dictionary<string, string>
- 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 string - A filter to return only resources that match the given display name exactly.
- Dns
Label string - 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,
bminstance1.subnet123.vcn1.oraclevcn.com
). Must be an alphanumeric string that begins with a letter. The value cannot be changed. - Dictionary<string, string>
- 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 string
- The VCN's Oracle ID (OCID).
- Ipv6cidr
Blocks List<string> - For an IPv6-enabled VCN, this is the list of IPv6 prefixes for the VCN's IP address space. The prefixes are provided by Oracle and the sizes are always /56.
- Ipv6private
Cidr List<string>Blocks - For an IPv6-enabled VCN, this is the list of Private IPv6 prefixes for the VCN's IP address space.
- Is
Ipv6enabled bool - Is
Oracle boolGua Allocation Enabled - State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Time
Created string - The date and time the VCN was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Domain stringName - The VCN's domain name, which consists of the VCN's DNS label, and the
oraclevcn.com
domain.
- Byoipv6cidr
Blocks []string - The list of BYOIPv6 prefixes required to create a VCN that uses BYOIPv6 ranges.
- Byoipv6cidr
Details []GetVcns Virtual Network Byoipv6cidr Detail - Cidr
Block string - Deprecated. The first CIDR IP address from cidr_blocks. Example:
172.16.0.0/16
- Cidr
Blocks []string - The list of IPv4 CIDR blocks the VCN will use.
- Compartment
Id string - The OCID of the compartment.
- Default
Dhcp stringOptions Id - The OCID for the VCN's default set of DHCP options.
- Default
Route stringTable Id - The OCID for the VCN's default route table.
- Default
Security stringList Id - The OCID for the VCN's default security list.
- map[string]string
- 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 string - A filter to return only resources that match the given display name exactly.
- Dns
Label string - 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,
bminstance1.subnet123.vcn1.oraclevcn.com
). Must be an alphanumeric string that begins with a letter. The value cannot be changed. - map[string]string
- 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 string
- The VCN's Oracle ID (OCID).
- Ipv6cidr
Blocks []string - For an IPv6-enabled VCN, this is the list of IPv6 prefixes for the VCN's IP address space. The prefixes are provided by Oracle and the sizes are always /56.
- Ipv6private
Cidr []stringBlocks - For an IPv6-enabled VCN, this is the list of Private IPv6 prefixes for the VCN's IP address space.
- Is
Ipv6enabled bool - Is
Oracle boolGua Allocation Enabled - State string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- Time
Created string - The date and time the VCN was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- Vcn
Domain stringName - The VCN's domain name, which consists of the VCN's DNS label, and the
oraclevcn.com
domain.
- byoipv6cidr
Blocks List<String> - The list of BYOIPv6 prefixes required to create a VCN that uses BYOIPv6 ranges.
- byoipv6cidr
Details List<GetVcns Virtual Network Byoipv6cidr Detail> - cidr
Block String - Deprecated. The first CIDR IP address from cidr_blocks. Example:
172.16.0.0/16
- cidr
Blocks List<String> - The list of IPv4 CIDR blocks the VCN will use.
- compartment
Id String - The OCID of the compartment.
- default
Dhcp StringOptions Id - The OCID for the VCN's default set of DHCP options.
- default
Route StringTable Id - The OCID for the VCN's default route table.
- default
Security StringList Id - The OCID for the VCN's default security list.
- Map<String,String>
- 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 String - A filter to return only resources that match the given display name exactly.
- dns
Label String - 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,
bminstance1.subnet123.vcn1.oraclevcn.com
). Must be an alphanumeric string that begins with a letter. The value cannot be changed. - Map<String,String>
- 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 String
- The VCN's Oracle ID (OCID).
- ipv6cidr
Blocks List<String> - For an IPv6-enabled VCN, this is the list of IPv6 prefixes for the VCN's IP address space. The prefixes are provided by Oracle and the sizes are always /56.
- ipv6private
Cidr List<String>Blocks - For an IPv6-enabled VCN, this is the list of Private IPv6 prefixes for the VCN's IP address space.
- is
Ipv6enabled Boolean - is
Oracle BooleanGua Allocation Enabled - state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created String - The date and time the VCN was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Domain StringName - The VCN's domain name, which consists of the VCN's DNS label, and the
oraclevcn.com
domain.
- byoipv6cidr
Blocks string[] - The list of BYOIPv6 prefixes required to create a VCN that uses BYOIPv6 ranges.
- byoipv6cidr
Details GetVcns Virtual Network Byoipv6cidr Detail[] - cidr
Block string - Deprecated. The first CIDR IP address from cidr_blocks. Example:
172.16.0.0/16
- cidr
Blocks string[] - The list of IPv4 CIDR blocks the VCN will use.
- compartment
Id string - The OCID of the compartment.
- default
Dhcp stringOptions Id - The OCID for the VCN's default set of DHCP options.
- default
Route stringTable Id - The OCID for the VCN's default route table.
- default
Security stringList Id - The OCID for the VCN's default security list.
- {[key: string]: string}
- 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 string - A filter to return only resources that match the given display name exactly.
- dns
Label string - 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,
bminstance1.subnet123.vcn1.oraclevcn.com
). Must be an alphanumeric string that begins with a letter. The value cannot be changed. - {[key: string]: string}
- 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 string
- The VCN's Oracle ID (OCID).
- ipv6cidr
Blocks string[] - For an IPv6-enabled VCN, this is the list of IPv6 prefixes for the VCN's IP address space. The prefixes are provided by Oracle and the sizes are always /56.
- ipv6private
Cidr string[]Blocks - For an IPv6-enabled VCN, this is the list of Private IPv6 prefixes for the VCN's IP address space.
- is
Ipv6enabled boolean - is
Oracle booleanGua Allocation Enabled - state string
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created string - The date and time the VCN was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Domain stringName - The VCN's domain name, which consists of the VCN's DNS label, and the
oraclevcn.com
domain.
- byoipv6cidr_
blocks Sequence[str] - The list of BYOIPv6 prefixes required to create a VCN that uses BYOIPv6 ranges.
- byoipv6cidr_
details Sequence[core.Get Vcns Virtual Network Byoipv6cidr Detail] - cidr_
block str - Deprecated. The first CIDR IP address from cidr_blocks. Example:
172.16.0.0/16
- cidr_
blocks Sequence[str] - The list of IPv4 CIDR blocks the VCN will use.
- compartment_
id str - The OCID of the compartment.
- default_
dhcp_ stroptions_ id - The OCID for the VCN's default set of DHCP options.
- default_
route_ strtable_ id - The OCID for the VCN's default route table.
- default_
security_ strlist_ id - The OCID for the VCN's default security list.
- Mapping[str, str]
- 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 str - A filter to return only resources that match the given display name exactly.
- dns_
label str - 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,
bminstance1.subnet123.vcn1.oraclevcn.com
). Must be an alphanumeric string that begins with a letter. The value cannot be changed. - Mapping[str, str]
- 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 str
- The VCN's Oracle ID (OCID).
- ipv6cidr_
blocks Sequence[str] - For an IPv6-enabled VCN, this is the list of IPv6 prefixes for the VCN's IP address space. The prefixes are provided by Oracle and the sizes are always /56.
- ipv6private_
cidr_ Sequence[str]blocks - For an IPv6-enabled VCN, this is the list of Private IPv6 prefixes for the VCN's IP address space.
- is_
ipv6enabled bool - is_
oracle_ boolgua_ allocation_ enabled - state str
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time_
created str - The date and time the VCN was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn_
domain_ strname - The VCN's domain name, which consists of the VCN's DNS label, and the
oraclevcn.com
domain.
- byoipv6cidr
Blocks List<String> - The list of BYOIPv6 prefixes required to create a VCN that uses BYOIPv6 ranges.
- byoipv6cidr
Details List<Property Map> - cidr
Block String - Deprecated. The first CIDR IP address from cidr_blocks. Example:
172.16.0.0/16
- cidr
Blocks List<String> - The list of IPv4 CIDR blocks the VCN will use.
- compartment
Id String - The OCID of the compartment.
- default
Dhcp StringOptions Id - The OCID for the VCN's default set of DHCP options.
- default
Route StringTable Id - The OCID for the VCN's default route table.
- default
Security StringList Id - The OCID for the VCN's default security list.
- Map<String>
- 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 String - A filter to return only resources that match the given display name exactly.
- dns
Label String - 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,
bminstance1.subnet123.vcn1.oraclevcn.com
). Must be an alphanumeric string that begins with a letter. The value cannot be changed. - Map<String>
- 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 String
- The VCN's Oracle ID (OCID).
- ipv6cidr
Blocks List<String> - For an IPv6-enabled VCN, this is the list of IPv6 prefixes for the VCN's IP address space. The prefixes are provided by Oracle and the sizes are always /56.
- ipv6private
Cidr List<String>Blocks - For an IPv6-enabled VCN, this is the list of Private IPv6 prefixes for the VCN's IP address space.
- is
Ipv6enabled Boolean - is
Oracle BooleanGua Allocation Enabled - state String
- A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
- time
Created String - The date and time the VCN was created, in the format defined by RFC3339. Example:
2016-08-25T21:10:29.600Z
- vcn
Domain StringName - The VCN's domain name, which consists of the VCN's DNS label, and the
oraclevcn.com
domain.
GetVcnsVirtualNetworkByoipv6cidrDetail
- Byoipv6range
Id string - Ipv6cidr
Block string
- Byoipv6range
Id string - Ipv6cidr
Block string
- byoipv6range
Id String - ipv6cidr
Block String
- byoipv6range
Id string - ipv6cidr
Block string
- byoipv6range_
id str - ipv6cidr_
block str
- byoipv6range
Id String - ipv6cidr
Block String
Package Details
- Repository
- oci pulumi/pulumi-oci
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
oci
Terraform Provider.