Search and investigate inventory certificates
After you turn on certificate inventory for organizations, you search and investigate it
with five read operations: SearchInventory,
ListInventoryUsages, ListInventoryRelatedResources,
ListInventoryFindings, and GetInventoryInsights. Send requests to
your organization's home AWS Region.
The three list operations take one certificate's identifier in
CertificateIdentifier. They fail with ResourceNotFoundException
if no certificate in the inventory has it, or if the organization has no inventory
configuration yet. All of these operations return whatever data the inventory holds, so
results can be empty while ProvisioningStatus is ENABLING. For
how turning off collection or trusted access affects them, see Turn off certificate inventory and Prerequisites.
The examples in this topic show JSON request bodies. All timestamps are in epoch seconds, the same as in other ACM operations. New values can be added to enumerations over time, so process the values that you recognize and don't fail on ones that you don't.
Topics
Search for certificates
SearchInventory returns certificate records that match a filter. If you
leave out Filter, every certificate in the inventory matches. If nothing
matches, the response has an empty Certificates list and a
TotalCount of 0 instead of an error.
Each record includes the following:
-
Identifier,MaterialType,Validity, andIdentity: the certificate's identifier, its material type, its validity period, and its subject and names. -
X509Details: the issuer, serial number, validity period, subject alternative names, key algorithm and key size, signature algorithm, and issuance type. For issuance types, see Issuance Type. -
UsageCount: how many places the certificate was observed in use when its record was last collected. For the current count, see Find where a certificate is deployed. -
HighestFindingSeverityandFindingCounts: the certificate's health, and the number of its open findings at each severity.FindingCountsis absent until the certificate's findings are evaluated. For more information, see Review certificate findings. -
RelatedResourceCount: how many ACM and AWS Private CA resources the certificate maps to, as counted when its record was last indexed. To list them, see Find the ACM and AWS Private CA resources for a certificate.
Results are sorted by SortBy and SortOrder. Ties are broken
by Identifier in ascending order. There's no relevance ranking.
SortBy-
The field to sort by:
NOT_AFTER(default),NOT_BEFORE,USAGE_COUNT,SUBJECT, orHIGHEST_FINDING_SEVERITY.SUBJECTsorts case-sensitively, character by character, and puts certificates without a subject last.HIGHEST_FINDING_SEVERITYsorts in severity order, withCRITICALfirst when descending, and always puts certificates whose findings aren't evaluated last. SortOrder-
The sort direction:
DESCENDING(default) orASCENDING. MaxResults-
The page size, from 1 through 100. The default is 25. For more information, see Page through results.
Look up one certificate
To look up a single certificate, use a filter that contains only the
Identifier predicate. For how to compute an identifier, see Certificate identifiers.
{ "Filter": { "Filter": { "Identifier": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" } }, "MaxResults": 1 }
The following response is abbreviated, and its values are examples:
{ "Certificates": [ { "Identifier": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "MaterialType": "X509_CERTIFICATE", "Validity": { "NotBefore": 1785542400, "NotAfter": 1817078400 }, "Identity": { "Subject": "CN=www.example.com", "Identifiers": ["www.example.com"] }, "UsageCount": 2, "HighestFindingSeverity": "HEALTHY", "FindingCounts": { "Critical": 0, "High": 0, "Medium": 0, "Low": 0, "Informational": 0 }, "RelatedResourceCount": 1, "X509Details": { "Issuer": "CN=Amazon RSA 2048 M02,O=Amazon,C=US", "SerialNumber": "0a1b2c3d4e5f60718293a4b5c6d7e8f9", "NotBefore": 1785542400, "NotAfter": 1817078400, "KeyAlgorithm": "RSA_2048", "KeySizeBits": 2048, "SignatureAlgorithm": "SHA256WITHRSA", "IssuanceType": "AMAZON_ISSUED", "SubjectAlternativeNames": ["www.example.com"] } } ], "TotalCount": 1, "TotalCountRelation": "EXACT" }
Count matching certificates
To count every certificate in your organization, call
GetInventoryInsights and read CertificateCount. For more
information, see Get organization-wide counts.
To count certificates that match a filter, call SearchInventory with
MaxResults set to 1 and read TotalCount, which counts
every match, not only the returned page. When TotalCountRelation is
AT_LEAST, TotalCount is a lower bound.
The following JSON request counts imported certificates that aren't in use in
account 111122223333:
{ "Filter": { "And": [ { "Filter": { "IssuanceType": "IMPORTED" } }, { "Filter": { "UsageStatus": "NOT_IN_USE" } }, { "Filter": { "AccountId": "111122223333" } } ] }, "MaxResults": 1 }
This request uses the following values:
-
IssuanceTypeis set toIMPORTEDto match imported certificates. -
UsageStatusis set toNOT_IN_USEto match certificates with no observed usage. -
For
AccountId, replace111122223333with your AWS account ID.
Build search filters
A filter is a statement that combines conditions. Each statement sets exactly one
member: Filter, a single predicate; And, which matches when
every statement in its list matches; Or, which matches when at least one
statement in its list matches; or Not, which matches when its inner
statement doesn't match.
Filter predicates
Each predicate sets exactly one of the following conditions:
AccountId-
Matches certificates with a related resource in this account. An account that isn't in your organization matches nothing.
AcmCertificateArn-
Matches certificates by the ARN of a related ACM certificate. Set
Valueto the ARN, andMatchtoCURRENTfor the certificate that the ACM certificate holds now, orANYfor every certificate that it has held across renewals and reimports. The ARN is compared exactly, including case. Domain-
Matches a domain name against the certificate's DNS subject alternative names and its subject common name. For matching rules, see Domain matching.
HighestFindingSeverity-
Matches certificates whose health is exactly this value:
CRITICAL,HIGH,MEDIUM,LOW,INFORMATIONAL,HEALTHY,NOT_APPLICABLE, orNOT_EVALUATED.NOT_EVALUATEDmatches exactly the certificates whose findings aren't evaluated yet. Identifier-
Matches one certificate. For an example, see Look up one certificate.
IssuanceType-
Matches the certificate's issuance type:
AMAZON_ISSUED(issued by ACM, including ACME and Amazon N2 certificates),PRIVATE_CA_ISSUED(issued by ACM from AWS Private CA),PRIVATE_CA_DIRECT(issued by AWS Private CA outside ACM),IMPORTED, orEXTERNAL(no AWS issuance observed in the inventory scope). This is the issuance type of the inventory certificate, not theIssuanceTypeof a related ACM certificate. Issuer-
Matches the issuer distinguished name (DN) exactly, as it appears in the certificate. A AWS Private CA ARN isn't accepted. To match by certificate authority ARN, use
PcaCertificateAuthorityArn. KeyAlgorithm-
Matches the certificate's key algorithm:
RSA_1024,RSA_2048,RSA_3072,RSA_4096,EC_prime256v1,EC_secp384r1,EC_secp521r1,ED25519,ED448, orOTHER.OTHERmatches certificates whose key algorithm the service can't identify. MaterialType-
Matches the certificate's material type. The only value is
X509_CERTIFICATE. NotAfter-
Matches certificates whose expiration time falls inside a range.
Afteris an inclusive lower bound, andBeforeis an exclusive upper bound. Both are in epoch seconds. Set at least one. If you set both,Beforemust be later thanAfter. PcaCertificateArn-
Matches the certificate that AWS Private CA issued with this certificate ARN. The ARN is compared exactly, including case.
PcaCertificateAuthorityArn-
Matches certificates by the ARN of a related AWS Private CA certificate authority. Set
Valueto the ARN, andRelationshiptoISSUED_BYfor the certificates that the certificate authority issued, orCA_CERTIFICATEfor the certificate authority's own certificate. The ARN is compared exactly, including case. Region-
Matches certificates with a related resource in this AWS Region, such as
aa-example-1. When you combineAccountIdandRegion, the account and Region don't have to come from the same related resource. RelatedResourceType-
Matches certificates that have a related resource of this type:
ACM_CERTIFICATE,PCA_CERTIFICATE, orPCA_CERTIFICATE_AUTHORITY. Usage target types, such asEKS_POD, aren't valid here. UsageStatus-
Matches certificates by whether they're observed in use. Set
IN_USEto match certificates that are observed in use, orNOT_IN_USEto match certificates with no observed usages.
Domain matching
The Domain predicate takes a Value and a
Match type. Matching is case-insensitive, and the following match types
are supported:
-
EQUALSmatches only that exact name. -
IN_DOMAINmatches the name and everything under it, label by label. For example,example.commatcheswww.example.comand*.example.com, but notnotexample.com. -
The inventory treats an asterisk as a literal label.
*.example.commatches only a certificate that has*.example.comas a name. It doesn't matchwww.example.com. Only the first label can be an asterisk.
Filter limits
The following table lists the size limits for a filter statement.
| Limit | Value |
|---|---|
Entries in an |
1 to 15 |
Nesting depth |
3 levels |
Predicates in one filter |
20 |
The request's Filter is level 1, and each statement inside an
And, Or, or Not is one level deeper. For
example, an And of Not statements that each hold a
predicate is 3 levels deep. A filter over any of these limits fails with
ValidationException.
Filter examples
Example – Find in-use certificates for example.com and its subdomains that expire before 2027-01-01, soonest first
{ "Filter": { "And": [ { "Filter": { "Domain": { "Value": "example.com", "Match": "IN_DOMAIN" } } }, { "Filter": { "NotAfter": { "Before": 1798761600 } } }, { "Filter": { "UsageStatus": "IN_USE" } } ] }, "SortBy": "NOT_AFTER", "SortOrder": "ASCENDING" }
Example – Find the certificates with the most severe findings first
{ "Filter": { "Or": [ { "Filter": { "HighestFindingSeverity": "CRITICAL" } }, { "Filter": { "HighestFindingSeverity": "HIGH" } } ] }, "SortBy": "HIGHEST_FINDING_SEVERITY", "SortOrder": "DESCENDING" }
Example – Find every certificate that an ACM certificate has held
{ "Filter": { "Filter": { "AcmCertificateArn": { "Value": "arn:aws:acm:aa-example-1:111122223333:certificate/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "Match": "ANY" } } } }
Example – Find certificates that use a 1024-bit RSA key or a key algorithm the service can't identify
To match other key algorithms, add a KeyAlgorithm predicate for each
value that you want to find, such as RSA_2048.
{ "Filter": { "Or": [ { "Filter": { "KeyAlgorithm": "RSA_1024" } }, { "Filter": { "KeyAlgorithm": "OTHER" } } ] } }
Find where a certificate is deployed
ListInventoryUsages lists every place a certificate is currently
observed in use.
{ "CertificateIdentifier": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" }
Each usage includes the following:
-
Target: where the certificate is deployed, as either anArn, such as the ARN of an Application Load Balancer or a Amazon CloudFront distribution, or, for a target without an ARN, aResourceIdentifierwith aResourceTypeand aValue. For an Amazon EKS pod that the AWS Workload Credentials Provider reports,ResourceTypeisEKS_POD, withasnamespace/pod-name/pod-UIDValue. Amazon EC2 instances and Amazon ECS tasks that the provider reports appear by ARN. -
LastObservedAt: when the inventory last recorded the certificate on that target, in epoch seconds. -
AccountIdandRegion: the account that holds the target and the target's Region, when they're known.Regionis absent for a global resource, such as a Amazon CloudFront distribution. For a usage that telemetry reports, they're the account whose credentials sent the telemetry and the Region it was sent to. -
AgentReported: for a usage that telemetry reports, how it was reported: thePortandServerNamethat discovery probed, or theCertificateArnof the ACM certificate that the provider deployed.
The inventory sorts results by target in ascending order. The response's
TotalCount is the authoritative usage count. The
UsageCount on a SearchInventory record is set when the record
is collected and can lag behind it.
Find the ACM and AWS Private CA resources for a certificate
ListInventoryRelatedResources lists every ACM certificate,
AWS Private CA certificate, and AWS Private CA certificate authority that an inventory
certificate maps to. A single inventory certificate can map to several ACM
certificates, for example when you import the same certificate more than once.
Related resources are always ACM or AWS Private CA resources. A certificate that only
the AWS Workload Credentials Provider reports, with the issuance type
EXTERNAL, has no related resources. To see where a certificate is deployed,
use the separate usages list described in Find where a certificate is deployed.
Each related resource includes a ResourceArn and a
ResourceType of ACM_CERTIFICATE,
PCA_CERTIFICATE, or PCA_CERTIFICATE_AUTHORITY. It can also
include the following:
-
IssuanceType: for an ACM certificate, how ACM holds the certificate. -
AssociationStatus: for an ACM certificate,CURRENTif the ACM certificate holds this certificate now, orREPLACEDif a renewal or reimport replaced it. For more information, see Certificate Series. -
Metadata: what ACM or AWS Private CA reported for the resource when the inventory last read it, with the time of that read inUpdatedAt. For an ACM certificate, theAcmCertificatemember holds whatDescribeCertificatereturned, such as renewal eligibility and status, the export option, the managing service, the validation method, and the ACME endpoint ARN. For a certificate authority, thePcaCertificateAuthoritymember holds whatDescribeCertificateAuthorityreturned, such as its status, type, and usage mode.Metadatais absent for a AWS Private CA certificate, and when the inventory hasn't read the resource.
Metadata is a stored copy, not a live read. It describes the resource
named by ResourceArn, so for a certificate whose
AssociationStatus is REPLACED, it describes the certificate
that the ACM certificate holds now. Before you act on a resource, read it with
ACM or AWS Private CA in the account that owns it.
The inventory sorts results by ResourceArn in ascending
order.
Review certificate findings
A finding is a problem that the inventory found with an ACM certificate and that you can fix. The inventory evaluates findings for each ACM certificate across its renewals, which is its certificate series, so a finding describes the ACM certificate rather than one certificate in it. A rule that passes or doesn't apply produces no finding. For more information, see Certificate Series.
Findings are always evaluated, and you can't turn them off. The inventory evaluates them for ACM certificates: certificates that ACM issued, including through ACME, and imported certificates. Each finding comes from one of the following rules.
| Rule | Raised when | Severity |
|---|---|---|
|
No current certificate in the series is valid, because each one is expired, revoked, not yet valid, or pending, and the series is in use. |
|
|
ACM hasn't renewed the series while it's in use, starting 3 days after renewal should have begun. That's 57 days before expiration for private certificates and for public certificates valid for more than 200 days, and 42 days before expiration for other public certificates. |
|
|
ACM doesn't renew the series' certificate, because it was imported or issued through ACME, and it expires within 45 days. For a certificate valid for less than 141 days, the window is a third of its validity minus 2 days, and for an ACME certificate it's at most 25 days. The rule doesn't apply to a certificate valid for 51 days or less. |
|
|
No current certificate in the series has an observed usage. The
finding's |
|
|
A resource uses a certificate in the series that's expired or revoked, while another current certificate in the series is valid. |
|
A finding's severity can rise as the certificate nears expiration. When it does, the
finding is returned with its new severity and the same FindingId.
EXPIRING_SOON covers only certificates that ACM doesn't renew. To find
every certificate that expires soon, use the NotAfter predicate or the
EXPIRY_WINDOW aggregate.
Certificate health
Each certificate's HighestFindingSeverity is its health: the highest
severity among the open findings of the series that it's current in, from
CRITICAL through INFORMATIONAL. The other values are the
following:
-
HEALTHY: rules apply to the certificate, and it has no open findings. -
NOT_APPLICABLE: no rule applies to the certificate, for example because AWS Private CA issued it directly, it comes only from telemetry, or no ACM certificate holds it now. -
NOT_EVALUATED: the certificate's findings aren't evaluated yet.
To find certificates by health, use the HighestFindingSeverity
predicate, or sort by HIGHEST_FINDING_SEVERITY. To count them, use the
HIGHEST_FINDING_SEVERITY aggregate. For more information, see Get organization-wide counts.
List a certificate's findings
ListInventoryFindings lists the open findings for one certificate. To
list only the findings of one severity, set Severity.
{ "CertificateIdentifier": "4dbdc28afef36601b8392355eaac300afabdaed5951ddecdbef751e0c89afb81" }
Each finding includes the following:
-
FindingId: an identifier that stays the same for the same rule and series across evaluations and pages, so you can recognize a finding that's returned again. Don't parse it. -
RuleIdandSeverity: the rule that raised the finding, and how severe it is. -
Scope: what the rule evaluated. ItsSeriesmember names the ACM certificate byCertificateArn,AccountId, andRegion. -
Reason: why the rule fired, forNO_USAGE_EVIDENCEonly. -
Expected,Actual, andRemediation: what the rule requires, what it found, and how to fix it, when the rule describes them. -
EvaluatedAt: when the finding was opened or its content, including its severity, last changed.
The following response is abbreviated, and its values are examples:
{ "Findings": [ { "FindingId": "3k9x2m7q4w8z1n5r", "CertificateIdentifier": "4dbdc28afef36601b8392355eaac300afabdaed5951ddecdbef751e0c89afb81", "RuleId": "EXPIRING_SOON", "Severity": "HIGH", "Scope": { "Series": { "CertificateArn": "arn:aws:acm:aa-example-1:111122223333:certificate/a1b2c3d4-5678-90ab-cdef-EXAMPLE11111", "AccountId": "111122223333", "Region": "aa-example-1" } }, "EvaluatedAt": 1792522800 } ], "HighestFindingSeverity": "HIGH", "TotalCount": 1, "TotalCountRelation": "EXACT" }
The response also includes the certificate's HighestFindingSeverity.
The inventory sorts findings by severity, highest first, then by
RuleId. If a finding changes while you page, for example if its severity
rises, it's returned again with its new values on the next page, with the same
FindingId.
Get organization-wide counts
GetInventoryInsights returns the number of certificates in your whole
organization in CertificateCount, and counts grouped by the aggregates that
you request. To count certificates that match a filter, use
SearchInventory instead, as described in Count matching certificates.
In RequestedAggregates, list up to 25 aggregates. Each entry selects one
aggregate and takes an options object. An empty list returns only
CertificateCount. An aggregate that appears more than once fails with
ValidationException.
| Request member | Result Aggregate |
Groups certificates by |
|---|---|---|
|
|
Days until expiration, in fixed windows |
|
|
Certificate health. Certificates whose findings aren't
evaluated count under |
|
|
Whether the certificate is observed in use. Group values are
|
|
|
The certificate's issuance type |
|
|
The certificate's key algorithm |
|
|
Region code |
The following JSON request asks for the expiration counts:
{ "RequestedAggregates": [ { "ExpiryWindow": {} } ] }
The response includes CertificateCount, when it was last recomputed in
UpdatedAt, and one result in Aggregates for each requested
aggregate, in request order:
{ "CertificateCount": 480, "UpdatedAt": 1792522800, "Aggregates": [ { "Aggregate": "EXPIRY_WINDOW", "Status": "COMPLETE", "UpdatedAt": 1792522800, "Groups": [ { "Count": 12, "MaxDays": -1 }, { "Count": 24, "MinDays": 0, "MaxDays": 7 }, { "Count": 61, "MinDays": 8, "MaxDays": 30 }, { "Count": 93, "MinDays": 31, "MaxDays": 60 }, { "Count": 110, "MinDays": 61, "MaxDays": 90 }, { "Count": 180, "MinDays": 91 } ] } ] }
When you read the results, keep the following in mind:
-
The service precomputes the counts, so
UpdatedAton the response and on each aggregate result can be earlier than your request. -
EXPIRY_WINDOWalways returns six groups in window order, including empty ones: expired (MaxDays-1), 0 to 7 days, 8 to 30 days, 31 to 60 days, 61 to 90 days, and 91 days or more. Days are whole days from the result'sUpdatedAtto the certificate's expiration, rounded down. Both bounds are inclusive. -
The other aggregates leave out empty groups, sort groups by
Countin descending order and then byValue, and return at most 100 groups.OtherCountholds the count for the groups that weren't returned. -
With
GroupByset toCERTIFICATE_TYPE, theHIGHEST_FINDING_SEVERITYresult also hasCertificateTypeGroups: one entry for each certificate type that has certificates (ACME,IMPORTED,OTHER,PRIVATE_TLS, orPUBLIC_TLS), with itsCertificateCountand its own health groups. -
If the precomputed counts for an aggregate aren't ready, that aggregate has a
StatusofFAILEDand noGroups, while the other aggregates still return. Try again later. Until the first counts are computed, for example whileProvisioningStatusisENABLING,CertificateCountis 0 andUpdatedAtis absent.
Page through results
SearchInventory, ListInventoryUsages,
ListInventoryRelatedResources, and ListInventoryFindings
return results in pages and accept MaxResults and NextToken.
GetInventoryInsights isn't paginated.
-
MaxResultssets the page size only, not how many results exist in total. It accepts 1 through 100, and the default is 25. -
If more results might remain, the response includes
NextToken. Keep paging until a response has noNextToken, and don't use the number of results on a page to decide whether you're done. A page can have fewer results thanMaxResults, or none. -
To get the next page, pass
NextTokenback unchanged, with the sameFilter,SortBy, andSortOrder, or with the sameCertificateIdentifierandSeverity. A token works only with the request that returned it. If you change any of these members, or the token is malformed, the call fails withValidationException. Start again from the first page.Pagination tokens don't expire.
-
Each response includes
TotalCountfor the full result set, with aTotalCountRelationofEXACTor, for a lower bound,AT_LEAST. -
Pagination doesn't use a snapshot. If an item's sort value changes while you're paging, you might miss it or see it twice.
ListInventoryFindingsis the exception: it returns a finding that changed while you paged again, with its new values.