
Answer-first summary for fast verification
Answer: --starting-token, --max-items
--max-items --starting-token For commands that can return a large list of items, the AWS Command Line Interface (AWS CLI) has three options to control the number of items included in the output when the AWS CLI calls a service's API to populate the list. --page-size --max-items --starting-token By default, the AWS CLI uses a page size of 1000 and retrieves all available items. For example, if you run aws s3api list-objects on an Amazon S3 bucket that contains 3,500 objects, the AWS CLI makes four calls to Amazon S3, handling the service-specific pagination logic for you in the background and returning all 3,500 objects in the final output. Here's an example: aws s3api list-objects --bucket my-bucket --max-items 100 --starting-token eyJNYXJrZXIiOiBudWxsLCAiYm90b190cnVuY2F0ZV9hbW91bnQiOiAxfQ== Incorrect options: "--page-size" - You can use the --page-size option to specify that the AWS CLI requests a smaller number of items from each call to the AWS service. The CLI still retrieves the full list but performs a larger number of service API calls in the background and retrieves a smaller number of items with each call. "--next-token" - This is a made-up option and has been added as a distractor. "--limit" - This is a made-up option and has been added as a distractor.
Author: LeetQuiz Editorial Team
Ultimate access to all questions.
You're tasked with developing an application that retrieves and displays a list of objects stored in an Amazon S3 bucket to its users. To improve usability, you want to paginate the results so that only 100 objects are shown per page. Additionally, it's important to minimize the number of API calls made to AWS to reduce cost and latency.
Which CLI options should you configure to achieve this? (Select two)
A
--limit
B
--page-size
C
--starting-token
D
--max-items
E
--next-token
No comments yet.