# 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__ = [
    'GetAppSecAttackGroupsResult',
    'AwaitableGetAppSecAttackGroupsResult',
    'get_app_sec_attack_groups',
]

@pulumi.output_type
class GetAppSecAttackGroupsResult:
    """
    A collection of values returned by getAppSecAttackGroups.
    """
    def __init__(__self__, attack_group=None, attack_group_action=None, condition_exception=None, config_id=None, id=None, json=None, output_text=None, security_policy_id=None):
        if attack_group and not isinstance(attack_group, str):
            raise TypeError("Expected argument 'attack_group' to be a str")
        pulumi.set(__self__, "attack_group", attack_group)
        if attack_group_action and not isinstance(attack_group_action, str):
            raise TypeError("Expected argument 'attack_group_action' to be a str")
        pulumi.set(__self__, "attack_group_action", attack_group_action)
        if condition_exception and not isinstance(condition_exception, str):
            raise TypeError("Expected argument 'condition_exception' to be a str")
        pulumi.set(__self__, "condition_exception", condition_exception)
        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 id and not isinstance(id, str):
            raise TypeError("Expected argument 'id' to be a str")
        pulumi.set(__self__, "id", id)
        if json and not isinstance(json, str):
            raise TypeError("Expected argument 'json' to be a str")
        pulumi.set(__self__, "json", json)
        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="attackGroup")
    def attack_group(self) -> Optional[str]:
        return pulumi.get(self, "attack_group")

    @property
    @pulumi.getter(name="attackGroupAction")
    def attack_group_action(self) -> str:
        """
        The attack group's action, either `alert`, `deny`, or `none`.
        """
        return pulumi.get(self, "attack_group_action")

    @property
    @pulumi.getter(name="conditionException")
    def condition_exception(self) -> str:
        """
        The attack group's conditions and exceptions.
        """
        return pulumi.get(self, "condition_exception")

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

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

    @property
    @pulumi.getter
    def json(self) -> str:
        """
        A JSON-formatted list of the action and condition-exception information for the specified attack
        group. This output is only generated if an attack group is specified.
        """
        return pulumi.get(self, "json")

    @property
    @pulumi.getter(name="outputText")
    def output_text(self) -> str:
        """
        A tabular display showing, for the specified attack group or groups, the attack group's action and
        boolean values indicating whether conditions and exceptions are present.
        """
        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 AwaitableGetAppSecAttackGroupsResult(GetAppSecAttackGroupsResult):
    # pylint: disable=using-constant-test
    def __await__(self):
        if False:
            yield self
        return GetAppSecAttackGroupsResult(
            attack_group=self.attack_group,
            attack_group_action=self.attack_group_action,
            condition_exception=self.condition_exception,
            config_id=self.config_id,
            id=self.id,
            json=self.json,
            output_text=self.output_text,
            security_policy_id=self.security_policy_id)


def get_app_sec_attack_groups(attack_group: Optional[str] = None,
                              config_id: Optional[int] = None,
                              security_policy_id: Optional[str] = None,
                              opts: Optional[pulumi.InvokeOptions] = None) -> AwaitableGetAppSecAttackGroupsResult:
    """
    Use the `getAppSecAttackGroups` data source to list the action and condition-exception information for an attack
    group or groups.

    ## Example Usage

    Basic usage:

    ```python
    import pulumi
    import pulumi_akamai as akamai

    configuration = akamai.get_app_sec_configuration(name=var["security_configuration"])
    attack_group = akamai.get_app_sec_attack_groups(config_id=configuration.config_id,
        security_policy_id=var["security_policy_id"],
        attack_group=var["attack_group"])
    pulumi.export("attackGroupAction", akamai_appsec_attack_groups["attack_group"]["attack_group_action"])
    pulumi.export("conditionException", akamai_appsec_attack_groups["attack_group"]["condition_exception"])
    pulumi.export("json", akamai_appsec_attack_groups["attack_group"]["json"])
    pulumi.export("outputText", akamai_appsec_attack_groups["attack_group"]["output_text"])
    ```


    :param str attack_group: The ID of the attack group to use.
    :param int config_id: The ID of the security configuration to use.
    :param str security_policy_id: The ID of the security policy to use.
    """
    __args__ = dict()
    __args__['attackGroup'] = attack_group
    __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/getAppSecAttackGroups:getAppSecAttackGroups', __args__, opts=opts, typ=GetAppSecAttackGroupsResult).value

    return AwaitableGetAppSecAttackGroupsResult(
        attack_group=__ret__.attack_group,
        attack_group_action=__ret__.attack_group_action,
        condition_exception=__ret__.condition_exception,
        config_id=__ret__.config_id,
        id=__ret__.id,
        json=__ret__.json,
        output_text=__ret__.output_text,
        security_policy_id=__ret__.security_policy_id)
