I am developing a software application that calls AWS API using golang API (https://aws.amazon.com/sdk-for-go/). My software service is building a real-time topology of the cloud environment and so depends on calling this API for each service in the cloud account as often as possible.
I am looking for information pertaining to how many of the following example API calls, shown here using their AWS CLI equivalents, can I issue per second:
$ aws iam list-users
$ aws iam list-roles
$ aws ec2 describe-instances
...
These API calls are rate-limited by what AWS calls request token bucket sizes and refill rates (see https://docs.aws.amazon.com/AWSEC2/latest/APIReference/throttling.html#throttling-limits-cost-based as an example for these rates for EC2). The cloud customer, of course, can increase some of these rates and bucket sizes.
My question is, is there an API for those rates for all services so that my application can be aware of what the current bucket sizes are and the refill rates are so as not to get throttled and run afoul of my customers contracts. In other words, I want the EC2 request token bucket sizes delivered as a JSON to my software application (and for all the other AWS services too). Is this possible?
To the best of my knowledge, and as of the writing of this response, the token bucket algorithm implementation on AWS seems to be very difficult to get a handle on.
Many services do not have these numbers, max bucket size and bucket refill rate, published in the documentation, Unlike GCP's API throttling which is simple, easy to guess and write quick rules around (https://cloud.google.com/compute/docs/api-rate-limits) or Azures', which is is also well documented (https://learn.microsoft.com/en-us/graph/throttling and https://learn.microsoft.com/en-us/azure/azure-resource-manager/management/request-limits-and-throttling).
Also, there is definitely no API for API throttling bucket sizes and refill rates available on AWS.
As a result, your AWS application's API throttling response has to be very application-specific and tuned for your specific needs.