# 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
from . import _utilities, _tables
from . import outputs
from ._inputs import *

__all__ = ['NodeBalancer']


class NodeBalancer(pulumi.CustomResource):
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 client_conn_throttle: Optional[pulumi.Input[int]] = None,
                 label: Optional[pulumi.Input[str]] = None,
                 region: Optional[pulumi.Input[str]] = None,
                 tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                 __props__=None,
                 __name__=None,
                 __opts__=None):
        """
        Provides a Linode NodeBalancer resource.  This can be used to create, modify, and delete Linodes NodeBalancers in Linode's managed load balancer service.
        For more information, see [Getting Started with NodeBalancers](https://www.linode.com/docs/platform/nodebalancer/getting-started-with-nodebalancers/) and the [Linode APIv4 docs](https://developers.linode.com/api/v4#operation/createNodeBalancer).

        ## Example Usage

        The following example shows how one might use this resource to configure a NodeBalancer.

        ```python
        import pulumi
        import pulumi_linode as linode

        foobar = linode.NodeBalancer("foobar",
            client_conn_throttle=20,
            label="mynodebalancer",
            region="us-east",
            tags=["foobar"])
        ```
        ## Attributes

        This resource exports the following attributes:

        * `hostname` - This NodeBalancer's hostname, ending with .nodebalancer.linode.com

        * `ipv4` - The Public IPv4 Address of this NodeBalancer

        * `ipv6` - The Public IPv6 Address of this NodeBalancer

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] client_conn_throttle: Throttle connections per second (0-20). Set to 0 (default) to disable throttling.
        :param pulumi.Input[str] label: The label of the Linode NodeBalancer
        :param pulumi.Input[str] region: The region where this NodeBalancer will be deployed.  Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc.  *Changing `region` forces the creation of a new Linode NodeBalancer.*.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of tags applied to this object. Tags are for organizational purposes only.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        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__ = dict()

            __props__['client_conn_throttle'] = client_conn_throttle
            __props__['label'] = label
            if region is None:
                raise TypeError("Missing required property 'region'")
            __props__['region'] = region
            __props__['tags'] = tags
            __props__['created'] = None
            __props__['hostname'] = None
            __props__['ipv4'] = None
            __props__['ipv6'] = None
            __props__['transfer'] = None
            __props__['updated'] = None
        super(NodeBalancer, __self__).__init__(
            'linode:index/nodeBalancer:NodeBalancer',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            client_conn_throttle: Optional[pulumi.Input[int]] = None,
            created: Optional[pulumi.Input[str]] = None,
            hostname: Optional[pulumi.Input[str]] = None,
            ipv4: Optional[pulumi.Input[str]] = None,
            ipv6: Optional[pulumi.Input[str]] = None,
            label: Optional[pulumi.Input[str]] = None,
            region: Optional[pulumi.Input[str]] = None,
            tags: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
            transfer: Optional[pulumi.Input[pulumi.InputType['NodeBalancerTransferArgs']]] = None,
            updated: Optional[pulumi.Input[str]] = None) -> 'NodeBalancer':
        """
        Get an existing NodeBalancer 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[int] client_conn_throttle: Throttle connections per second (0-20). Set to 0 (default) to disable throttling.
        :param pulumi.Input[str] hostname: This NodeBalancer's hostname, ending with .nodebalancer.linode.com
        :param pulumi.Input[str] ipv4: The Public IPv4 Address of this NodeBalancer
        :param pulumi.Input[str] ipv6: The Public IPv6 Address of this NodeBalancer
        :param pulumi.Input[str] label: The label of the Linode NodeBalancer
        :param pulumi.Input[str] region: The region where this NodeBalancer will be deployed.  Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc.  *Changing `region` forces the creation of a new Linode NodeBalancer.*.
        :param pulumi.Input[Sequence[pulumi.Input[str]]] tags: A list of tags applied to this object. Tags are for organizational purposes only.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["client_conn_throttle"] = client_conn_throttle
        __props__["created"] = created
        __props__["hostname"] = hostname
        __props__["ipv4"] = ipv4
        __props__["ipv6"] = ipv6
        __props__["label"] = label
        __props__["region"] = region
        __props__["tags"] = tags
        __props__["transfer"] = transfer
        __props__["updated"] = updated
        return NodeBalancer(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="clientConnThrottle")
    def client_conn_throttle(self) -> pulumi.Output[Optional[int]]:
        """
        Throttle connections per second (0-20). Set to 0 (default) to disable throttling.
        """
        return pulumi.get(self, "client_conn_throttle")

    @property
    @pulumi.getter
    def created(self) -> pulumi.Output[str]:
        return pulumi.get(self, "created")

    @property
    @pulumi.getter
    def hostname(self) -> pulumi.Output[str]:
        """
        This NodeBalancer's hostname, ending with .nodebalancer.linode.com
        """
        return pulumi.get(self, "hostname")

    @property
    @pulumi.getter
    def ipv4(self) -> pulumi.Output[str]:
        """
        The Public IPv4 Address of this NodeBalancer
        """
        return pulumi.get(self, "ipv4")

    @property
    @pulumi.getter
    def ipv6(self) -> pulumi.Output[str]:
        """
        The Public IPv6 Address of this NodeBalancer
        """
        return pulumi.get(self, "ipv6")

    @property
    @pulumi.getter
    def label(self) -> pulumi.Output[Optional[str]]:
        """
        The label of the Linode NodeBalancer
        """
        return pulumi.get(self, "label")

    @property
    @pulumi.getter
    def region(self) -> pulumi.Output[str]:
        """
        The region where this NodeBalancer will be deployed.  Examples are `"us-east"`, `"us-west"`, `"ap-south"`, etc.  *Changing `region` forces the creation of a new Linode NodeBalancer.*.
        """
        return pulumi.get(self, "region")

    @property
    @pulumi.getter
    def tags(self) -> pulumi.Output[Optional[Sequence[str]]]:
        """
        A list of tags applied to this object. Tags are for organizational purposes only.
        """
        return pulumi.get(self, "tags")

    @property
    @pulumi.getter
    def transfer(self) -> pulumi.Output['outputs.NodeBalancerTransfer']:
        return pulumi.get(self, "transfer")

    @property
    @pulumi.getter
    def updated(self) -> pulumi.Output[str]:
        return pulumi.get(self, "updated")

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop

