Wednesday, October 27, 2021

[SOLVED] How can I get the value of Usage in Service Quotas on AWS through aws ali?

Issue

I have created two instances with the package information t2.micro. When I checked with service-quotes, there were 02 instances. How can I use AWS CLI (or API) to get value at Usage?

Hope you can help me.enter image description here


Solution

You can get the total value of instances in region using something like this:

aws ec2 describe-instances --query "Reservations[].Instances[].InstanceId" --output text | wc -w


Answered By - anton.uspehov