get_inventory_insights
¶
get_inventory_insights(
requested_aggregates: InventoryAggregateRequestList,
*,
config_overrides: Optional[ACMClientConfig] = 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:
-
AccessDeniedException–You do not have access required to perform this action.
-
InternalServerException–The request processing has failed because of an unknown error, exception, or failure.
-
ThrottlingException–The request was denied because it exceeded a quota.
-
ValidationException–The supplied input failed to satisfy constraints of an Amazon Web Services service.
-
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.
>>> 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.
>>> 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.
>>> 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.
>>> 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.
>>> client.get_inventory_insights(requested_aggregates=[{'IssuanceType': {}}, {'IssuanceType': {}}])
Source code in docs_src/capo_acm/_services/acm.py
1433 1434 1435 1436 1437 1438 1439 1440 1441 1442 1443 1444 1445 1446 1447 1448 1449 1450 1451 1452 1453 1454 1455 1456 1457 1458 1459 1460 1461 1462 1463 1464 1465 1466 1467 1468 1469 1470 1471 1472 1473 1474 1475 1476 1477 1478 1479 1480 1481 1482 1483 1484 1485 1486 1487 1488 1489 1490 1491 1492 1493 1494 1495 1496 1497 1498 1499 1500 1501 | |