Skip to content

associate_distribution_tenant_web_acl async

associate_distribution_tenant_web_acl(
    id: string,
    web_acl_arn: string,
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    if_match: Optional[string] = None,
) -> AssociateDistributionTenantWebACLResult

Associates the WAF web ACL with a distribution tenant.

Parameters:

  • id (string) –

    The ID of the distribution tenant.

  • web_acl_arn (string) –

    The Amazon Resource Name (ARN) of the WAF web ACL to associate.

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

    The current ETag of the distribution tenant. This value is returned in the response of the GetDistributionTenant API operation.

Raises:

Source code in docs_src/capo_cloudfront/_services/async_cloud_front.py
async def associate_distribution_tenant_web_acl(
    self,
    id: "capo_cloudfront.types.string.string",
    web_acl_arn: "capo_cloudfront.types.string.string",
    *,
    config_overrides: Optional[AsyncCloudFrontClientConfig] = None,
    if_match: Optional["capo_cloudfront.types.string.string"] = None,
) -> "capo_cloudfront.types.associate_distribution_tenant_web_acl_result.AssociateDistributionTenantWebACLResult":
    """<p>Associates the WAF web ACL with a distribution tenant.</p>

    Args:
        id: <p>The ID of the distribution tenant.</p>
        web_acl_arn: <p>The Amazon Resource Name (ARN) of the WAF web ACL to associate.</p>
        if_match: <p>The current <code>ETag</code> of the distribution tenant. This value is returned in the response of the <code>GetDistributionTenant</code> API operation.</p>

    Raises:
        capo_cloudfront.errors.access_denied.AccessDenied: <p>Access denied.</p>
        capo_cloudfront.errors.entity_limit_exceeded.EntityLimitExceeded: <p>The entity limit has been exceeded.</p>
        capo_cloudfront.errors.entity_not_found.EntityNotFound: <p>The entity was not found.</p>
        capo_cloudfront.errors.invalid_argument.InvalidArgument: <p>An argument is invalid.</p>
        capo_cloudfront.errors.invalid_if_match_version.InvalidIfMatchVersion: <p>The <code>If-Match</code> version is missing or not valid.</p>
        capo_cloudfront.errors.precondition_failed.PreconditionFailed: <p>The precondition in one or more of the request fields evaluated to <code>false</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.associate_distribution_tenant_web_acl_request.AssociateDistributionTenantWebACLRequest]",
    ) -> AsyncOperationResponse[
        "capo_cloudfront.types.associate_distribution_tenant_web_acl_result.AssociateDistributionTenantWebACLResult"
    ]:
        import capo_cloudfront._operations.cloudfront2020_05_31.associate_distribution_tenant_web_acl

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

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("AssociateDistributionTenantWebACL")
    )
    input_: capo_cloudfront.types.associate_distribution_tenant_web_acl_request.AssociateDistributionTenantWebACLRequest = {
        "id": id,
        "web_acl_arn": web_acl_arn,
    }
    if if_match is not None:
        input_["if_match"] = if_match

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