Skip to content

Instantly share code, notes, and snippets.

@maemichi-monosense
Last active April 14, 2021 17:27
Show Gist options
  • Save maemichi-monosense/60627feed80a1d13bc08c35a6e6759aa to your computer and use it in GitHub Desktop.
Save maemichi-monosense/60627feed80a1d13bc08c35a6e6759aa to your computer and use it in GitHub Desktop.
AWS CLI: Trusted Adviser
#!/usr/bin/env bash -x
# set -x
export AWS_DEFAULT_REGION=us-east-1
lang=en
account_id=$(aws sts get-caller-identity | jq -r '.Account')
aws support describe-trusted-advisor-checks \
--language $lang \
--query "checks[].[id, category, name]" \
--output text | \
while read id category name ; do
status=$( aws support describe-trusted-advisor-check-result \
--language $lang \
--check-id $id \
--query "{ status: result.status }" \
--output text )
echo -e "$AWS_PROFILE\t$account_id\t$dummy\t$category\t$name\t$status"
done