# 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

__all__ = [
    'GetFirewallResult',
    'AwaitableGetFirewallResult',
    'get_firewall',
]

@pulumi.output_type
class GetFirewallResult:
    """
    A collection of values returned by getFirewall.
    """
    def __init__(__self__, devices=None, disabled=None, id=None, inbound_policy=None, inbounds=None, label=None, linodes=None, outbound_policy=None, outbounds=None, status=None, tags=None):
        if devices and not isinstance(devices, list):
            raise TypeError("Expected argument 'devices' to be a list")
        pulumi.set(__self__, "devices", devices)
        if disabled and not isinstance(disabled, bool):
            raise TypeError("Expected argument 'disabled' to be a bool")
        pulumi.set(__self__, "disabled", disabled)
        if id and not isinstance(id, int):
            raise TypeError("Expected argument 'id' to be a int")
        pulumi.set(__self__, "id", id)
        if inbound_policy and not isinstance(inbound_policy, str):
            raise TypeError("Expected argument 'inbound_policy' to be a str")
        pulumi.set(__self__, "inbound_policy", inbound_policy)
        if inbounds and not isinstance(inbounds, list):
            raise TypeError("Expected argument 'inbounds' to be a list")
        pulumi.set(__self__, "inbounds", inbounds)
        if label and not isinstance(label, str):
            raise TypeError("Expected argument 'label' to be a str")
        pulumi.set(__self__, "label", label)
        if linodes and not isinstance(linodes, list):
            raise TypeError("Expected argument 'linodes' to be a list")
        pulumi.set(__self__, "linodes", linodes)
        if outbound_policy and not isinstance(outbound_policy, str):
            raise TypeError("Expected argument 'outbound_policy' to be a str")
        pulumi.set(__self__, "outbound_policy", outbound_policy)
        if outbounds and not isinstance(outbounds, list):
            raise TypeError("Expected argument 'outbounds' to be a list")
        pulumi.set(__self__, "outbounds", outbounds)
        if status and not isinstance(status, str):
            raise TypeError("Expected argument 'status' to be a str")
        pulumi.set(__self__, "status", status)
        if tags and not isinstance(tags, list):
            raise TypeError("Expected argument 'tags' to be a list")
        pulumi.set(__self__, "tags", tags)

    @property
    @pulumi.getter
    def devices(self) -> Sequence['outputs.GetFirewallDeviceResult']:
        return pulumi.get(self, "devices")

    @property
    @pulumi.getter
    def disabled(self) -> bool:
        """
        If true, the firewall is inactive.
        """
        return pulumi.get(self, "disabled")

    @property
    @pulumi.getter
    def id(self) -> int:
        """
        The ID of the Firewall Device.
        """
        return pulumi.get(self, "id")

    @property
    @pulumi.getter(name="inboundPolicy")
    def inbound_policy(self) -> str:
        """
        The default behavior for inbound traffic.
        """
        return pulumi.get(self, "inbound_policy")

    @property
    @pulumi.getter
    def inbounds(self) -> Sequence['outputs.GetFirewallInboundResult']:
        return pulumi.get(self, "inbounds")

    @property
    @pulumi.getter
    def label(self) -> str:
        """
        The label of the underlying entity this device references.
        """
        return pulumi.get(self, "label")

    @property
    @pulumi.getter
    def linodes(self) -> Sequence[int]:
        """
        The IDs of Linodes to apply this firewall to.
        """
        return pulumi.get(self, "linodes")

    @property
    @pulumi.getter(name="outboundPolicy")
    def outbound_policy(self) -> str:
        """
        The default behavior for outbound traffic. This setting can be overridden by updating the outbound.action property for an individual Firewall Rule.
        """
        return pulumi.get(self, "outbound_policy")

    @property
    @pulumi.getter
    def outbounds(self) -> Sequence['outputs.GetFirewallOutboundResult']:
        return pulumi.get(self, "outbounds")

    @property
    @pulumi.getter
    def status(self) -> str:
        """
        The status of the firewall.
        """
        return pulumi.get(self, "status")

    @property
    @pulumi.getter
    def tags(self) -> Sequence[str]:
        """
        The tags applied to the firewall.
        """
        return pulumi.get(self, "tags")


class AwaitableGetFirewallResult(GetFirewallResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetFirewallResult(
            devices=self.devices,
            disabled=self.disabled,
            id=self.id,
            inbound_policy=self.inbound_policy,
            inbounds=self.inbounds,
            label=self.label,
            linodes=self.linodes,
            outbound_policy=self.outbound_policy,
            outbounds=self.outbounds,
            status=self.status,
            tags=self.tags)


def get_firewall(id: Optional[int] = None,
                 opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetFirewallResult:
    """
    Provides details about a Linode Firewall.

    ## Example Usage

    ```python
    import pulumi
    import pulumi_linode as linode

    my_firewall = linode.get_firewall(id=123)
    ```


    :param int id: The Firewall's ID.
    """
    __args__ = dict()
    __args__['id'] = id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('linode:index/getFirewall:getFirewall', __args__, opts=opts, typ=GetFirewallResult).value

    return AwaitableGetFirewallResult(
        devices=__ret__.devices,
        disabled=__ret__.disabled,
        id=__ret__.id,
        inbound_policy=__ret__.inbound_policy,
        inbounds=__ret__.inbounds,
        label=__ret__.label,
        linodes=__ret__.linodes,
        outbound_policy=__ret__.outbound_policy,
        outbounds=__ret__.outbounds,
        status=__ret__.status,
        tags=__ret__.tags)
