1. Packages
  2. Oracle Cloud Infrastructure
  3. API Docs
  4. Core
  5. Vlan
Oracle Cloud Infrastructure v2.31.0 published on Thursday, Apr 17, 2025 by Pulumi

oci.Core.Vlan

Explore with Pulumi AI

This resource provides the Vlan resource in Oracle Cloud Infrastructure Core service.

Creates a VLAN in the specified VCN and the specified compartment.

Example Usage

import * as pulumi from "@pulumi/pulumi";
import * as oci from "@pulumi/oci";

const testVlan = new oci.core.Vlan("test_vlan", {
    cidrBlock: vlanCidrBlock,
    compartmentId: compartmentId,
    vcnId: testVcn.id,
    availabilityDomain: vlanAvailabilityDomain,
    definedTags: {
        "Operations.CostCenter": "42",
    },
    displayName: vlanDisplayName,
    freeformTags: {
        Department: "Finance",
    },
    nsgIds: vlanNsgIds,
    routeTableId: testRouteTable.id,
    vlanTag: vlanVlanTag,
});
Copy
import pulumi
import pulumi_oci as oci

test_vlan = oci.core.Vlan("test_vlan",
    cidr_block=vlan_cidr_block,
    compartment_id=compartment_id,
    vcn_id=test_vcn["id"],
    availability_domain=vlan_availability_domain,
    defined_tags={
        "Operations.CostCenter": "42",
    },
    display_name=vlan_display_name,
    freeform_tags={
        "Department": "Finance",
    },
    nsg_ids=vlan_nsg_ids,
    route_table_id=test_route_table["id"],
    vlan_tag=vlan_vlan_tag)
Copy
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.NewVlan(ctx, "test_vlan", &core.VlanArgs{
			CidrBlock:          pulumi.Any(vlanCidrBlock),
			CompartmentId:      pulumi.Any(compartmentId),
			VcnId:              pulumi.Any(testVcn.Id),
			AvailabilityDomain: pulumi.Any(vlanAvailabilityDomain),
			DefinedTags: pulumi.StringMap{
				"Operations.CostCenter": pulumi.String("42"),
			},
			DisplayName: pulumi.Any(vlanDisplayName),
			FreeformTags: pulumi.StringMap{
				"Department": pulumi.String("Finance"),
			},
			NsgIds:       pulumi.Any(vlanNsgIds),
			RouteTableId: pulumi.Any(testRouteTable.Id),
			VlanTag:      pulumi.Any(vlanVlanTag),
		})
		if err != nil {
			return err
		}
		return nil
	})
}
Copy
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Oci = Pulumi.Oci;

return await Deployment.RunAsync(() => 
{
    var testVlan = new Oci.Core.Vlan("test_vlan", new()
    {
        CidrBlock = vlanCidrBlock,
        CompartmentId = compartmentId,
        VcnId = testVcn.Id,
        AvailabilityDomain = vlanAvailabilityDomain,
        DefinedTags = 
        {
            { "Operations.CostCenter", "42" },
        },
        DisplayName = vlanDisplayName,
        FreeformTags = 
        {
            { "Department", "Finance" },
        },
        NsgIds = vlanNsgIds,
        RouteTableId = testRouteTable.Id,
        VlanTag = vlanVlanTag,
    });

});
Copy
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.oci.Core.Vlan;
import com.pulumi.oci.Core.VlanArgs;
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) {
        var testVlan = new Vlan("testVlan", VlanArgs.builder()
            .cidrBlock(vlanCidrBlock)
            .compartmentId(compartmentId)
            .vcnId(testVcn.id())
            .availabilityDomain(vlanAvailabilityDomain)
            .definedTags(Map.of("Operations.CostCenter", "42"))
            .displayName(vlanDisplayName)
            .freeformTags(Map.of("Department", "Finance"))
            .nsgIds(vlanNsgIds)
            .routeTableId(testRouteTable.id())
            .vlanTag(vlanVlanTag)
            .build());

    }
}
Copy
resources:
  testVlan:
    type: oci:Core:Vlan
    name: test_vlan
    properties:
      cidrBlock: ${vlanCidrBlock}
      compartmentId: ${compartmentId}
      vcnId: ${testVcn.id}
      availabilityDomain: ${vlanAvailabilityDomain}
      definedTags:
        Operations.CostCenter: '42'
      displayName: ${vlanDisplayName}
      freeformTags:
        Department: Finance
      nsgIds: ${vlanNsgIds}
      routeTableId: ${testRouteTable.id}
      vlanTag: ${vlanVlanTag}
Copy

Create Vlan Resource

Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

Constructor syntax

