AWS Certified Developer – Associate — Question 160

A developer uses the Amazon S3 ListObjectsV2 API call to retrieve and list object keys from an S3 bucket. The list can contain thousands of keys, and the retrieval often returns more than the max-keys maximum value. The code must handle any number of returned results.

How can the developer modify the code to handle any number of returns?

Answer options

Correct answer: D

Explanation

The correct answer is D because the ListObjectsV2 API call returns a maximum number of keys and provides a NextContinuationToken to retrieve additional results. Options A and B do not effectively manage the retrieval of more than the maximum keys, while option C does not address the specific need to list keys from the bucket.