# 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 Union
from .. import _utilities, _tables


class WebAclLoggingConfiguration(pulumi.CustomResource):
    log_destination_configs: pulumi.Output[list]
    """
    The Amazon Kinesis Data Firehose Amazon Resource Name (ARNs) that you want to associate with the web ACL. Currently, only 1 ARN is supported.
    """
    redacted_fields: pulumi.Output[list]
    """
    The parts of the request that you want to keep out of the logs. Up to 100 `redacted_fields` blocks are supported.

      * `allQueryArguments` (`dict`) - Inspect all query arguments.
      * `body` (`dict`) - Inspect the request body, which immediately follows the request headers.
      * `method` (`dict`) - Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.
      * `queryString` (`dict`) - Inspect the query string. This is the part of a URL that appears after a `?` character, if any.
      * `singleHeader` (`dict`) - Inspect a single header. See Single Header below for details.
        * `name` (`str`) - The name of the query header to inspect. This setting must be provided as lower case characters.

      * `singleQueryArgument` (`dict`) - Inspect a single query argument. See Single Query Argument below for details.
        * `name` (`str`) - The name of the query header to inspect. This setting must be provided as lower case characters.

      * `uriPath` (`dict`) - Inspect the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`.
    """
    resource_arn: pulumi.Output[str]
    """
    The Amazon Resource Name (ARN) of the web ACL that you want to associate with `log_destination_configs`.
    """
    def __init__(__self__, resource_name, opts=None, log_destination_configs=None, redacted_fields=None, resource_arn=None, __props__=None, __name__=None, __opts__=None):
        """
        Creates a WAFv2 Web ACL Logging Configuration resource.

        > **Note:** To start logging from a WAFv2 Web ACL, an Amazon Kinesis Data Firehose (e.g. [`kinesis.FirehoseDeliveryStream` resource](https://www.terraform.io/docs/providers/aws/r/kinesis_firehose_delivery_stream.html) must also be created with a PUT source (not a stream) and in the region that you are operating.
        If you are capturing logs for Amazon CloudFront, always create the firehose in US East (N. Virginia).
        Be sure to give the data firehose a name that starts with the prefix `aws-waf-logs-`.

        ## Example Usage

        ```python
        import pulumi
        import pulumi_aws as aws

        example = aws.wafv2.WebAclLoggingConfiguration("example",
            log_destination_configs=[aws_kinesis_firehose_delivery_stream["example"]["arn"]],
            resource_arn=aws_wafv2_web_acl["example"]["arn"],
            redacted_fields=[{
                "singleHeader": {
                    "name": "user-agent",
                },
            }])
        ```

        :param str resource_name: The name of the resource.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[list] log_destination_configs: The Amazon Kinesis Data Firehose Amazon Resource Name (ARNs) that you want to associate with the web ACL. Currently, only 1 ARN is supported.
        :param pulumi.Input[list] redacted_fields: The parts of the request that you want to keep out of the logs. Up to 100 `redacted_fields` blocks are supported.
        :param pulumi.Input[str] resource_arn: The Amazon Resource Name (ARN) of the web ACL that you want to associate with `log_destination_configs`.

        The **redacted_fields** object supports the following:

          * `allQueryArguments` (`pulumi.Input[dict]`) - Inspect all query arguments.
          * `body` (`pulumi.Input[dict]`) - Inspect the request body, which immediately follows the request headers.
          * `method` (`pulumi.Input[dict]`) - Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.
          * `queryString` (`pulumi.Input[dict]`) - Inspect the query string. This is the part of a URL that appears after a `?` character, if any.
          * `singleHeader` (`pulumi.Input[dict]`) - Inspect a single header. See Single Header below for details.
            * `name` (`pulumi.Input[str]`) - The name of the query header to inspect. This setting must be provided as lower case characters.

          * `singleQueryArgument` (`pulumi.Input[dict]`) - Inspect a single query argument. See Single Query Argument below for details.
            * `name` (`pulumi.Input[str]`) - The name of the query header to inspect. This setting must be provided as lower case characters.

          * `uriPath` (`pulumi.Input[dict]`) - Inspect the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`.
        """
        if __name__ is not None:
            warnings.warn("explicit use of __name__ is deprecated", DeprecationWarning)
            resource_name = __name__
        if __opts__ is not None:
            warnings.warn("explicit use of __opts__ is deprecated, use 'opts' instead", DeprecationWarning)
            opts = __opts__
        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__ = dict()

            if log_destination_configs is None:
                raise TypeError("Missing required property 'log_destination_configs'")
            __props__['log_destination_configs'] = log_destination_configs
            __props__['redacted_fields'] = redacted_fields
            if resource_arn is None:
                raise TypeError("Missing required property 'resource_arn'")
            __props__['resource_arn'] = resource_arn
        super(WebAclLoggingConfiguration, __self__).__init__(
            'aws:wafv2/webAclLoggingConfiguration:WebAclLoggingConfiguration',
            resource_name,
            __props__,
            opts)

    @staticmethod
    def get(resource_name, id, opts=None, log_destination_configs=None, redacted_fields=None, resource_arn=None):
        """
        Get an existing WebAclLoggingConfiguration 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 str id: The unique provider ID of the resource to lookup.
        :param pulumi.ResourceOptions opts: Options for the resource.
        :param pulumi.Input[list] log_destination_configs: The Amazon Kinesis Data Firehose Amazon Resource Name (ARNs) that you want to associate with the web ACL. Currently, only 1 ARN is supported.
        :param pulumi.Input[list] redacted_fields: The parts of the request that you want to keep out of the logs. Up to 100 `redacted_fields` blocks are supported.
        :param pulumi.Input[str] resource_arn: The Amazon Resource Name (ARN) of the web ACL that you want to associate with `log_destination_configs`.

        The **redacted_fields** object supports the following:

          * `allQueryArguments` (`pulumi.Input[dict]`) - Inspect all query arguments.
          * `body` (`pulumi.Input[dict]`) - Inspect the request body, which immediately follows the request headers.
          * `method` (`pulumi.Input[dict]`) - Inspect the HTTP method. The method indicates the type of operation that the request is asking the origin to perform.
          * `queryString` (`pulumi.Input[dict]`) - Inspect the query string. This is the part of a URL that appears after a `?` character, if any.
          * `singleHeader` (`pulumi.Input[dict]`) - Inspect a single header. See Single Header below for details.
            * `name` (`pulumi.Input[str]`) - The name of the query header to inspect. This setting must be provided as lower case characters.

          * `singleQueryArgument` (`pulumi.Input[dict]`) - Inspect a single query argument. See Single Query Argument below for details.
            * `name` (`pulumi.Input[str]`) - The name of the query header to inspect. This setting must be provided as lower case characters.

          * `uriPath` (`pulumi.Input[dict]`) - Inspect the request URI path. This is the part of a web request that identifies a resource, for example, `/images/daily-ad.jpg`.
        """
        opts = pulumi.ResourceOptions.merge(opts, pulumi.ResourceOptions(id=id))

        __props__ = dict()

        __props__["log_destination_configs"] = log_destination_configs
        __props__["redacted_fields"] = redacted_fields
        __props__["resource_arn"] = resource_arn
        return WebAclLoggingConfiguration(resource_name, opts=opts, __props__=__props__)

    def translate_output_property(self, prop):
        return _tables.CAMEL_TO_SNAKE_CASE_TABLE.get(prop) or prop

    def translate_input_property(self, prop):
        return _tables.SNAKE_TO_CAMEL_CASE_TABLE.get(prop) or prop