new Vlan(name: string, args: VlanArgs, opts?: CustomResourceOptions);
@overload
def Vlan(resource_name: str,
         args: VlanArgs,
         opts: Optional[ResourceOptions] = None)

@overload
def Vlan(resource_name: str,
         opts: Optional[ResourceOptions] = None,
         cidr_block: Optional[str] = None,
         compartment_id: Optional[str] = None,
         vcn_id: Optional[str] = None,
         availability_domain: Optional[str] = None,
         defined_tags: Optional[Mapping[str, str]] = None,
         display_name: Optional[str] = None,
         freeform_tags: Optional[Mapping[str, str]] = None,
         nsg_ids: Optional[Sequence[str]] = None,
         route_table_id: Optional[str] = None,
         vlan_tag: Optional[int] = None)
func NewVlan(ctx *Context, name string, args VlanArgs, opts ...ResourceOption) (*Vlan, error)
public Vlan(string name, VlanArgs args, CustomResourceOptions? opts = null)
public Vlan(String name, VlanArgs args)
public Vlan(String name, VlanArgs args, CustomResourceOptions options)
type: oci:Core:Vlan
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

Parameters

name This property is required. string
The unique name of the resource.
args This property is required. VlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name This property is required. str
The unique name of the resource.
args This property is required. VlanArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name This property is required. string
The unique name of the resource.
args This property is required. VlanArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name This property is required. string
The unique name of the resource.
args This property is required. VlanArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name This property is required. String
The unique name of the resource.
args This property is required. VlanArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

Constructor example

The following reference example uses placeholder values for all input properties.

var vlanResource = new Oci.Core.Vlan("vlanResource", new()
{
    CidrBlock = "string",
    CompartmentId = "string",
    VcnId = "string",
    AvailabilityDomain = "string",
    DefinedTags = 
    {
        { "string", "string" },
    },
    DisplayName = "string",
    FreeformTags = 
    {
        { "string", "string" },
    },
    NsgIds = new[]
    {
        "string",
    },
    RouteTableId = "string",
    VlanTag = 0,
});
Copy
example, err := Core.NewVlan(ctx, "vlanResource", &Core.VlanArgs{
	CidrBlock:          pulumi.String("string"),
	CompartmentId:      pulumi.String("string"),
	VcnId:              pulumi.String("string"),
	AvailabilityDomain: pulumi.String("string"),
	DefinedTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	DisplayName: pulumi.String("string"),
	FreeformTags: pulumi.StringMap{
		"string": pulumi.String("string"),
	},
	NsgIds: pulumi.StringArray{
		pulumi.String("string"),
	},
	RouteTableId: pulumi.String("string"),
	VlanTag:      pulumi.Int(0),
})
Copy
var vlanResource = new Vlan("vlanResource", VlanArgs.builder()
    .cidrBlock("string")
    .compartmentId("string")
    .vcnId("string")
    .availabilityDomain("string")
    .definedTags(Map.of("string", "string"))
    .displayName("string")
    .freeformTags(Map.of("string", "string"))
    .nsgIds("string")
    .routeTableId("string")
    .vlanTag(0)
    .build());
Copy
vlan_resource = oci.core.Vlan("vlanResource",
    cidr_block="string",
    compartment_id="string",
    vcn_id="string",
    availability_domain="string",
    defined_tags={
        "string": "string",
    },
    display_name="string",
    freeform_tags={
        "string": "string",
    },
    nsg_ids=["string"],
    route_table_id="string",
    vlan_tag=0)
Copy
const vlanResource = new oci.core.Vlan("vlanResource", {
    cidrBlock: "string",
    compartmentId: "string",
    vcnId: "string",
    availabilityDomain: "string",
    definedTags: {
        string: "string",
    },
    displayName: "string",
    freeformTags: {
        string: "string",
    },
    nsgIds: ["string"],
    routeTableId: "string",
    vlanTag: 0,
});
Copy
type: oci:Core:Vlan
properties:
    availabilityDomain: string
    cidrBlock: string
    compartmentId: string
    definedTags:
        string: string
    displayName: string
    freeformTags:
        string: string
    nsgIds:
        - string
    routeTableId: string
    vcnId: string
    vlanTag: 0
Copy

Vlan Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

In Python, inputs that are objects can be passed either as argument classes or as dictionary literals.

The Vlan resource accepts the following input properties:

CidrBlock This property is required. string

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

CompartmentId This property is required. string
(Updatable) The OCID of the compartment to contain the VLAN.
VcnId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the VCN to contain the VLAN.
AvailabilityDomain Changes to this property will trigger replacement. string

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

DefinedTags Dictionary<string, string>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
(Updatable) 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"}
NsgIds List<string>
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
RouteTableId string
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
VlanTag Changes to this property will trigger replacement. int

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

