Skip to content

Instantly share code, notes, and snippets.

@mdgreenwald
Last active March 24, 2022 15:41
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mdgreenwald/4adfb7b46997936f6b547f503a43f3f8 to your computer and use it in GitHub Desktop.
Save mdgreenwald/4adfb7b46997936f6b547f503a43f3f8 to your computer and use it in GitHub Desktop.
List AWS ACM Certificates with Issuer and Validation Method
#!/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