Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set max page size for tagging API requests. #55

Merged
merged 1 commit into from
Jun 2, 2022

Conversation

cristiangreco
Copy link

The tagging API allows specifying the number of resources per page to be
returned. Setting it to the max allowed value should reduce the number
of requests issued when fetching large fleets of resources.

Here we also change the iteration logic to stop at the last page.

The tagging API allows specifying the number of resources per page to be
returned. Setting it to the max allowed value should reduce the number
of requests issued when fetching large fleets of resources.

Here we also change the iteration logic to stop at the last page.
@@ -128,6 +128,7 @@ func (iface tagsInterface) get(ctx context.Context, job *Job, region string) ([]
if len(svc.ResourceFilters) > 0 {
inputparams := &resourcegroupstaggingapi.GetResourcesInput{
ResourceTypeFilters: svc.ResourceFilters,
ResourcesPerPage: aws.Int64(100), // max allowed value,
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From local testing seems that by default the API will return up to 50 entries per page.

Copy link

@kgeckhart kgeckhart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@cristiangreco cristiangreco merged commit 5e80616 into live Jun 2, 2022
@cristiangreco cristiangreco deleted the cristian/tags-api-page-size branch June 2, 2022 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants