1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. getVlans
Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi

oci.Core.getVlans

Explore with Pulumi AI

oci logo
Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi

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

    Lists the VLANs in the specified VCN and the specified compartment.

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as oci from "@pulumi/oci";
    
    const testVlans = oci.Core.getVlans({
        compartmentId: _var.compartment_id,
        displayName: _var.vlan_display_name,
        state: _var.vlan_state,
        vcnId: oci_core_vcn.test_vcn.id,
    });
    
    import pulumi
    import pulumi_oci as oci
    
    test_vlans = oci.Core.get_vlans(compartment_id=var["compartment_id"],
        display_name=var["vlan_display_name"],
        state=var["vlan_state"],
        vcn_id=oci_core_vcn["test_vcn"]["id"])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-oci/sdk/go/oci/Core"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := Core.GetVlans(ctx, &core.GetVlansArgs{
    			CompartmentId: _var.Compartment_id,
    			DisplayName:   pulumi.StringRef(_var.Vlan_display_name),
    			State:         pulumi.StringRef(_var.Vlan_state),
    			VcnId:         pulumi.StringRef(oci_core_vcn.Test_vcn.Id),
    		}, 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 testVlans = Oci.Core.GetVlans.Invoke(new()
        {
            CompartmentId = @var.Compartment_id,
            DisplayName = @var.Vlan_display_name,
            State = @var.Vlan_state,
            VcnId = oci_core_vcn.Test_vcn.Id,
        });
    
    });
    
    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.GetVlansArgs;
    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 testVlans = CoreFunctions.getVlans(GetVlansArgs.builder()
                .compartmentId(var_.compartment_id())
                .displayName(var_.vlan_display_name())
                .state(var_.vlan_state())
                .vcnId(oci_core_vcn.test_vcn().id())
                .build());
    
        }
    }
    
    variables:
      testVlans:
        fn::invoke:
          Function: oci:Core:getVlans
          Arguments:
            compartmentId: ${var.compartment_id}
            displayName: ${var.vlan_display_name}
            state: ${var.vlan_state}
            vcnId: ${oci_core_vcn.test_vcn.id}
    

    Using getVlans

    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 getVlans(args: GetVlansArgs, opts?: InvokeOptions): Promise<GetVlansResult>
    function getVlansOutput(args: GetVlansOutputArgs, opts?: InvokeOptions): Output<GetVlansResult>
    def get_vlans(compartment_id: Optional[str] = None,
                  display_name: Optional[str] = None,
                  filters: Optional[Sequence[_core.GetVlansFilter]] = None,
                  state: Optional[str] = None,
                  vcn_id: Optional[str] = None,
                  opts: Optional[InvokeOptions] = None) -> GetVlansResult
    def get_vlans_output(compartment_id: Optional[pulumi.Input[str]] = None,
                  display_name: Optional[pulumi.Input[str]] = None,
                  filters: Optional[pulumi.Input[Sequence[pulumi.Input[_core.GetVlansFilterArgs]]]] = None,
                  state: Optional[pulumi.Input[str]] = None,
                  vcn_id: Optional[pulumi.Input[str]] = None,
                  opts: Optional[InvokeOptions] = None) -> Output[GetVlansResult]
    func GetVlans(ctx *Context, args *GetVlansArgs, opts ...InvokeOption) (*GetVlansResult, error)
    func GetVlansOutput(ctx *Context, args *GetVlansOutputArgs, opts ...InvokeOption) GetVlansResultOutput

    > Note: This function is named GetVlans in the Go SDK.

    public static class GetVlans 
    {
        public static Task<GetVlansResult> InvokeAsync(GetVlansArgs args, InvokeOptions? opts = null)
        public static Output<GetVlansResult> Invoke(GetVlansInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetVlansResult> getVlans(GetVlansArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: oci:Core/getVlans:getVlans
      arguments:
        # arguments dictionary

    The following arguments are supported:

    CompartmentId string
    The OCID of the compartment.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    Filters List<GetVlansFilter>
    State string
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    VcnId string
    The OCID of the VCN.
    CompartmentId string
    The OCID of the compartment.
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    Filters []GetVlansFilter
    State string
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    VcnId string
    The OCID of the VCN.
    compartmentId String
    The OCID of the compartment.
    displayName String
    A filter to return only resources that match the given display name exactly.
    filters List<GetVlansFilter>
    state String
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    vcnId String
    The OCID of the VCN.
    compartmentId string
    The OCID of the compartment.
    displayName string
    A filter to return only resources that match the given display name exactly.
    filters GetVlansFilter[]
    state string
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    vcnId string
    The OCID of the VCN.
    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.GetVlansFilter]
    state str
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    vcn_id str
    The OCID of the VCN.
    compartmentId String
    The OCID of the compartment.
    displayName 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.
    vcnId String
    The OCID of the VCN.

    getVlans Result

    The following output properties are available:

    CompartmentId string
    The OCID of the compartment containing the VLAN.
    Id string
    The provider-assigned unique ID for this managed resource.
    Vlans List<GetVlansVlan>
    The list of vlans.
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    Filters List<GetVlansFilter>
    State string
    The VLAN's current state.
    VcnId string
    The OCID of the VCN the VLAN is in.
    CompartmentId string
    The OCID of the compartment containing the VLAN.
    Id string
    The provider-assigned unique ID for this managed resource.
    Vlans []GetVlansVlan
    The list of vlans.
    DisplayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    Filters []GetVlansFilter
    State string
    The VLAN's current state.
    VcnId string
    The OCID of the VCN the VLAN is in.
    compartmentId String
    The OCID of the compartment containing the VLAN.
    id String
    The provider-assigned unique ID for this managed resource.
    vlans List<GetVlansVlan>
    The list of vlans.
    displayName String
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    filters List<GetVlansFilter>
    state String
    The VLAN's current state.
    vcnId String
    The OCID of the VCN the VLAN is in.
    compartmentId string
    The OCID of the compartment containing the VLAN.
    id string
    The provider-assigned unique ID for this managed resource.
    vlans GetVlansVlan[]
    The list of vlans.
    displayName string
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    filters GetVlansFilter[]
    state string
    The VLAN's current state.
    vcnId string
    The OCID of the VCN the VLAN is in.
    compartment_id str
    The OCID of the compartment containing the VLAN.
    id str
    The provider-assigned unique ID for this managed resource.
    vlans Sequence[core.GetVlansVlan]
    The list of vlans.
    display_name str
    A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
    filters Sequence[core.GetVlansFilter]
    state str
    The VLAN's current state.
    vcn_id str
    The OCID of the VCN the VLAN is in.
    compartmentId String
    The OCID of the compartment containing the VLAN.
    id String
    The provider-assigned unique ID for this managed resource.
    vlans List<Property Map>
    The list of vlans.
    displayName 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 VLAN's current state.
    vcnId String
    The OCID of the VCN the VLAN is in.

    Supporting Types

    GetVlansFilter

    Name string
    Values List<string>
    Regex bool
    Name string
    Values []string
    Regex bool
    name String
    values List<String>
    regex Boolean
    name string
    values string[]
    regex boolean
    name str
    values Sequence[str]
    regex bool
    name String
    values List<String>
    regex Boolean

    GetVlansVlan

    AvailabilityDomain string
    The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: Uocm:PHX-AD-1
    CidrBlock string
    The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: 192.168.1.0/24
    CompartmentId string
    The OCID of the compartment.
    DefinedTags Dictionary<string, object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    FreeformTags Dictionary<string, object>
    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 VLAN's Oracle ID (OCID).
    NsgIds List<string>
    A list of the OCIDs of the network security groups (NSGs) to use with this VLAN. All VNICs in the VLAN belong to these NSGs. For more information about NSGs, see NetworkSecurityGroup.
    RouteTableId string
    The OCID of the route table that the VLAN uses.
    State string
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    TimeCreated string
    The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VcnId string
    The OCID of the VCN.
    VlanTag int
    The IEEE 802.1Q VLAN tag of this VLAN. Example: 100
    AvailabilityDomain string
    The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: Uocm:PHX-AD-1
    CidrBlock string
    The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: 192.168.1.0/24
    CompartmentId string
    The OCID of the compartment.
    DefinedTags map[string]interface{}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    DisplayName string
    A filter to return only resources that match the given display name exactly.
    FreeformTags map[string]interface{}
    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 VLAN's Oracle ID (OCID).
    NsgIds []string
    A list of the OCIDs of the network security groups (NSGs) to use with this VLAN. All VNICs in the VLAN belong to these NSGs. For more information about NSGs, see NetworkSecurityGroup.
    RouteTableId string
    The OCID of the route table that the VLAN uses.
    State string
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    TimeCreated string
    The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    VcnId string
    The OCID of the VCN.
    VlanTag int
    The IEEE 802.1Q VLAN tag of this VLAN. Example: 100
    availabilityDomain String
    The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: Uocm:PHX-AD-1
    cidrBlock String
    The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: 192.168.1.0/24
    compartmentId String
    The OCID of the compartment.
    definedTags Map<String,Object>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A filter to return only resources that match the given display name exactly.
    freeformTags Map<String,Object>
    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 VLAN's Oracle ID (OCID).
    nsgIds List<String>
    A list of the OCIDs of the network security groups (NSGs) to use with this VLAN. All VNICs in the VLAN belong to these NSGs. For more information about NSGs, see NetworkSecurityGroup.
    routeTableId String
    The OCID of the route table that the VLAN uses.
    state String
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    timeCreated String
    The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcnId String
    The OCID of the VCN.
    vlanTag Integer
    The IEEE 802.1Q VLAN tag of this VLAN. Example: 100
    availabilityDomain string
    The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: Uocm:PHX-AD-1
    cidrBlock string
    The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: 192.168.1.0/24
    compartmentId string
    The OCID of the compartment.
    definedTags {[key: string]: any}
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName string
    A filter to return only resources that match the given display name exactly.
    freeformTags {[key: string]: any}
    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 VLAN's Oracle ID (OCID).
    nsgIds string[]
    A list of the OCIDs of the network security groups (NSGs) to use with this VLAN. All VNICs in the VLAN belong to these NSGs. For more information about NSGs, see NetworkSecurityGroup.
    routeTableId string
    The OCID of the route table that the VLAN uses.
    state string
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    timeCreated string
    The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcnId string
    The OCID of the VCN.
    vlanTag number
    The IEEE 802.1Q VLAN tag of this VLAN. Example: 100
    availability_domain str
    The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: Uocm:PHX-AD-1
    cidr_block str
    The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: 192.168.1.0/24
    compartment_id str
    The OCID of the compartment.
    defined_tags Mapping[str, Any]
    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.
    freeform_tags Mapping[str, Any]
    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 VLAN's Oracle ID (OCID).
    nsg_ids Sequence[str]
    A list of the OCIDs of the network security groups (NSGs) to use with this VLAN. All VNICs in the VLAN belong to these NSGs. For more information about NSGs, see NetworkSecurityGroup.
    route_table_id str
    The OCID of the route table that the VLAN uses.
    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 VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcn_id str
    The OCID of the VCN.
    vlan_tag int
    The IEEE 802.1Q VLAN tag of this VLAN. Example: 100
    availabilityDomain String
    The VLAN's availability domain. This attribute will be null if this is a regional VLAN rather than an AD-specific VLAN. Example: Uocm:PHX-AD-1
    cidrBlock String
    The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. Example: 192.168.1.0/24
    compartmentId String
    The OCID of the compartment.
    definedTags Map<Any>
    Defined tags for this resource. Each key is predefined and scoped to a namespace. For more information, see Resource Tags. Example: {"Operations.CostCenter": "42"}
    displayName String
    A filter to return only resources that match the given display name exactly.
    freeformTags Map<Any>
    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 VLAN's Oracle ID (OCID).
    nsgIds List<String>
    A list of the OCIDs of the network security groups (NSGs) to use with this VLAN. All VNICs in the VLAN belong to these NSGs. For more information about NSGs, see NetworkSecurityGroup.
    routeTableId String
    The OCID of the route table that the VLAN uses.
    state String
    A filter to only return resources that match the given lifecycle state. The state value is case-insensitive.
    timeCreated String
    The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
    vcnId String
    The OCID of the VCN.
    vlanTag Number
    The IEEE 802.1Q VLAN tag of this VLAN. Example: 100

    Package Details

    Repository
    oci pulumi/pulumi-oci
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the oci Terraform Provider.
    oci logo
    Oracle Cloud Infrastructure v1.31.0 published on Wednesday, Apr 10, 2024 by Pulumi