# coding=utf-8
# *** WARNING: this file was generated by the Pulumi Terraform Bridge (tfgen) Tool. ***
# *** Do not edit by hand unless you're certain you know what you are doing! ***

import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from . import _utilities
from . import outputs
from ._inputs import *

__all__ = ['VlanArgs', 'Vlan']

@pulumi.input_type
class VlanArgs:
    def __init__(__self__, *,
                 region: pulumi.Input[str],
                 cidr_block: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 linodes: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None):
        """
        The set of arguments for constructing a Vlan resource.
        :param pulumi.Input[str] region: The region of where the VLAN is deployed.
        :param pulumi.Input[str] cidr_block: The CIDR block for this VLAN.
        :param pulumi.Input[str] description: Description of the vlan for display purposes only.
        :param pulumi.Input[Sequence[pulumi.Input[int]]] linodes: A list of IDs of Linodes to attach to this VLAN.
        """
        pulumi.set(__self__, "region", region)
        if cidr_block is not None:
            pulumi.set(__self__, "cidr_block", cidr_block)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if linodes is not None:
            pulumi.set(__self__, "linodes", linodes)

    @property
    @pulumi.getter
    def region(self) -> pulumi.Input[str]:
        """
        The region of where the VLAN is deployed.
        """
        return pulumi.get(self, "region")

    @region.setter
    def region(self, value: pulumi.Input[str]):
        pulumi.set(self, "region", value)

    @property
    @pulumi.getter(name="cidrBlock")
    def cidr_block(self) -> Optional[pulumi.Input[str]]:
        """
        The CIDR block for this VLAN.
        """
        return pulumi.get(self, "cidr_block")

    @cidr_block.setter
    def cidr_block(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "cidr_block", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        Description of the vlan for display purposes only.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter
    def linodes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
        """
        A list of IDs of Linodes to attach to this VLAN.
        """
        return pulumi.get(self, "linodes")

    @linodes.setter
    def linodes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
        pulumi.set(self, "linodes", value)


@pulumi.input_type
class _VlanState:
    def __init__(__self__, *,
                 attached_linodes: Optional[pulumi.Input[Sequence[pulumi.Input['VlanAttachedLinodeArgs']]]] = None,
                 cidr_block: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 linodes: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
                 region: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering Vlan resources.
        :param pulumi.Input[Sequence[pulumi.Input['VlanAttachedLinodeArgs']]] attached_linodes: The Linodes attached to this vlan.
        :param pulumi.Input[str] cidr_block: The CIDR block for this VLAN.
        :param pulumi.Input[str] description: Description of the vlan for display purposes only.
        :param pulumi.Input[Sequence[pulumi.Input[int]]] linodes: A list of IDs of Linodes to attach to this VLAN.
        :param pulumi.Input[str] region: The region of where the VLAN is deployed.
        """
        if attached_linodes is not None:
            pulumi.set(__self__, "attached_linodes", attached_linodes)
        if cidr_block is not None:
            pulumi.set(__self__, "cidr_block", cidr_block)
        if description is not None:
            pulumi.set(__self__, "description", description)
        if linodes is not None:
            pulumi.set(__self__, "linodes", linodes)
        if region is not None:
            pulumi.set(__self__, "region", region)

    @property
    @pulumi.getter(name="attachedLinodes")
    def attached_linodes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input['VlanAttachedLinodeArgs']]]]:
        """
        The Linodes attached to this vlan.
        """
        return pulumi.get(self, "attached_linodes")

    @attached_linodes.setter
    def attached_linodes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input['VlanAttachedLinodeArgs']]]]):
        pulumi.set(self, "attached_linodes", value)

    @property
    @pulumi.getter(name="cidrBlock")
    def cidr_block(self) -> Optional[pulumi.Input[str]]:
        """
        The CIDR block for this VLAN.
        """
        return pulumi.get(self, "cidr_block")

    @cidr_block.setter
    def cidr_block(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "cidr_block", value)

    @property
    @pulumi.getter
    def description(self) -> Optional[pulumi.Input[str]]:
        """
        Description of the vlan for display purposes only.
        """
        return pulumi.get(self, "description")

    @description.setter
    def description(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "description", value)

    @property
    @pulumi.getter
    def linodes(self) -> Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]:
        """
        A list of IDs of Linodes to attach to this VLAN.
        """
        return pulumi.get(self, "linodes")

    @linodes.setter
    def linodes(self, value: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]]):
        pulumi.set(self, "linodes", value)

    @property
    @pulumi.getter
    def region(self) -> Optional[pulumi.Input[str]]:
        """
        The region of where the VLAN is deployed.
        """
        return pulumi.get(self, "region")

    @region.setter
    def region(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "region", value)


class Vlan(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cidr_block: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 linodes: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Create a Vlan resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[str] cidr_block: The CIDR block for this VLAN.
        :param pulumi.Input[str] description: Description of the vlan for display purposes only.
        :param pulumi.Input[Sequence[pulumi.Input[int]]] linodes: A list of IDs of Linodes to attach to this VLAN.
        :param pulumi.Input[str] region: The region of where the VLAN is deployed.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: VlanArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Create a Vlan resource with the given unique name, props, and options.
        :param str resource_name: The name of the resource.
        :param VlanArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(VlanArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 cidr_block: Optional[pulumi.Input[str]] = None,
                 description: Optional[pulumi.Input[str]] = None,
                 linodes: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        if opts is None:
            opts = pulumi.ResourceOptions()
        if not isinstance(opts, pulumi.ResourceOptions):
            raise TypeError('Expected resource options to be a ResourceOptions instance')
        if opts.version is None:
            opts.version = _utilities.get_version()
        if opts.id is None:
            if __props__ is not None:
                raise TypeError('__props__ is only valid when passed in combination with a valid opts.id to get an existing resource')
            __props__ = VlanArgs.__new__(VlanArgs)

            __props__.__dict__["cidr_block"] = cidr_block
            __props__.__dict__["description"] = description
            __props__.__dict__["linodes"] = linodes
            if region is None and not opts.urn:
                raise TypeError("Missing required property 'region'")
            __props__.__dict__["region"] = region
            __props__.__dict__["attached_linodes"] = None
        super(Vlan, __self__).__init__(
            'linode:index/vlan:Vlan',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            attached_linodes: Optional[pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VlanAttachedLinodeArgs']]]]] = None,
            cidr_block: Optional[pulumi.Input[str]] = None,
            description: Optional[pulumi.Input[str]] = None,
            linodes: Optional[pulumi.Input[Sequence[pulumi.Input[int]]]] = None,
            region: Optional[pulumi.Input[str]] = None) -> 'Vlan':
        """
        Get an existing Vlan resource's state with the given name, id, and optional extra
        properties used to qualify the lookup.

        :param str resource_name: The unique name of the resulting resource.
        :param pulumi.Input[str] id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[Sequence[pulumi.Input[pulumi.InputType['VlanAttachedLinodeArgs']]]] attached_linodes: The Linodes attached to this vlan.
        :param pulumi.Input[str] cidr_block: The CIDR block for this VLAN.
        :param pulumi.Input[str] description: Description of the vlan for display purposes only.
        :param pulumi.Input[Sequence[pulumi.Input[int]]] linodes: A list of IDs of Linodes to attach to this VLAN.
        :param pulumi.Input[str] region: The region of where the VLAN is deployed.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _VlanState.__new__(_VlanState)

        __props__.__dict__["attached_linodes"] = attached_linodes
        __props__.__dict__["cidr_block"] = cidr_block
        __props__.__dict__["description"] = description
        __props__.__dict__["linodes"] = linodes
        __props__.__dict__["region"] = region
        return Vlan(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="attachedLinodes")
    def attached_linodes(self) -> pulumi.Output[Sequence['outputs.VlanAttachedLinode']]:
        """
        The Linodes attached to this vlan.
        """
        return pulumi.get(self, "attached_linodes")

    @property
    @pulumi.getter(name="cidrBlock")
    def cidr_block(self) -> pulumi.Output[Optional[str]]:
        """
        The CIDR block for this VLAN.
        """
        return pulumi.get(self, "cidr_block")

    @property
    @pulumi.getter
    def description(self) -> pulumi.Output[Optional[str]]:
        """
        Description of the vlan for display purposes only.
        """
        return pulumi.get(self, "description")

    @property
    @pulumi.getter
    def linodes(self) -> pulumi.Output[Optional[Sequence[int]]]:
        """
        A list of IDs of Linodes to attach to this VLAN.
        """
        return pulumi.get(self, "linodes")

    @property
    @pulumi.getter
    def region(self) -> pulumi.Output[str]:
        """
        The region of where the VLAN is deployed.
        """
        return pulumi.get(self, "region")

