Skip to content

get_inventory_insights async

get_inventory_insights(
    requested_aggregates: InventoryAggregateRequestList,
    *,
    config_overrides: Optional[AsyncACMClientConfig] = None,
) -> GetInventoryInsightsOutput

Returns certificate counts from Certificate inventory for organizations, broken down by the requested aggregates. The certificate inventory is the set of certificates observed in the organization's accounts. An aggregate groups the count by one property, such as Region or key algorithm. Every aggregate except EXPIRY_WINDOW is ranked: it lists groups largest first and omits empty groups. The counts are precomputed, so the response and each aggregate result carry their own UpdatedAt, which can be earlier than the request. For a count under any other filter, use SearchInventory, whose TotalCount is computed at query time. Each aggregate is computed on its own, so one aggregate can be FAILED while the others are COMPLETE. Before the first PutInventoryConfiguration call, and while ProvisioningStatus is ENABLING, the counts might not be computed yet. Until they are, CertificateCount is 0 and UpdatedAt is absent. Ranked aggregates are COMPLETE with an empty Groups list. EXPIRY_WINDOW is FAILED until the first daily EXPIRY_WINDOW computation has run. While Status is DISABLED, retained data is served until retention removes it. 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. GetInventoryInsights does not return ResourceNotFoundException. Before the first PutInventoryConfiguration call, only the management account can call it; a delegated administrator receives AccessDeniedException. A repeated aggregate returns ValidationException. An entry that selects no aggregate, or more than one, also returns ValidationException.

Parameters:

  • requested_aggregates (InventoryAggregateRequestList) –

    The aggregates to return, 0 to 25 entries. CertificateCount is always returned and needs no entry, so an empty list returns CertificateCount with an empty Aggregates list. Each aggregate can appear at most once. A repeated aggregate, or an aggregate the service does not support, returns ValidationException.

Raises:

Examples:

Summarize certificate expiry, issuance type, and usage across the organization The counts are precomputed, so UpdatedAt can be earlier than the request. EXPIRY_WINDOW is computed once a day, so it can be older than the other aggregates. EXPIRY_WINDOW returns all six groups, including the empty 0 to 7 day group. Its counts sum to CertificateCount. ISSUANCE_TYPE and IN_USE list only non-empty groups, largest first.

