# 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

__all__ = [
    'GetAppSecIPGeoResult',
    'AwaitableGetAppSecIPGeoResult',
    'get_app_sec_ip_geo',
    'get_app_sec_ip_geo_output',
]

@pulumi.output_type
class GetAppSecIPGeoResult:
    """
    A collection of values returned by getAppSecIPGeo.
    """
    def __init__(__self__, config_id=None, exception_ip_network_lists=None, geo_network_lists=None, id=None, ip_network_lists=None, mode=None, output_text=None, security_policy_id=None):
        if config_id and not isinstance(config_id, int):
            raise TypeError("Expected argument 'config_id' to be a int")
        pulumi.set(__self__, "config_id", config_id)
        if exception_ip_network_lists and not isinstance(exception_ip_network_lists, list):
            raise TypeError("Expected argument 'exception_ip_network_lists' to be a list")
        pulumi.set(__self__, "exception_ip_network_lists", exception_ip_network_lists)
        if geo_network_lists and not isinstance(geo_network_lists, list):
            raise TypeError("Expected argument 'geo_network_lists' to be a list")
        pulumi.set(__self__, "geo_network_lists", geo_network_lists)
        if id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if ip_network_lists and not isinstance(ip_network_lists, list):
            raise TypeError("Expected argument 'ip_network_lists' to be a list")
        pulumi.set(__self__, "ip_network_lists", ip_network_lists)
        if mode and not isinstance(mode, str):
            raise TypeError("Expected argument 'mode' to be a str")
        pulumi.set(__self__, "mode", mode)
        if output_text and not isinstance(output_text, str):
            raise TypeError("Expected argument 'output_text' to be a str")
        pulumi.set(__self__, "output_text", output_text)
        if security_policy_id and not isinstance(security_policy_id, str):
            raise TypeError("Expected argument 'security_policy_id' to be a str")
        pulumi.set(__self__, "security_policy_id", security_policy_id)

    @property
    @pulumi.getter(name="configId")
    def config_id(self) -> int:
        return pulumi.get(self, "config_id")

    @property
    @pulumi.getter(name="exceptionIpNetworkLists")
    def exception_ip_network_lists(self) -> Sequence[str]:
        return pulumi.get(self, "exception_ip_network_lists")

    @property
    @pulumi.getter(name="geoNetworkLists")
    def geo_network_lists(self) -> Sequence[str]:
        return pulumi.get(self, "geo_network_lists")

    @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="ipNetworkLists")
    def ip_network_lists(self) -> Sequence[str]:
        return pulumi.get(self, "ip_network_lists")

    @property
    @pulumi.getter
    def mode(self) -> str:
        return pulumi.get(self, "mode")

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

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


