Skip to content

list_resolver_query_log_config_associations

list_resolver_query_log_config_associations(
    *,
    config_overrides: Optional[Route53ResolverClientConfig] = None,
    max_results: Optional[MaxResults] = None,
    next_token: Optional[NextToken] = None,
    filters: Optional[Filters] = None,
    sort_by: Optional[SortByKey] = None,
    sort_order: Optional[SortOrder] = None,
) -> ListResolverQueryLogConfigAssociationsResponse

Lists information about associations between Amazon VPCs and query logging configurations.

Parameters:

  • max_results (Optional[MaxResults], default: None ) –

    The maximum number of query logging associations that you want to return in the response to a ListResolverQueryLogConfigAssociations request. If you don't specify a value for MaxResults, Resolver returns up to 100 query logging associations.

  • next_token (Optional[NextToken], default: None ) –

    For the first ListResolverQueryLogConfigAssociations request, omit this value.

    If there are more than MaxResults query logging associations that match the values that you specify for Filters, you can submit another ListResolverQueryLogConfigAssociations request to get the next group of associations. In the next request, specify the value of NextToken from the previous response.

  • filters (Optional[Filters], default: None ) –

    An optional specification to return a subset of query logging associations.

    If you submit a second or subsequent ListResolverQueryLogConfigAssociations request and specify the NextToken parameter, you must use the same values for Filters, if any, as in the previous request.

  • sort_by (Optional[SortByKey], default: None ) –

    The element that you want Resolver to sort query logging associations by.

    If you submit a second or subsequent ListResolverQueryLogConfigAssociations request and specify the NextToken parameter, you must use the same value for SortBy, if any, as in the previous request.

    Valid values include the following elements:

    • CreationTime: The ID of the query logging association.

    • Error: If the value of Status is FAILED, the value of Error indicates the cause:

      • DESTINATION_NOT_FOUND: The specified destination (for example, an Amazon S3 bucket) was deleted.

      • ACCESS_DENIED: Permissions don't allow sending logs to the destination.

      If Status is a value other than FAILED, ERROR is null.

    • Id: The ID of the query logging association

    • ResolverQueryLogConfigId: The ID of the query logging configuration

    • ResourceId: The ID of the VPC that is associated with the query logging configuration

    • Status: The current status of the configuration. Valid values include the following:

      • CREATING: Resolver is creating an association between an Amazon VPC and a query logging configuration.

      • CREATED: The association between an Amazon VPC and a query logging configuration was successfully created. Resolver is logging queries that originate in the specified VPC.

      • DELETING: Resolver is deleting this query logging association.

      • FAILED: Resolver either couldn't create or couldn't delete the query logging association. Here are two common causes:

        • The specified destination (for example, an Amazon S3 bucket) was deleted.

        • Permissions don't allow sending logs to the destination.

  • sort_order (Optional[SortOrder], default: None ) –

    If you specified a value for SortBy, the order that you want query logging associations to be listed in, ASCENDING or DESCENDING.

    If you submit a second or subsequent ListResolverQueryLogConfigAssociations request and specify the NextToken parameter, you must use the same value for SortOrder, if any, as in the previous request.

Raises:

