Last active
April 14, 2021 17:27
-
-
Save maemichi-monosense/60627feed80a1d13bc08c35a6e6759aa to your computer and use it in GitHub Desktop.
AWS CLI: Trusted Adviser
This file contains hidden or 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
#!/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 |
TODO
- ruby-fy
sdk
- https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Support/Client.html#describe_trusted_advisor_checks-instance_method
- https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Support/Types/TrustedAdvisorCheckDescription.html
- https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Support/Client.html#describe_trusted_advisor_check_result-instance_method
- https://docs.aws.amazon.com/sdk-for-ruby/v3/api/Aws/Support/Types/TrustedAdvisorCheckResult.html
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Ref