Last active
March 24, 2022 15:41
-
-
Save mdgreenwald/4adfb7b46997936f6b547f503a43f3f8 to your computer and use it in GitHub Desktop.
List AWS ACM Certificates with Issuer and Validation Method
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
aws acm list-certificates | jq -r '[.CertificateSummaryList[].CertificateArn] | @csv' > tmp.csv | |
N=0 | |
ARR=() | |
IFS="," | |
while read STR | |
do | |
set -- $STR | |
while [ "$#" -gt 0 ] | |
do | |
ARR[$N]="$1" | |
((N++)) | |
shift | |
done | |
done < tmp.csv | |
rm -rf tmp.csv | |
for i in "${!ARR[@]}"; do | |
aws acm describe-certificate --certificate-arn "${ARR[i]//\"}" | jq '. | {CertificateArn: .Certificate.CertificateArn,DomainName: .Certificate.DomainName, Type: .Certificate.Type, ValidationMethod: .Certificate.DomainValidationOptions[0].ValidationMethod, InUseBy: .Certificate.InUseBy}' | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment