Data Operations and Support

A Python application uses Boto3 ListObjectsV2 to enumerate an S3 prefix containing 8,000 objects, but processes only the first 1,000. What should the developer do to retrieve all matching objects?

Show the answer

Correct answerD. Use the SDK's ListObjectsV2 paginator

AWhy not this: A longer read timeout does not retrieve pages omitted from a successful response.

BWhy not this: ListObjectsV2 returns at most 1,000 objects per response; raising MaxKeys cannot retrieve all 8,000 in one response.

CWhy not this: Retries address failed requests, not additional pages of a successful listing.

DWhy this is right: The paginator follows continuation tokens to retrieve all pages of matching objects.

ListObjectsV2 returns at most 1,000 objects per response. A Boto3 paginator retrieves successive pages using continuation tokens; setting MaxKeys above 1,000 does not bypass the service's per-response limit.