简体   繁体   中英

I would like if there is way to find all the ACM certs using aws acm list-certificates along with validity and domain name

I would like if there is way to find all the ACM certs using aws acm list-certificates along with validity and domain name.Because i am looking to find the cert information which are less 30days.

Thanks, Kalyan

You can't do it with just list-certificates , you also need describe-certificate :

for c in $(aws acm list-certificates --query 'CertificateSummaryList[].CertificateArn' --output text)
    do aws acm describe-certificate --certificate-arn $c --query 'Certificate.[CertificateArn,DomainName,Status,NotAfter]'
    done

If you run this you'll see the information about all of your certificates in the region, with the domains they cover and expiration timestamp. Note that the expiration timestamp is a UNIX timestamp (seconds since epoch), not a date.

Given that you want to test the timestamp, I'd recommend using a language such as Python rather than stringing together CLI invocations.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM