A) Correct
When running AWS CLI list commands (e.g., aws s3 ls, aws ec2 describe-instances), the CLI may time out due to the amount of data being retrieved in a single API request. To mitigate this, the --page-size parameter can be used to limit the number of items returned per page in each API call. This reduces the load on the CLI and prevents timeouts.
The correct answer is A. While the B (using --max-items) reduce the number of elements that are sent as output, the --page-size parameter instead, return all the items of the specified resource. If we set this parameter to a value for example equals to 5, it means that in background the cli will execute ona API after the other and each API requests only 5 elements by time. This is a way to avoid timeouts without interfer with the final result
How to use the --page-size parameter
If you see issues when running list commands on a large number of resources, the default page size might be too high. This can cause calls to AWS services to exceed the maximum allowed time and generate a "timed out" error. You can use the --page-size option to specify that the AWS CLI request a smaller number of items from each call to the AWS service. The AWS 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. This gives the individual calls a better chance of succeeding without a timeout. Changing the page size doesn't affect the output; it affects only the number of API calls that need to be made to generate the output.
$ aws s3api list-objects \
--bucket my-bucket \
--page-size 100
{
"Contents": [
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
LEHUY
Highly Voted 2 years, 7 months agosumanshu
Most Recent 4 months, 1 week agorcaliandro
1 year, 10 months agosichilam
2 years, 3 months agosichilam
2 years, 3 months agodark_cherrymon
2 years, 5 months agorobbyboss
2 years, 7 months agorobbyboss
2 years, 7 months ago