CidrBlock This property is required. string

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

CompartmentId This property is required. string
(Updatable) The OCID of the compartment to contain the VLAN.
VcnId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the VCN to contain the VLAN.
AvailabilityDomain Changes to this property will trigger replacement. string

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

DefinedTags map[string]string
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags map[string]string
(Updatable) 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"}
NsgIds []string
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
RouteTableId string
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
VlanTag Changes to this property will trigger replacement. int

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

cidrBlock This property is required. String

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartmentId This property is required. String
(Updatable) The OCID of the compartment to contain the VLAN.
vcnId
This property is required.
Changes to this property will trigger replacement.
String
The OCID of the VCN to contain the VLAN.
availabilityDomain Changes to this property will trigger replacement. String

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

definedTags Map<String,String>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String,String>
(Updatable) 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"}
nsgIds List<String>
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
routeTableId String
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
vlanTag Changes to this property will trigger replacement. Integer

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

cidrBlock This property is required. string

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartmentId This property is required. string
(Updatable) The OCID of the compartment to contain the VLAN.
vcnId
This property is required.
Changes to this property will trigger replacement.
string
The OCID of the VCN to contain the VLAN.
availabilityDomain Changes to this property will trigger replacement. string

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

definedTags {[key: string]: string}
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags {[key: string]: string}
(Updatable) 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"}
nsgIds string[]
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
routeTableId string
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
vlanTag Changes to this property will trigger replacement. number

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

cidr_block This property is required. str

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartment_id This property is required. str
(Updatable) The OCID of the compartment to contain the VLAN.
vcn_id
This property is required.
Changes to this property will trigger replacement.
str
The OCID of the VCN to contain the VLAN.
availability_domain Changes to this property will trigger replacement. str

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

defined_tags Mapping[str, str]
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeform_tags Mapping[str, str]
(Updatable) 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"}
nsg_ids Sequence[str]
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
route_table_id str
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
vlan_tag Changes to this property will trigger replacement. int

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

cidrBlock This property is required. String

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartmentId This property is required. String
(Updatable) The OCID of the compartment to contain the VLAN.
vcnId
This property is required.
Changes to this property will trigger replacement.
String
The OCID of the VCN to contain the VLAN.
availabilityDomain Changes to this property will trigger replacement. String

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

definedTags Map<String>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String>
(Updatable) 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"}
nsgIds List<String>
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
routeTableId String
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
vlanTag Changes to this property will trigger replacement. Number

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Outputs

All input properties are implicitly available as output properties. Additionally, the Vlan resource produces the following output properties:

Id string
The provider-assigned unique ID for this managed resource.
State string
The VLAN's current state.
TimeCreated string
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
Id string
The provider-assigned unique ID for this managed resource.
State string
The VLAN's current state.
TimeCreated string
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id String
The provider-assigned unique ID for this managed resource.
state String
The VLAN's current state.
timeCreated String
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id string
The provider-assigned unique ID for this managed resource.
state string
The VLAN's current state.
timeCreated string
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id str
The provider-assigned unique ID for this managed resource.
state str
The VLAN's current state.
time_created str
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
id String
The provider-assigned unique ID for this managed resource.
state String
The VLAN's current state.
timeCreated String
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z

Look up Existing Vlan Resource

Get an existing Vlan resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: VlanState, opts?: CustomResourceOptions): Vlan
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        availability_domain: Optional[str] = None,
        cidr_block: Optional[str] = None,
        compartment_id: Optional[str] = None,
        defined_tags: Optional[Mapping[str, str]] = None,
        display_name: Optional[str] = None,
        freeform_tags: Optional[Mapping[str, str]] = None,
        nsg_ids: Optional[Sequence[str]] = None,
        route_table_id: Optional[str] = None,
        state: Optional[str] = None,
        time_created: Optional[str] = None,
        vcn_id: Optional[str] = None,
        vlan_tag: Optional[int] = None) -> Vlan
func GetVlan(ctx *Context, name string, id IDInput, state *VlanState, opts ...ResourceOption) (*Vlan, error)
public static Vlan Get(string name, Input<string> id, VlanState? state, CustomResourceOptions? opts = null)
public static Vlan get(String name, Output<String> id, VlanState state, CustomResourceOptions options)
resources:  _:    type: oci:Core:Vlan    get:      id: ${id}
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name This property is required.
The unique name of the resulting resource.
id This property is required.
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AvailabilityDomain Changes to this property will trigger replacement. string

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

CidrBlock string

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

