-
Some requests (for example *ec2.DescribeSubnetsInput or *ec2.DescribeVpcsInput) contain a MaxResults filed (*int32). I couldn't find documentation about this field. Is there some best-practice around the value to set? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
Hi @sdminonne , import ( func main() {
} |
Beta Was this translation helpful? Give feedback.
-
Hello! Reopening this discussion to make it searchable. |
Beta Was this translation helpful? Give feedback.
Hi @sdminonne ,
Since some describe* or list* operations may return a large subset of results, the API allows you to set a limit so you can paginate through the entire list of results. In order to paginate through the results you will need to implement a paginator function with logic to set the limit and call next token (also a parameter in the request)
So while this may be a use case for someone that interacts with the API directly, consumers of the SDK have access to the built-in paginators generated for those supported operations.
So for example ec2.DescribeSubnets:
package main
import (
"context"
"fmt"
"github.com/aws/aws-sdk-go-v2/config"
"github.com/aws/aws-sdk-go-v2/service/ec2"
)
f…