# 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__ = ['AppSecWafModeArgs', 'AppSecWafMode']

@pulumi.input_type
class AppSecWafModeArgs:
    def __init__(__self__, *,
                 config_id: pulumi.Input[int],
                 mode: pulumi.Input[str],
                 security_policy_id: pulumi.Input[str]):
        """
        The set of arguments for constructing a AppSecWafMode resource.
        :param pulumi.Input[int] config_id: The ID of the security configuration to use.
        :param pulumi.Input[str] mode: "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        :param pulumi.Input[str] security_policy_id: The ID of the security policy to use.
        """
        pulumi.set(__self__, "config_id", config_id)
        pulumi.set(__self__, "mode", mode)
        pulumi.set(__self__, "security_policy_id", security_policy_id)

    @property
    @pulumi.getter(name="configId")
    def config_id(self) -> pulumi.Input[int]:
        """
        The ID of the security configuration to use.
        """
        return pulumi.get(self, "config_id")

    @config_id.setter
    def config_id(self, value: pulumi.Input[int]):
        pulumi.set(self, "config_id", value)

    @property
    @pulumi.getter
    def mode(self) -> pulumi.Input[str]:
        """
        "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        """
        return pulumi.get(self, "mode")

    @mode.setter
    def mode(self, value: pulumi.Input[str]):
        pulumi.set(self, "mode", value)

    @property
    @pulumi.getter(name="securityPolicyId")
    def security_policy_id(self) -> pulumi.Input[str]:
        """
        The ID of the security policy to use.
        """
        return pulumi.get(self, "security_policy_id")

    @security_policy_id.setter
    def security_policy_id(self, value: pulumi.Input[str]):
        pulumi.set(self, "security_policy_id", value)


@pulumi.input_type
class _AppSecWafModeState:
    def __init__(__self__, *,
                 config_id: Optional[pulumi.Input[int]] = None,
                 current_ruleset: Optional[pulumi.Input[str]] = None,
                 eval_expiration_date: Optional[pulumi.Input[str]] = None,
                 eval_ruleset: Optional[pulumi.Input[str]] = None,
                 eval_status: Optional[pulumi.Input[str]] = None,
                 mode: Optional[pulumi.Input[str]] = None,
                 output_text: Optional[pulumi.Input[str]] = None,
                 security_policy_id: Optional[pulumi.Input[str]] = None):
        """
        Input properties used for looking up and filtering AppSecWafMode resources.
        :param pulumi.Input[int] config_id: The ID of the security configuration to use.
        :param pulumi.Input[str] current_ruleset: The current rule set.
        :param pulumi.Input[str] eval_expiration_date: The date on which the evaluation period ends.
        :param pulumi.Input[str] eval_ruleset: The rule set being evaluated if any.
        :param pulumi.Input[str] eval_status: Either `enabled` if an evaluation is currently in progress, or `disabled` otherwise.
        :param pulumi.Input[str] mode: "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        :param pulumi.Input[str] output_text: A tabular display showing the current rule set, WAF mode and evaluation status (`enabled` if a rule set is currently being evaluated, `disabled` otherwise).
        :param pulumi.Input[str] security_policy_id: The ID of the security policy to use.
        """
        if config_id is not None:
            pulumi.set(__self__, "config_id", config_id)
        if current_ruleset is not None:
            pulumi.set(__self__, "current_ruleset", current_ruleset)
        if eval_expiration_date is not None:
            pulumi.set(__self__, "eval_expiration_date", eval_expiration_date)
        if eval_ruleset is not None:
            pulumi.set(__self__, "eval_ruleset", eval_ruleset)
        if eval_status is not None:
            pulumi.set(__self__, "eval_status", eval_status)
        if mode is not None:
            pulumi.set(__self__, "mode", mode)
        if output_text is not None:
            pulumi.set(__self__, "output_text", output_text)
        if security_policy_id is not None:
            pulumi.set(__self__, "security_policy_id", security_policy_id)

    @property
    @pulumi.getter(name="configId")
    def config_id(self) -> Optional[pulumi.Input[int]]:
        """
        The ID of the security configuration to use.
        """
        return pulumi.get(self, "config_id")

    @config_id.setter
    def config_id(self, value: Optional[pulumi.Input[int]]):
        pulumi.set(self, "config_id", value)

    @property
    @pulumi.getter(name="currentRuleset")
    def current_ruleset(self) -> Optional[pulumi.Input[str]]:
        """
        The current rule set.
        """
        return pulumi.get(self, "current_ruleset")

    @current_ruleset.setter
    def current_ruleset(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "current_ruleset", value)

    @property
    @pulumi.getter(name="evalExpirationDate")
    def eval_expiration_date(self) -> Optional[pulumi.Input[str]]:
        """
        The date on which the evaluation period ends.
        """
        return pulumi.get(self, "eval_expiration_date")

    @eval_expiration_date.setter
    def eval_expiration_date(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "eval_expiration_date", value)

    @property
    @pulumi.getter(name="evalRuleset")
    def eval_ruleset(self) -> Optional[pulumi.Input[str]]:
        """
        The rule set being evaluated if any.
        """
        return pulumi.get(self, "eval_ruleset")

    @eval_ruleset.setter
    def eval_ruleset(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "eval_ruleset", value)

    @property
    @pulumi.getter(name="evalStatus")
    def eval_status(self) -> Optional[pulumi.Input[str]]:
        """
        Either `enabled` if an evaluation is currently in progress, or `disabled` otherwise.
        """
        return pulumi.get(self, "eval_status")

    @eval_status.setter
    def eval_status(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "eval_status", value)

    @property
    @pulumi.getter
    def mode(self) -> Optional[pulumi.Input[str]]:
        """
        "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        """
        return pulumi.get(self, "mode")

    @mode.setter
    def mode(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "mode", value)

    @property
    @pulumi.getter(name="outputText")
    def output_text(self) -> Optional[pulumi.Input[str]]:
        """
        A tabular display showing the current rule set, WAF mode and evaluation status (`enabled` if a rule set is currently being evaluated, `disabled` otherwise).
        """
        return pulumi.get(self, "output_text")

    @output_text.setter
    def output_text(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "output_text", value)

    @property
    @pulumi.getter(name="securityPolicyId")
    def security_policy_id(self) -> Optional[pulumi.Input[str]]:
        """
        The ID of the security policy to use.
        """
        return pulumi.get(self, "security_policy_id")

    @security_policy_id.setter
    def security_policy_id(self, value: Optional[pulumi.Input[str]]):
        pulumi.set(self, "security_policy_id", value)