CompartmentId string
(Updatable) The OCID of the compartment to contain the VLAN.
DefinedTags Dictionary<string, string>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags Dictionary<string, string>
(Updatable) 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"}
NsgIds List<string>
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
RouteTableId string
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
State string
The VLAN's current state.
TimeCreated string
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VcnId Changes to this property will trigger replacement. string
The OCID of the VCN to contain the VLAN.
VlanTag Changes to this property will trigger replacement. int

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

AvailabilityDomain Changes to this property will trigger replacement. string

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

CidrBlock string

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

CompartmentId string
(Updatable) The OCID of the compartment to contain the VLAN.
DefinedTags map[string]string
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
FreeformTags map[string]string
(Updatable) 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"}
NsgIds []string
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
RouteTableId string
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
State string
The VLAN's current state.
TimeCreated string
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
VcnId Changes to this property will trigger replacement. string
The OCID of the VCN to contain the VLAN.
VlanTag Changes to this property will trigger replacement. int

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

availabilityDomain Changes to this property will trigger replacement. String

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

cidrBlock String

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartmentId String
(Updatable) The OCID of the compartment to contain the VLAN.
definedTags Map<String,String>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String,String>
(Updatable) 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"}
nsgIds List<String>
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
routeTableId String
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
state String
The VLAN's current state.
timeCreated String
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId Changes to this property will trigger replacement. String
The OCID of the VCN to contain the VLAN.
vlanTag Changes to this property will trigger replacement. Integer

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

availabilityDomain Changes to this property will trigger replacement. string

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

cidrBlock string

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartmentId string
(Updatable) The OCID of the compartment to contain the VLAN.
definedTags {[key: string]: string}
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags {[key: string]: string}
(Updatable) 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"}
nsgIds string[]
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
routeTableId string
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
state string
The VLAN's current state.
timeCreated string
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId Changes to this property will trigger replacement. string
The OCID of the VCN to contain the VLAN.
vlanTag Changes to this property will trigger replacement. number

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

availability_domain Changes to this property will trigger replacement. str

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

cidr_block str

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartment_id str
(Updatable) The OCID of the compartment to contain the VLAN.
defined_tags Mapping[str, str]
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeform_tags Mapping[str, str]
(Updatable) 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"}
nsg_ids Sequence[str]
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
route_table_id str
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
state str
The VLAN's current state.
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 Changes to this property will trigger replacement. str
The OCID of the VCN to contain the VLAN.
vlan_tag Changes to this property will trigger replacement. int

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

availabilityDomain Changes to this property will trigger replacement. String

Controls whether the VLAN is regional or specific to an availability domain. A regional VLAN has the flexibility to implement failover across availability domains. Previously, all VLANs were AD-specific.

To create a regional VLAN, omit this attribute. Resources created subsequently in this VLAN (such as a Compute instance) can be created in any availability domain in the region.

To create an AD-specific VLAN, use this attribute to specify the availability domain. Resources created in this VLAN must be in that availability domain.

Example: Uocm:PHX-AD-1

cidrBlock String

(Updatable) The range of IPv4 addresses that will be used for layer 3 communication with hosts outside the VLAN. The CIDR must maintain the following rules -

a. The CIDR block is valid and correctly formatted. b. The new range is within one of the parent VCN ranges.

Example: 192.0.2.0/24

compartmentId String
(Updatable) The OCID of the compartment to contain the VLAN.
definedTags Map<String>
(Updatable) 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
(Updatable) A user-friendly name. Does not have to be unique, and it's changeable. Avoid entering confidential information.
freeformTags Map<String>
(Updatable) 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"}
nsgIds List<String>
(Updatable) A list of the OCIDs of the network security groups (NSGs) to add all VNICs in the VLAN to. For more information about NSGs, see NetworkSecurityGroup.
routeTableId String
(Updatable) The OCID of the route table the VLAN will use. If you don't provide a value, the VLAN uses the VCN's default route table.
state String
The VLAN's current state.
timeCreated String
The date and time the VLAN was created, in the format defined by RFC3339. Example: 2016-08-25T21:10:29.600Z
vcnId Changes to this property will trigger replacement. String
The OCID of the VCN to contain the VLAN.
vlanTag Changes to this property will trigger replacement. Number

The IEEE 802.1Q VLAN tag for this VLAN. The value must be unique across all VLANs in the VCN. If you don't provide a value, Oracle assigns one. You cannot change the value later. VLAN tag 0 is reserved for use by Oracle.

** IMPORTANT ** Any change to a property that does not support update will force the destruction and recreation of the resource with the new property values

Import

Vlans can be imported using the id, e.g.

$ pulumi import oci:Core/vlan:Vlan test_vlan "id"
Copy

To learn more about importing existing cloud resources, see Importing resources.

Package Details

Repository
oci pulumi/pulumi-oci
License
Apache-2.0
Notes
This Pulumi package is based on the oci Terraform Provider.