@@ -56,9 +56,9 @@ func init() {
56
56
}
57
57
58
58
// describeRateLimit is a rate limiter to avoid throttling when describing resources via the cloud control api.
59
- // AWS does not publish the rate limits for the cloud control api. Testing shows it fails around 30-35 requests per
60
- // second, therefore we set the rate limit to 25 requests per second to try and stay under the limit at all times .
61
- var describeRateLimit = ratelimit .New (25 , ratelimit .Per (time .Second ) )
59
+ // AWS does not publish the rate limits for the cloud control api, the rate seems to be 60 reqs/minute, setting to
60
+ // 55 and setting no slack to avoid throttling .
61
+ var describeRateLimit = ratelimit .New (55 , ratelimit .Per (time .Minute ), ratelimit . WithoutSlack )
62
62
63
63
// RegisterCloudControl registers a resource type for the Cloud Control API. This is a unique function that is used
64
64
// in two different places. The first place is in the init() function of this file, where it is used to register
@@ -94,7 +94,8 @@ func (l *CloudControlResourceLister) List(_ context.Context, o interface{}) ([]r
94
94
}
95
95
96
96
if err := svc .ListResourcesPages (params , func (page * cloudcontrolapi.ListResourcesOutput , lastPage bool ) bool {
97
- describeRateLimit .Take ()
97
+ dt := describeRateLimit .Take ()
98
+ l .logger .Debugf ("rate limit time: %s" , dt )
98
99
99
100
for _ , desc := range page .ResourceDescriptions {
100
101
identifier := ptr .ToString (desc .Identifier )
0 commit comments