Skip to content

list_distributions_by_web_acl_id async

list_distributions_by_web_acl_id(
    web_acl_id: string,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    marker: Optional[string] = None,
    max_items: Optional[integer] = None,
) -> ListDistributionsByWebACLIdResult

List the distributions that are associated with a specified WAF web ACL.

Parameters:

  • marker (Optional[string], default: None ) –

    Use Marker and MaxItems to control pagination of results. If you have more than MaxItems distributions that satisfy the request, the response includes a NextMarker element. To get the next page of results, submit another request. For the value of Marker, specify the value of NextMarker from the last response. (For the first request, omit Marker.)

  • max_items (Optional[integer], default: None ) –

    The maximum number of distributions that you want CloudFront to return in the response body. The maximum and default values are both 100.

  • web_acl_id (string) –

    The ID of the WAF web ACL that you want to list the associated distributions. If you specify "null" for the ID, the request returns a list of the distributions that aren't associated with a web ACL.

    For WAFV2, this is the ARN of the web ACL, such as arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

    For WAF Classic, this is the ID of the web ACL, such as a1b2c3d4-5678-90ab-cdef-EXAMPLE11111.

Raises:

  • InvalidArgument –

    An argument is invalid.

  • InvalidWebACLId –

    A web ACL ID specified is not valid. To specify a web ACL created using the latest version of WAF, use the ACL ARN, for example arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a. To specify a web ACL created using WAF Classic, use the ACL ID, for example 473e64fd-f30b-4765-81a0-62ad96dd167a.

  • UnknownServiceError –

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

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def list_distributions_by_web_acl_id(
    self,
    web_acl_id: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    marker: Optional["capo_cloudfront.types.string.string"] = None,
    max_items: Optional["capo_cloudfront.types.integer.integer"] = None,
) -> "capo_cloudfront.types.list_distributions_by_web_acl_id_result.ListDistributionsByWebACLIdResult":
    """<p>List the distributions that are associated with a specified WAF web ACL.</p>

    Args:
        marker: <p>Use <code>Marker</code> and <code>MaxItems</code> to control pagination of results. If you have more than <code>MaxItems</code> distributions that satisfy the request, the response includes a <code>NextMarker</code> element. To get the next page of results, submit another request. For the value of <code>Marker</code>, specify the value of <code>NextMarker</code> from the last response. (For the first request, omit <code>Marker</code>.)</p>
        max_items: <p>The maximum number of distributions that you want CloudFront to return in the response body. The maximum and default values are both 100.</p>
        web_acl_id: <p>The ID of the WAF web ACL that you want to list the associated distributions. If you specify "null" for the ID, the request returns a list of the distributions that aren't associated with a web ACL. </p> <p>For WAFV2, this is the ARN of the web ACL, such as <code>arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>.</p> <p>For WAF Classic, this is the ID of the web ACL, such as <code>a1b2c3d4-5678-90ab-cdef-EXAMPLE11111</code>.</p>

    Raises:
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_web_acl_id.InvalidWebACLId: <p>A web ACL ID specified is not valid. To specify a web ACL created using the latest version of WAF, use the ACL ARN, for example <code>arn:aws:wafv2:us-east-1:123456789012:global/webacl/ExampleWebACL/473e64fd-f30b-4765-81a0-62ad96dd167a</code>. To specify a web ACL created using WAF Classic, use the ACL ID, for example <code>473e64fd-f30b-4765-81a0-62ad96dd167a</code>.</p>
        capo_cloudfront.errors.UnknownServiceError: The service returned an error code this client does not model.
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_cloudfront.types.list_distributions_by_web_acl_id_request.ListDistributionsByWebACLIdRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.list_distributions_by_web_acl_id_result.ListDistributionsByWebACLIdResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.list_distributions_by_web_acl_id

        (
            output,
            http_response,
        ) = await capo_cloudfront._operations.cloudfront2020_05_31.list_distributions_by_web_acl_id.async_list_distributions_by_web_acl_id(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    def _redact_output(
        output: "capo_cloudfront.types.list_distributions_by_web_acl_id_result.ListDistributionsByWebACLIdResult",
    ) -> dict[str, Any]:
        import capo_cloudfront.types.list_distributions_by_web_acl_id_result

        return capo_cloudfront.types.list_distributions_by_web_acl_id_result.redact_sensitive(
            output
        )

    interceptors_, options_ = self.operation_options(
        config_overrides,
        OperationLogging(
            "ListDistributionsByWebACLId", redact_output=_redact_output
        ),
    )
    input_: capo_cloudfront.types.list_distributions_by_web_acl_id_request.ListDistributionsByWebACLIdRequest = {
        "web_acl_id": web_acl_id
    }
    if marker is not None:
        input_["marker"] = marker
    if max_items is not None:
        input_["max_items"] = max_items

    response = await aexecute_pipeline(
        AsyncOperationRequest(input=input_, options=options_),
        handler=_handler,
        interceptors=list(interceptors_),
    )
    await response.response.aclose()
    return response.output