AWS Go SDK Pagination (for Cognito)

Chris Bailey
1 min readApr 14, 2024

Here’s a quick example of how AWS’ Go SDK v2 pagination can be used, since I haven’t seen an example elsewhere.

A lot of AWS APIs limit the amount of data that can be returned, and thus if you are needing to say download your entire database of users from Cognito, you have to deal with pagination. For example, in the case of Cognito, you can pull a max of 60 users with the ListUsers API. Thankfully, AWS provides pagination interfaces in nearly all these cases. These pagination classes simply do the work for you in terms of keeping track of the cursor and iterating…

--

--

Chris Bailey

NatureQuant CTO/Co-founder. HotelTonight Co-founder. Cyclist, trail runner, skier, espresso & coffee lover, geek, traveler, foodie.