class AppSecWafMode(pulumi.CustomResource):
    @overload
    def __init__(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 config_id: Optional[pulumi.Input[int]] = None,
                 mode: Optional[pulumi.Input[str]] = None,
                 security_policy_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        """
        Use the `AppSecWafMode` resource to specify how your rule sets are updated. Use KRS mode to update the rule sets manually, or AAG to have them update automatically.

        ## Example Usage

        Basic usage:

        ```python
        import pulumi
        import pulumi_akamai as akamai

        configuration = akamai.get_app_sec_configuration(name=var["security_configuration"])
        waf_mode = akamai.AppSecWafMode("wafMode",
            config_id=configuration.config_id,
            security_policy_id=var["policy_id"],
            mode=var["mode"])
        pulumi.export("wafModeMode", waf_mode.mode)
        pulumi.export("wafModeCurrentRuleset", waf_mode.current_ruleset)
        pulumi.export("wafModeEvalStatus", waf_mode.eval_status)
        pulumi.export("wafModeEvalRuleset", waf_mode.eval_ruleset)
        pulumi.export("wafModeEvalExpirationDate", waf_mode.eval_expiration_date)
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[int] config_id: The ID of the security configuration to use.
        :param pulumi.Input[str] mode: "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        :param pulumi.Input[str] security_policy_id: The ID of the security policy to use.
        """
        ...
    @overload
    def __init__(__self__,
                 resource_name: str,
                 args: AppSecWafModeArgs,
                 opts: Optional[pulumi.ResourceOptions] = None):
        """
        Use the `AppSecWafMode` resource to specify how your rule sets are updated. Use KRS mode to update the rule sets manually, or AAG to have them update automatically.

        ## Example Usage

        Basic usage:

        ```python
        import pulumi
        import pulumi_akamai as akamai

        configuration = akamai.get_app_sec_configuration(name=var["security_configuration"])
        waf_mode = akamai.AppSecWafMode("wafMode",
            config_id=configuration.config_id,
            security_policy_id=var["policy_id"],
            mode=var["mode"])
        pulumi.export("wafModeMode", waf_mode.mode)
        pulumi.export("wafModeCurrentRuleset", waf_mode.current_ruleset)
        pulumi.export("wafModeEvalStatus", waf_mode.eval_status)
        pulumi.export("wafModeEvalRuleset", waf_mode.eval_ruleset)
        pulumi.export("wafModeEvalExpirationDate", waf_mode.eval_expiration_date)
        ```

        :param str resource_name: The name of the resource.
        :param AppSecWafModeArgs args: The arguments to use to populate this resource's properties.
        :param pulumi.ResourceOptions opts: Options for the resource.
        """
        ...
    def __init__(__self__, resource_name: str, *args, **kwargs):
        resource_args, opts = _utilities.get_resource_args_opts(AppSecWafModeArgs, pulumi.ResourceOptions, *args, **kwargs)
        if resource_args is not None:
            __self__._internal_init(resource_name, opts, **resource_args.__dict__)
        else:
            __self__._internal_init(resource_name, *args, **kwargs)

    def _internal_init(__self__,
                 resource_name: str,
                 opts: Optional[pulumi.ResourceOptions] = None,
                 config_id: Optional[pulumi.Input[int]] = None,
                 mode: Optional[pulumi.Input[str]] = None,
                 security_policy_id: Optional[pulumi.Input[str]] = None,
                 __props__=None):
        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__ = AppSecWafModeArgs.__new__(AppSecWafModeArgs)

            if config_id is None and not opts.urn:
                raise TypeError("Missing required property 'config_id'")
            __props__.__dict__["config_id"] = config_id
            if mode is None and not opts.urn:
                raise TypeError("Missing required property 'mode'")
            __props__.__dict__["mode"] = mode
            if security_policy_id is None and not opts.urn:
                raise TypeError("Missing required property 'security_policy_id'")
            __props__.__dict__["security_policy_id"] = security_policy_id
            __props__.__dict__["current_ruleset"] = None
            __props__.__dict__["eval_expiration_date"] = None
            __props__.__dict__["eval_ruleset"] = None
            __props__.__dict__["eval_status"] = None
            __props__.__dict__["output_text"] = None
        super(AppSecWafMode, __self__).__init__(
            'akamai:index/appSecWafMode:AppSecWafMode',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name: str,
            id: pulumi.Input[str],
            opts: Optional[pulumi.ResourceOptions] = None,
            config_id: Optional[pulumi.Input[int]] = None,
            current_ruleset: Optional[pulumi.Input[str]] = None,
            eval_expiration_date: Optional[pulumi.Input[str]] = None,
            eval_ruleset: Optional[pulumi.Input[str]] = None,
            eval_status: Optional[pulumi.Input[str]] = None,
            mode: Optional[pulumi.Input[str]] = None,
            output_text: Optional[pulumi.Input[str]] = None,
            security_policy_id: Optional[pulumi.Input[str]] = None) -> 'AppSecWafMode':
        """
        Get an existing AppSecWafMode 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] config_id: The ID of the security configuration to use.
        :param pulumi.Input[str] current_ruleset: The current rule set.
        :param pulumi.Input[str] eval_expiration_date: The date on which the evaluation period ends.
        :param pulumi.Input[str] eval_ruleset: The rule set being evaluated if any.
        :param pulumi.Input[str] eval_status: Either `enabled` if an evaluation is currently in progress, or `disabled` otherwise.
        :param pulumi.Input[str] mode: "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        :param pulumi.Input[str] output_text: A tabular display showing the current rule set, WAF mode and evaluation status (`enabled` if a rule set is currently being evaluated, `disabled` otherwise).
        :param pulumi.Input[str] security_policy_id: The ID of the security policy to use.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = _AppSecWafModeState.__new__(_AppSecWafModeState)

        __props__.__dict__["config_id"] = config_id
        __props__.__dict__["current_ruleset"] = current_ruleset
        __props__.__dict__["eval_expiration_date"] = eval_expiration_date
        __props__.__dict__["eval_ruleset"] = eval_ruleset
        __props__.__dict__["eval_status"] = eval_status
        __props__.__dict__["mode"] = mode
        __props__.__dict__["output_text"] = output_text
        __props__.__dict__["security_policy_id"] = security_policy_id
        return AppSecWafMode(resource_name, opts=opts, __props__=__props__)

    @property
    @pulumi.getter(name="configId")
    def config_id(self) -> pulumi.Output[int]:
        """
        The ID of the security configuration to use.
        """
        return pulumi.get(self, "config_id")

    @property
    @pulumi.getter(name="currentRuleset")
    def current_ruleset(self) -> pulumi.Output[str]:
        """
        The current rule set.
        """
        return pulumi.get(self, "current_ruleset")

    @property
    @pulumi.getter(name="evalExpirationDate")
    def eval_expiration_date(self) -> pulumi.Output[str]:
        """
        The date on which the evaluation period ends.
        """
        return pulumi.get(self, "eval_expiration_date")

    @property
    @pulumi.getter(name="evalRuleset")
    def eval_ruleset(self) -> pulumi.Output[str]:
        """
        The rule set being evaluated if any.
        """
        return pulumi.get(self, "eval_ruleset")

    @property
    @pulumi.getter(name="evalStatus")
    def eval_status(self) -> pulumi.Output[str]:
        """
        Either `enabled` if an evaluation is currently in progress, or `disabled` otherwise.
        """
        return pulumi.get(self, "eval_status")

    @property
    @pulumi.getter
    def mode(self) -> pulumi.Output[str]:
        """
        "KRS" to update the rule sets manually, or "AAG" to have them update automatically.
        """
        return pulumi.get(self, "mode")

    @property
    @pulumi.getter(name="outputText")
    def output_text(self) -> pulumi.Output[str]:
        """
        A tabular display showing the current rule set, WAF mode and evaluation status (`enabled` if a rule set is currently being evaluated, `disabled` otherwise).
        """
        return pulumi.get(self, "output_text")

    @property
    @pulumi.getter(name="securityPolicyId")
    def security_policy_id(self) -> pulumi.Output[str]:
        """
        The ID of the security policy to use.
        """
        return pulumi.get(self, "security_policy_id")