>>> await client.get_inventory_insights(requested_aggregates=[{'ExpiryWindow': {}}, {'IssuanceType': {}}, {'InUse': {}}])
Count certificates by their highest open finding severity
HIGHEST_FINDING_SEVERITY lists only non-empty groups, largest first, with ties ordered by Value. Twenty certificates have not had their findings evaluated yet. They are counted in NOT_EVALUATED, so the groups sum to CertificateCount.
>>> await client.get_inventory_insights(requested_aggregates=[{'HighestFindingSeverity': {}}])
Count certificates by highest open finding severity for each certificate type
GroupBy CERTIFICATE_TYPE adds CertificateTypeGroups, ordered alphabetically by CertificateType value. Each type's severity groups are ranked like Groups. Groups still counts all types together. Four certificates have not had their findings evaluated yet: one IMPORTED, one PRIVATE_TLS, and two PUBLIC_TLS certificates. They are counted in NOT_EVALUATED, both in Groups and in their type's groups, so each type's groups sum to its CertificateCount.
>>> await client.get_inventory_insights(requested_aggregates=[{'HighestFindingSeverity': {'GroupBy': 'CERTIFICATE_TYPE'}}])
Read insights before the first EXPIRY_WINDOW computation
The inventory was enabled just now, and no counts have been computed, so CertificateCount is 0 and UpdatedAt is absent. The first daily EXPIRY_WINDOW computation has not run, so EXPIRY_WINDOW is FAILED with no Groups and no UpdatedAt. REGION is COMPLETE with an empty Groups list, because no certificate has been counted yet.
>>> await client.get_inventory_insights(requested_aggregates=[{'ExpiryWindow': {}}, {'Region': {}}])
Request the same aggregate twice
The second entry repeats ISSUANCE_TYPE, so the request is rejected and names the repeated entry.
>>> await client.get_inventory_insights(requested_aggregates=[{'IssuanceType': {}}, {'IssuanceType': {}}])
Source code in docs_src/capo_acm/_services/async_acm.py
async def get_inventory_insights(
    self,
    requested_aggregates: "capo_acm.types.inventory_aggregate_request_list.InventoryAggregateRequestList",
    *,
    config_overrides: Optional[AsyncACMClientConfig] = None,
) -> "capo_acm.types.get_inventory_insights_output.GetInventoryInsightsOutput":
    """Returns certificate counts from Certificate inventory for organizations, broken down by the requested aggregates. The certificate inventory is the set of certificates observed in the organization's accounts. An aggregate groups the count by one property, such as Region or key algorithm. Every aggregate except EXPIRY_WINDOW is ranked: it lists groups largest first and omits empty groups. The counts are precomputed, so the response and each aggregate result carry their own UpdatedAt, which can be earlier than the request. For a count under any other filter, use SearchInventory, whose TotalCount is computed at query time. Each aggregate is computed on its own, so one aggregate can be FAILED while the others are COMPLETE. Before the first PutInventoryConfiguration call, and while ProvisioningStatus is ENABLING, the counts might not be computed yet. Until they are, CertificateCount is 0 and UpdatedAt is absent. Ranked aggregates are COMPLETE with an empty Groups list. EXPIRY_WINDOW is FAILED until the first daily EXPIRY_WINDOW computation has run. While Status is DISABLED, retained data is served until retention removes it. 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. GetInventoryInsights does not return ResourceNotFoundException. Before the first PutInventoryConfiguration call, only the management account can call it; a delegated administrator receives AccessDeniedException. A repeated aggregate returns ValidationException. An entry that selects no aggregate, or more than one, also returns ValidationException.

    Args:
        requested_aggregates: The aggregates to return, 0 to 25 entries. CertificateCount is always returned and needs no entry, so an empty list returns CertificateCount with an empty Aggregates list. Each aggregate can appear at most once. A repeated aggregate, or an aggregate the service does not support, returns ValidationException.

    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.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:
        Summarize certificate expiry, issuance type, and usage across the organization
        The counts are precomputed, so UpdatedAt can be earlier than the request. EXPIRY_WINDOW is computed once a day, so it can be older than the other aggregates. EXPIRY_WINDOW returns all six groups, including the empty 0 to 7 day group. Its counts sum to CertificateCount. ISSUANCE_TYPE and IN_USE list only non-empty groups, largest first.

        >>> await client.get_inventory_insights(requested_aggregates=[{'ExpiryWindow': {}}, {'IssuanceType': {}}, {'InUse': {}}])
        Count certificates by their highest open finding severity
        HIGHEST_FINDING_SEVERITY lists only non-empty groups, largest first, with ties ordered by Value. Twenty certificates have not had their findings evaluated yet. They are counted in NOT_EVALUATED, so the groups sum to CertificateCount.

        >>> await client.get_inventory_insights(requested_aggregates=[{'HighestFindingSeverity': {}}])
        Count certificates by highest open finding severity for each certificate type
        GroupBy CERTIFICATE_TYPE adds CertificateTypeGroups, ordered alphabetically by CertificateType value. Each type's severity groups are ranked like Groups. Groups still counts all types together. Four certificates have not had their findings evaluated yet: one IMPORTED, one PRIVATE_TLS, and two PUBLIC_TLS certificates. They are counted in NOT_EVALUATED, both in Groups and in their type's groups, so each type's groups sum to its CertificateCount.

        >>> await client.get_inventory_insights(requested_aggregates=[{'HighestFindingSeverity': {'GroupBy': 'CERTIFICATE_TYPE'}}])
        Read insights before the first EXPIRY_WINDOW computation
        The inventory was enabled just now, and no counts have been computed, so CertificateCount is 0 and UpdatedAt is absent. The first daily EXPIRY_WINDOW computation has not run, so EXPIRY_WINDOW is FAILED with no Groups and no UpdatedAt. REGION is COMPLETE with an empty Groups list, because no certificate has been counted yet.

        >>> await client.get_inventory_insights(requested_aggregates=[{'ExpiryWindow': {}}, {'Region': {}}])
        Request the same aggregate twice
        The second entry repeats ISSUANCE_TYPE, so the request is rejected and names the repeated entry.

        >>> await client.get_inventory_insights(requested_aggregates=[{'IssuanceType': {}}, {'IssuanceType': {}}])
    """

    async def _handler(
        req: "AsyncOperationRequest[capo_acm.types.get_inventory_insights_input.GetInventoryInsightsInput]",
    ) -> AsyncOperationResponse[
        "capo_acm.types.get_inventory_insights_output.GetInventoryInsightsOutput"
    ]:
        import capo_acm._operations.certificate_manager.get_inventory_insights

        (
            output,
            http_response,
        ) = await capo_acm._operations.certificate_manager.get_inventory_insights.async_get_inventory_insights(
            req.options, req.input
        )
        return AsyncOperationResponse(output=output, response=http_response)

    interceptors_, options_ = self.operation_options(
        config_overrides, OperationLogging("GetInventoryInsights")
    )
    input_: capo_acm.types.get_inventory_insights_input.GetInventoryInsightsInput = {
        "requested_aggregates": requested_aggregates
    }

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