Skip to content

list_inventory_usages

list_inventory_usages(
    certificate_identifier: ContentHashIdentifier,
    *,
    config_overrides: Optional[ACMClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> ListInventoryUsagesOutput

Lists the places where one certificate was observed in use, such as load balancers and Amazon CloudFront distributions. Returns one page of usages and the total number of usages. Usages are sorted by target, in ascending order. To read the next page, repeat the request with the NextToken from the previous response and the same CertificateIdentifier. A NextToken from a request for a different certificate returns ValidationException. The caller must be the organization's management account or its delegated administrator. If the caller's account is not in an organization, or the caller is neither of these accounts, the operation returns AccessDeniedException. The message names the unmet condition. The operation returns ResourceNotFoundException before the first PutInventoryConfiguration call. Until then, only the management account can call it; a delegated administrator receives AccessDeniedException. It also returns ResourceNotFoundException when the inventory has no certificate with the identifier.

Parameters:

  • certificate_identifier (ContentHashIdentifier) –

    The identifier of the certificate whose usages to list, as SearchInventory returns it.

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

    The maximum number of usages to return, 1 to 100. Defaults to 25.

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

    The NextToken from the previous response, to read the next page.

Raises:

Examples:

List where a certificate is used The certificate is attached to an Application Load Balancer and an Amazon CloudFront distribution.

>>> client.list_inventory_usages(certificate_identifier='3f8a2c1d9b7e6f504a3c2b1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e91', max_results=25)
List the usages of a certificate the inventory has not observed
No certificate in the organization's inventory has this identifier.
>>> client.list_inventory_usages(certificate_identifier='9c1e4b7a2d5f8036e9b2c5f8a1d4e7b0c3f6a9d2e5b8c1f4a7d0e3b6c9f2a5d8')
Source code in docs_src/capo_acm/_services/acm.py
def list_inventory_usages(
    self,
    certificate_identifier: "capo_acm.types.content_hash_identifier.ContentHashIdentifier",
    *,
    config_overrides: Optional[ACMClientConfig] = None,
    max_results: Optional[int] = None,
    next_token: Optional[str] = None,
) -> "capo_acm.types.list_inventory_usages_output.ListInventoryUsagesOutput":
    """Lists the places where one certificate was observed in use, such as load balancers and Amazon CloudFront distributions. Returns one page of usages and the total number of usages. Usages are sorted by target, in ascending order. To read the next page, repeat the request with the NextToken from the previous response and the same CertificateIdentifier. A NextToken from a request for a different certificate returns ValidationException. The caller must be the organization's management account or its delegated administrator. If the caller's account is not in an organization, or the caller is neither of these accounts, the operation returns AccessDeniedException. The message names the unmet condition. The operation returns ResourceNotFoundException before the first PutInventoryConfiguration call. Until then, only the management account can call it; a delegated administrator receives AccessDeniedException. It also returns ResourceNotFoundException when the inventory has no certificate with the identifier.

    Args:
        certificate_identifier: The identifier of the certificate whose usages to list, as SearchInventory returns it.
        max_results: The maximum number of usages to return, 1 to 100. Defaults to 25.
        next_token: The NextToken from the previous response, to read the next page.

    Raises:
        capo_acm.errors.access_denied_exception.AccessDeniedException: <p>You do not have access required to perform this action.</p>
        capo_acm.errors.internal_server_exception.InternalServerException: <p>The request processing has failed because of an unknown error, exception, or failure.</p>
        capo_acm.errors.resource_not_found_exception.ResourceNotFoundException: <p>The specified certificate cannot be found in the caller's account or the caller's account cannot be found.</p>
        capo_acm.errors.throttling_exception.ThrottlingException: <p>The request was denied because it exceeded a quota.</p>
        capo_acm.errors.validation_exception.ValidationException: <p>The supplied input failed to satisfy constraints of an Amazon Web Services service.</p>
        capo_acm.errors.UnknownServiceError: The service returned an error code this client does not model.

    Examples:
        List where a certificate is used
        The certificate is attached to an Application Load Balancer and an Amazon CloudFront distribution.

        >>> client.list_inventory_usages(certificate_identifier='3f8a2c1d9b7e6f504a3c2b1d0e9f8a7b6c5d4e3f2a1b0c9d8e7f6a5b4c3d2e91', max_results=25)
        List the usages of a certificate the inventory has not observed
        No certificate in the organization's inventory has this identifier.

        >>> client.list_inventory_usages(certificate_identifier='9c1e4b7a2d5f8036e9b2c5f8a1d4e7b0c3f6a9d2e5b8c1f4a7d0e3b6c9f2a5d8')
    """

    def _handler(
        req: "OperationRequest[capo_acm.types.list_inventory_usages_input.ListInventoryUsagesInput]",
    ) -> OperationResponse[
        "capo_acm.types.list_inventory_usages_output.ListInventoryUsagesOutput"
    ]:
        import capo_acm._operations.certificate_manager.list_inventory_usages

        output, http_response = (
            capo_acm._operations.certificate_manager.list_inventory_usages.list_inventory_usages(
                req.options, req.input
            )
        )
        return OperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("ListInventoryUsages")
    )
    input_: capo_acm.types.list_inventory_usages_input.ListInventoryUsagesInput = {
        "certificate_identifier": certificate_identifier
    }
    if max_results is not None:
        input_["max_results"] = max_results
    if next_token is not None:
        input_["next_token"] = next_token

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