class AwaitableGetAppSecIPGeoResult(GetAppSecIPGeoResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAppSecIPGeoResult(
            config_id=self.config_id,
            exception_ip_network_lists=self.exception_ip_network_lists,
            geo_network_lists=self.geo_network_lists,
            id=self.id,
            ip_network_lists=self.ip_network_lists,
            mode=self.mode,
            output_text=self.output_text,
            security_policy_id=self.security_policy_id)


def get_app_sec_ip_geo(config_id: Optional[int] = None,
                       security_policy_id: Optional[str] = None,
                       opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAppSecIPGeoResult:
    """
    **Scopes**: Security configuration; security policy

    Returns information about the network lists used in the IP/Geo Firewall settings; also returns the firewall `mode`, which indicates whether devices on the geographic or IP address lists are allowed through the firewall or are blocked by the firewall.

    **Related API Endpoint**: [/appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/ip-geo-firewall](https://developer.akamai.com/api/cloud_security/application_security/v1.html#getipgeofirewall)

    ## Example Usage

    Basic usage:

    ```python
    import pulumi
    import pulumi_akamai as akamai

    configuration = akamai.get_app_sec_configuration(name="Documentation")
    ip_geo = akamai.get_app_sec_ip_geo(config_id=configuration.config_id,
        security_policy_id="gms1_134637")
    pulumi.export("ipGeoMode", ip_geo.mode)
    pulumi.export("geoNetworkLists", ip_geo.geo_network_lists)
    pulumi.export("ipNetworkLists", ip_geo.ip_network_lists)
    pulumi.export("exceptionIpNetworkLists", ip_geo.exception_ip_network_lists)
    ```
    ## Output Options

    The following options can be used to determine the information returned, and how that returned information is formatted:

    - `mode`. Specifies the action taken by the IP/Geo firewall. Valid values are:
      - **block**. Networks on the IP and geographic network lists are prevented from passing through the firewall.
      - **allow**.  Networks on the IP and geographic network lists are allowed to pass through the firewall.
    - `geo_network_lists`. Network lists blocked or allowed based on geographic location.
    - `ip_network_lists`. Network lists blocked or allowed based on IP address.
    - `exception_ip_network_lists`. Network lists allowed through the firewall regardless of the values assigned to the `mode`, `geo_network_lists`, and `ip_network_lists` parameters.
    - `output_text`. Tabular report of the IP/Geo firewall settings.


    :param int config_id: . Unique identifier of the security configuration associated with the IP/Geo lists.
    :param str security_policy_id: . Unique identifier of the security policy associated with the IP/Geo lists. If not included, information is returned for all your security policies.
    """
    __args__ = dict()
    __args__['configId'] = config_id
    __args__['securityPolicyId'] = security_policy_id
    if opts is None:
        opts = pulumi.InvokeOptions()
    if opts.version is None:
        opts.version = _utilities.get_version()
    __ret__ = pulumi.runtime.invoke('akamai:index/getAppSecIPGeo:getAppSecIPGeo', __args__, opts=opts, typ=GetAppSecIPGeoResult).value

    return AwaitableGetAppSecIPGeoResult(
        config_id=__ret__.config_id,
        exception_ip_network_lists=__ret__.exception_ip_network_lists,
        geo_network_lists=__ret__.geo_network_lists,
        id=__ret__.id,
        ip_network_lists=__ret__.ip_network_lists,
        mode=__ret__.mode,
        output_text=__ret__.output_text,
        security_policy_id=__ret__.security_policy_id)


@_utilities.lift_output_func(get_app_sec_ip_geo)
def get_app_sec_ip_geo_output(config_id: Optional[pulumi.Input[int]] = None,
                              security_policy_id: Optional[pulumi.Input[str]] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> pulumi.Output[GetAppSecIPGeoResult]:
    """
    **Scopes**: Security configuration; security policy

    Returns information about the network lists used in the IP/Geo Firewall settings; also returns the firewall `mode`, which indicates whether devices on the geographic or IP address lists are allowed through the firewall or are blocked by the firewall.

    **Related API Endpoint**: [/appsec/v1/configs/{configId}/versions/{versionNumber}/security-policies/{policyId}/ip-geo-firewall](https://developer.akamai.com/api/cloud_security/application_security/v1.html#getipgeofirewall)

    ## Example Usage

    Basic usage:

    ```python
    import pulumi
    import pulumi_akamai as akamai

    configuration = akamai.get_app_sec_configuration(name="Documentation")
    ip_geo = akamai.get_app_sec_ip_geo(config_id=configuration.config_id,
        security_policy_id="gms1_134637")
    pulumi.export("ipGeoMode", ip_geo.mode)
    pulumi.export("geoNetworkLists", ip_geo.geo_network_lists)
    pulumi.export("ipNetworkLists", ip_geo.ip_network_lists)
    pulumi.export("exceptionIpNetworkLists", ip_geo.exception_ip_network_lists)
    ```
    ## Output Options

    The following options can be used to determine the information returned, and how that returned information is formatted:

    - `mode`. Specifies the action taken by the IP/Geo firewall. Valid values are:
      - **block**. Networks on the IP and geographic network lists are prevented from passing through the firewall.
      - **allow**.  Networks on the IP and geographic network lists are allowed to pass through the firewall.
    - `geo_network_lists`. Network lists blocked or allowed based on geographic location.
    - `ip_network_lists`. Network lists blocked or allowed based on IP address.
    - `exception_ip_network_lists`. Network lists allowed through the firewall regardless of the values assigned to the `mode`, `geo_network_lists`, and `ip_network_lists` parameters.
    - `output_text`. Tabular report of the IP/Geo firewall settings.


    :param int config_id: . Unique identifier of the security configuration associated with the IP/Geo lists.
    :param str security_policy_id: . Unique identifier of the security policy associated with the IP/Geo lists. If not included, information is returned for all your security policies.
    """
    ...
