Skip to content

Instantly share code, notes, and snippets.

@sebsto
Created March 20, 2015 07:53
Show Gist options
  • Star 16 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save sebsto/468670c7c0d5feeade69 to your computer and use it in GitHub Desktop.
Save sebsto/468670c7c0d5feeade69 to your computer and use it in GitHub Desktop.
AWS CLI : discover your service limits from the command line
aws support describe-trusted-advisor-check-result --check-id eW7HH0l7J9 --query 'result.sort_by(flaggedResources[?status!="ok"],&metadata[2])[].metadata' --output table --region us-east-1
@farazrehman
Copy link

Works great! thanks for sharing...

@nikolaiderzhak
Copy link

nikolaiderzhak commented Nov 21, 2017

Just in case AWS change check ids , here is command to get id.

# region must be us-east-1 as it only when support command works
CHECK_ID=$(aws --region us-east-1 support describe-trusted-advisor-checks --language en --query 'checks[?name==`Service Limits`].{id:id}[0].id' --output text)
echo $CHECK_ID
eW7HH0l7J9

@pgporada
Copy link

For everybody that's still looking for this information, AWS makes you pay for premium support to get valid/useful output. Boo 👎.

An error occurred (SubscriptionRequiredException) when calling the DescribeTrustedAdvisorCheckResult operation: AWS Premium Support Subscription is required to use this service.```

@chodesuresh
Copy link

what is the string to use for all resources instead of flagged resources?

@sebsto
Copy link
Author

sebsto commented Feb 25, 2021

Trusted Advisor requires a subscription to Support Contract, as explained here https://aws.amazon.com/premiumsupport/technology/trusted-advisor/

@sebsto
Copy link
Author

sebsto commented Feb 25, 2021

2021 UPDATE

To find check ID :

aws --region us-east-1 support describe-trusted-advisor-checks --language en --query 'checks[?category==`service_limits`]'

Once you found the checkID (in the below example, I am using "EC2 On-Demand instances - Standard") :

aws support describe-trusted-advisor-check-result --region us-east-1 --check-id 0Xc6LMYG8P --output table --query 'result.sort_by(flaggedResources[?status!="ok"],&metadata[2])[].metadata' 

@harleyGoo
Copy link

@sebsto
Thanks a lot for update!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment