Skip to content

get_logging_configuration

get_logging_configuration(
    resource_arn: ResourceArn,
    *,
    config_overrides: Optional[WAFV2ClientConfig] = None,
    log_type: Optional[LogType] = None,
    log_scope: Optional[LogScope] = None,
) -> GetLoggingConfigurationResponse

Returns the LoggingConfiguration for the specified web ACL.

Parameters:

  • resource_arn (ResourceArn) –

    The Amazon Resource Name (ARN) of the web ACL for which you want to get the LoggingConfiguration.

  • log_type (Optional[LogType], default: None ) –

    Used to distinguish between various logging options. Currently, there is one option.

    Default: WAF_LOGS

  • log_scope (Optional[LogScope], default: None ) –

    The owner of the logging configuration, which must be set to CUSTOMER for the configurations that you manage.

    The log scope SECURITY_LAKE indicates a configuration that is managed through Amazon Security Lake. You can use Security Lake to collect log and event data from various sources for normalization, analysis, and management. For information, see Collecting data from Amazon Web Services services in the Amazon Security Lake user guide.

    The log scope CLOUDWATCH_TELEMETRY_RULE_MANAGED indicates a configuration that is managed through Amazon CloudWatch Logs for telemetry data collection and analysis. For information, see What is Amazon CloudWatch Logs ? in the Amazon CloudWatch Logs user guide.

    Default: CUSTOMER

Raises:

  • WAFInternalErrorException –

    Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request.

  • WAFInvalidOperationException –

    The operation isn't valid.

  • WAFInvalidParameterException –

    The operation failed because WAF didn't recognize a parameter in the request. For example:

    • You specified a parameter name or value that isn't valid.

    • Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested.

    • You tried to update a WebACL with a DefaultAction that isn't among the types available at DefaultAction.

    • Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.

  • WAFNonexistentItemException –

    WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate.

  • UnknownServiceError –

    The service returned an error code this client does not model.

Source code in docs_src/capo_wafv2/_services/wafv2.py
def get_logging_configuration(
    self,
    resource_arn: "capo_wafv2.types.resource_arn.ResourceArn",
    *,
    config_overrides: Optional[WAFV2ClientConfig] = None,
    log_type: Optional["capo_wafv2.types.log_type.LogType"] = None,
    log_scope: Optional["capo_wafv2.types.log_scope.LogScope"] = None,
) -> "capo_wafv2.types.get_logging_configuration_response.GetLoggingConfigurationResponse":
    """<p>Returns the <a>LoggingConfiguration</a> for the specified web ACL.</p>

    Args:
        resource_arn: <p>The Amazon Resource Name (ARN) of the web ACL for which you want to get the <a>LoggingConfiguration</a>.</p>
        log_type: <p>Used to distinguish between various logging options. Currently, there is one option.</p> <p>Default: <code>WAF_LOGS</code> </p>
        log_scope: <p>The owner of the logging configuration, which must be set to <code>CUSTOMER</code> for the configurations that you manage. </p> <p>The log scope <code>SECURITY_LAKE</code> indicates a configuration that is managed through Amazon Security Lake. You can use Security Lake to collect log and event data from various sources for normalization, analysis, and management. For information, see <a href="https://docs.aws.amazon.com/security-lake/latest/userguide/internal-sources.html">Collecting data from Amazon Web Services services</a> in the <i>Amazon Security Lake user guide</i>. </p> <p>The log scope <code>CLOUDWATCH_TELEMETRY_RULE_MANAGED</code> indicates a configuration that is managed through Amazon CloudWatch Logs for telemetry data collection and analysis. For information, see <a href="https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/WhatIsCloudWatchLogs.html">What is Amazon CloudWatch Logs ?</a> in the <i>Amazon CloudWatch Logs user guide</i>. </p> <p>Default: <code>CUSTOMER</code> </p>

    Raises:
        capo_wafv2.errors.waf_internal_error_exception.WAFInternalErrorException: <p>Your request is valid, but WAF couldn’t perform the operation because of a system problem. Retry your request. </p>
        capo_wafv2.errors.waf_invalid_operation_exception.WAFInvalidOperationException: <p>The operation isn't valid. </p>
        capo_wafv2.errors.waf_invalid_parameter_exception.WAFInvalidParameterException: <p>The operation failed because WAF didn't recognize a parameter in the request. For example: </p> <ul> <li> <p>You specified a parameter name or value that isn't valid.</p> </li> <li> <p>Your nested statement isn't valid. You might have tried to nest a statement that can’t be nested. </p> </li> <li> <p>You tried to update a <code>WebACL</code> with a <code>DefaultAction</code> that isn't among the types available at <a>DefaultAction</a>.</p> </li> <li> <p>Your request references an ARN that is malformed, or corresponds to a resource with which a web ACL can't be associated.</p> </li> </ul>
        capo_wafv2.errors.waf_nonexistent_item_exception.WAFNonexistentItemException: <p>WAF couldn’t perform the operation because your resource doesn't exist. If you've just created a resource that you're using in this operation, you might just need to wait a few minutes. It can take from a few seconds to a number of minutes for changes to propagate. </p>
        capo_wafv2.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_wafv2.types.get_logging_configuration_request.GetLoggingConfigurationRequest]",
    ) -> OperationResponse[
        "capo_wafv2.types.get_logging_configuration_response.GetLoggingConfigurationResponse"
    ]:
        import capo_wafv2._operations.awswaf_20190729.get_logging_configuration

        output, http_response = (
            capo_wafv2._operations.awswaf_20190729.get_logging_configuration.get_logging_configuration(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetLoggingConfiguration")
    )
    input_: capo_wafv2.types.get_logging_configuration_request.GetLoggingConfigurationRequest = {
        "resource_arn": resource_arn
    }
    if log_type is not None:
        input_["log_type"] = log_type
    if log_scope is not None:
        input_["log_scope"] = log_scope

    response = execute_pipeline(
        OperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    response.response.close()
    return response.output