# 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 copy
import warnings
import pulumi
import pulumi.runtime
from typing import Any, Mapping, Optional, Sequence, Union, overload
from .. import _utilities
from . import outputs

__all__ = [
    'GetLBOutboundRuleResult',
    'AwaitableGetLBOutboundRuleResult',
    'get_lb_outbound_rule',
    'get_lb_outbound_rule_output',
]

@pulumi.output_type
class GetLBOutboundRuleResult:
    """
    A collection of values returned by getLBOutboundRule.
    """
    def __init__(__self__, allocated_outbound_ports=None, backend_address_pool_id=None, frontend_ip_configurations=None, id=None, idle_timeout_in_minutes=None, loadbalancer_id=None, name=None, protocol=None, tcp_reset_enabled=None):
        if allocated_outbound_ports and not isinstance(allocated_outbound_ports, int):
            raise TypeError("Expected argument 'allocated_outbound_ports' to be a int")
        pulumi.set(__self__, "allocated_outbound_ports", allocated_outbound_ports)
        if backend_address_pool_id and not isinstance(backend_address_pool_id, str):
            raise TypeError("Expected argument 'backend_address_pool_id' to be a str")
        pulumi.set(__self__, "backend_address_pool_id", backend_address_pool_id)
        if frontend_ip_configurations and not isinstance(frontend_ip_configurations, list):
            raise TypeError("Expected argument 'frontend_ip_configurations' to be a list")
        pulumi.set(__self__, "frontend_ip_configurations", frontend_ip_configurations)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if idle_timeout_in_minutes and not isinstance(idle_timeout_in_minutes, int):
            raise TypeError("Expected argument 'idle_timeout_in_minutes' to be a int")
        pulumi.set(__self__, "idle_timeout_in_minutes", idle_timeout_in_minutes)
        if loadbalancer_id and not isinstance(loadbalancer_id, str):
            raise TypeError("Expected argument 'loadbalancer_id' to be a str")
        pulumi.set(__self__, "loadbalancer_id", loadbalancer_id)
        if name and not isinstance(name, str):
            raise TypeError("Expected argument 'name' to be a str")
        pulumi.set(__self__, "name", name)
        if protocol and not isinstance(protocol, str):
            raise TypeError("Expected argument 'protocol' to be a str")
        pulumi.set(__self__, "protocol", protocol)
        if tcp_reset_enabled and not isinstance(tcp_reset_enabled, bool):
            raise TypeError("Expected argument 'tcp_reset_enabled' to be a bool")
        pulumi.set(__self__, "tcp_reset_enabled", tcp_reset_enabled)

    @property
    @pulumi.getter(name="allocatedOutboundPorts")
    def allocated_outbound_ports(self) -> int:
        """
        The number of outbound ports used for NAT.
        """
        return pulumi.get(self, "allocated_outbound_ports")

    @property
    @pulumi.getter(name="backendAddressPoolId")
    def backend_address_pool_id(self) -> str:
        """
        The ID of the Backend Address Pool. Outbound traffic is randomly load balanced across IPs in the backend IPs.
        """
        return pulumi.get(self, "backend_address_pool_id")

    @property
    @pulumi.getter(name="frontendIpConfigurations")
    def frontend_ip_configurations(self) -> Sequence['outputs.GetLBOutboundRuleFrontendIpConfigurationResult']:
        """
        A `frontend_ip_configuration` block as defined below.
        """
        return pulumi.get(self, "frontend_ip_configurations")

    @property
    @pulumi.getter
    def id(self) -> str:
        """
        The provider-assigned unique ID for this managed resource.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="idleTimeoutInMinutes")
    def idle_timeout_in_minutes(self) -> int:
        """
        The timeout for the TCP idle connection.
        """
        return pulumi.get(self, "idle_timeout_in_minutes")

    @property
    @pulumi.getter(name="loadbalancerId")
    def loadbalancer_id(self) -> str:
        return pulumi.get(self, "loadbalancer_id")

    @property
    @pulumi.getter
    def name(self) -> str:
        """
        The name of the Frontend IP Configuration.
        """
        return pulumi.get(self, "name")

    @property
    @pulumi.getter
    def protocol(self) -> str:
        """
        The transport protocol for the external endpoint.
        """
        return pulumi.get(self, "protocol")

    @property
    @pulumi.getter(name="tcpResetEnabled")
    def tcp_reset_enabled(self) -> bool:
        """
        Is the bidirectional TCP Reset on TCP flow idle timeout or unexpected connection termination enabled? This value is useful when the protocol is set to TCP.
        """
        return pulumi.get(self, "tcp_reset_enabled")


class AwaitableGetLBOutboundRuleResult(GetLBOutboundRuleResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetLBOutboundRuleResult(
            allocated_outbound_ports=self.allocated_outbound_ports,
            backend_address_pool_id=self.backend_address_pool_id,
            frontend_ip_configurations=self.frontend_ip_configurations,
            id=self.id,
            idle_timeout_in_minutes=self.idle_timeout_in_minutes,
            loadbalancer_id=self.loadbalancer_id,
            name=self.name,
            protocol=self.protocol,
            tcp_reset_enabled=self.tcp_reset_enabled)


def get_lb_outbound_rule(loadbalancer_id: Optional[str] = None,
                         name: Optional[str] = None,
                         opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetLBOutboundRuleResult:
    """
    Use this data source to access information about an existing Load Balancer Outbound Rule.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.lb.get_lb_outbound_rule(name="existing_lb_outbound_rule",
        loadbalancer_id="existing_load_balancer_id")
    pulumi.export("id", example.id)
    ```


    :param str loadbalancer_id: The ID of the Load Balancer in which the Outbound Rule exists.
    :param str name: The name of this Load Balancer Outbound Rule.
    """
    __args__ = dict()
    __args__['loadbalancerId'] = loadbalancer_id
    __args__['name'] = name
    opts = pulumi.InvokeOptions.merge(_utilities.get_invoke_opts_defaults(), opts)
    __ret__ = pulumi.runtime.invoke('azure:lb/getLBOutboundRule:getLBOutboundRule', __args__, opts=opts, typ=GetLBOutboundRuleResult).value

    return AwaitableGetLBOutboundRuleResult(
        allocated_outbound_ports=__ret__.allocated_outbound_ports,
        backend_address_pool_id=__ret__.backend_address_pool_id,
        frontend_ip_configurations=__ret__.frontend_ip_configurations,
        id=__ret__.id,
        idle_timeout_in_minutes=__ret__.idle_timeout_in_minutes,
        loadbalancer_id=__ret__.loadbalancer_id,
        name=__ret__.name,
        protocol=__ret__.protocol,
        tcp_reset_enabled=__ret__.tcp_reset_enabled)


@_utilities.lift_output_func(get_lb_outbound_rule)
def get_lb_outbound_rule_output(loadbalancer_id: Optional[pulumi.Input[str]] = None,
                                name: Optional[pulumi.Input[str]] = None,
                                opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetLBOutboundRuleResult]:
    """
    Use this data source to access information about an existing Load Balancer Outbound Rule.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_azure as azure

    example = azure.lb.get_lb_outbound_rule(name="existing_lb_outbound_rule",
        loadbalancer_id="existing_load_balancer_id")
    pulumi.export("id", example.id)
    ```


    :param str loadbalancer_id: The ID of the Load Balancer in which the Outbound Rule exists.
    :param str name: The name of this Load Balancer Outbound Rule.
    """
    ...