Source code in docs_src/capo_route53resolver/_services/route53_resolver.py
def list_resolver_query_log_config_associations(
    self,
    *,
    config_overrides: Optional[Route53ResolverClientConfig] = None,
    max_results: Optional[
        "capo_route53resolver.types.max_results.MaxResults"
    ] = None,
    next_token: Optional["capo_route53resolver.types.next_token.NextToken"] = None,
    filters: Optional["capo_route53resolver.types.filters.Filters"] = None,
    sort_by: Optional["capo_route53resolver.types.sort_by_key.SortByKey"] = None,
    sort_order: Optional["capo_route53resolver.types.sort_order.SortOrder"] = None,
) -> "capo_route53resolver.types.list_resolver_query_log_config_associations_response.ListResolverQueryLogConfigAssociationsResponse":
    """<p>Lists information about associations between Amazon VPCs and query logging configurations.</p>

    Args:
        max_results: <p>The maximum number of query logging associations that you want to return in the response to a <code>ListResolverQueryLogConfigAssociations</code> request. If you don't specify a value for <code>MaxResults</code>, Resolver returns up to 100 query logging associations. </p>
        next_token: <p>For the first <code>ListResolverQueryLogConfigAssociations</code> request, omit this value.</p> <p>If there are more than <code>MaxResults</code> query logging associations that match the values that you specify for <code>Filters</code>, you can submit another <code>ListResolverQueryLogConfigAssociations</code> request to get the next group of associations. In the next request, specify the value of <code>NextToken</code> from the previous response. </p>
        filters: <p>An optional specification to return a subset of query logging associations.</p> <note> <p>If you submit a second or subsequent <code>ListResolverQueryLogConfigAssociations</code> request and specify the <code>NextToken</code> parameter, you must use the same values for <code>Filters</code>, if any, as in the previous request.</p> </note>
        sort_by: <p>The element that you want Resolver to sort query logging associations by. </p> <note> <p>If you submit a second or subsequent <code>ListResolverQueryLogConfigAssociations</code> request and specify the <code>NextToken</code> parameter, you must use the same value for <code>SortBy</code>, if any, as in the previous request.</p> </note> <p>Valid values include the following elements:</p> <ul> <li> <p> <code>CreationTime</code>: The ID of the query logging association.</p> </li> <li> <p> <code>Error</code>: If the value of <code>Status</code> is <code>FAILED</code>, the value of <code>Error</code> indicates the cause: </p> <ul> <li> <p> <code>DESTINATION_NOT_FOUND</code>: The specified destination (for example, an Amazon S3 bucket) was deleted.</p> </li> <li> <p> <code>ACCESS_DENIED</code>: Permissions don't allow sending logs to the destination.</p> </li> </ul> <p>If <code>Status</code> is a value other than <code>FAILED</code>, <code>ERROR</code> is null.</p> </li> <li> <p> <code>Id</code>: The ID of the query logging association</p> </li> <li> <p> <code>ResolverQueryLogConfigId</code>: The ID of the query logging configuration</p> </li> <li> <p> <code>ResourceId</code>: The ID of the VPC that is associated with the query logging configuration</p> </li> <li> <p> <code>Status</code>: The current status of the configuration. Valid values include the following:</p> <ul> <li> <p> <code>CREATING</code>: Resolver is creating an association between an Amazon VPC and a query logging configuration.</p> </li> <li> <p> <code>CREATED</code>: The association between an Amazon VPC and a query logging configuration was successfully created. Resolver is logging queries that originate in the specified VPC.</p> </li> <li> <p> <code>DELETING</code>: Resolver is deleting this query logging association.</p> </li> <li> <p> <code>FAILED</code>: Resolver either couldn't create or couldn't delete the query logging association. Here are two common causes:</p> <ul> <li> <p>The specified destination (for example, an Amazon S3 bucket) was deleted.</p> </li> <li> <p>Permissions don't allow sending logs to the destination.</p> </li> </ul> </li> </ul> </li> </ul>
        sort_order: <p>If you specified a value for <code>SortBy</code>, the order that you want query logging associations to be listed in, <code>ASCENDING</code> or <code>DESCENDING</code>.</p> <note> <p>If you submit a second or subsequent <code>ListResolverQueryLogConfigAssociations</code> request and specify the <code>NextToken</code> parameter, you must use the same value for <code>SortOrder</code>, if any, as in the previous request.</p> </note>

    Raises:
        capo_route53resolver.errors.access_denied_exception.AccessDeniedException: <p>The current account doesn't have the IAM permissions required to perform the specified Resolver operation.</p> <p>This error can also be thrown when a customer has reached the 5120 character limit for a resource policy for CloudWatch Logs.</p>
        capo_route53resolver.errors.internal_service_error_exception.InternalServiceErrorException: <p>We encountered an unknown error. Try again in a few minutes.</p>
        capo_route53resolver.errors.invalid_parameter_exception.InvalidParameterException: <p>One or more parameters in this request are not valid.</p>
        capo_route53resolver.errors.invalid_request_exception.InvalidRequestException: <p>The request is invalid.</p>
        capo_route53resolver.errors.limit_exceeded_exception.LimitExceededException: <p>The request caused one or more limits to be exceeded.</p>
        capo_route53resolver.errors.throttling_exception.ThrottlingException: <p>The request was throttled. Try again in a few minutes.</p>
        capo_route53resolver.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    def _handler(
        req: "OperationRequest[capo_route53resolver.types.list_resolver_query_log_config_associations_request.ListResolverQueryLogConfigAssociationsRequest]",
    ) -> OperationResponse[
        "capo_route53resolver.types.list_resolver_query_log_config_associations_response.ListResolverQueryLogConfigAssociationsResponse"
    ]:
        import capo_route53resolver._operations.route53_resolver.list_resolver_query_log_config_associations

        output, http_response = (
            capo_route53resolver._operations.route53_resolver.list_resolver_query_log_config_associations.list_resolver_query_log_config_associations(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListResolverQueryLogConfigAssociations")
    )
    input_: capo_route53resolver.types.list_resolver_query_log_config_associations_request.ListResolverQueryLogConfigAssociationsRequest = {}
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token
    if filters is not None:
        input_["filters"] = filters
    if sort_by is not None:
        input_["sort_by"] = sort_by
    if sort_order is not None:
        input_["sort_order"] = sort_order

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