AWS CLI Pagination Flashcards

1
Q

By default, what is the page size used by AWS CLI? (i.e. how many items are returned per API call)

A

1.000

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What happens if the number of returned items are over 1.000?

A

The CLI will make several calls but will still show everything in on go.
- E.g. 2.500 items would force the CLI to make 3 calls, but all 2.500 items would be shown at the same time

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

You are using the AWS CLI trying to list all items in an S3 bucket but you get a timeout error, what could be the reason?

A

The default page size of 1.000 is too high so it takes to long time to fetch all the items

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can you solve an AWS CLI Pagination Error?

A
  • Specify the –page-size option to have the CLI request a smaller number of items from each API call.
  • The CLI still received the full list, but performs a larger number of API calls in the background and receives a smaller number of items with each call.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

You run
‘aws s3api list-objects –bucket mybucket ‘
What is the difference between ending the command with ‘–page-size 100’ vs ‘–max-items 100’?

A
  • -page-size will tell the CLI to retrieve fewer items per call, but it will still fetch all the items in the bucket
  • -max-items will tell the CLI to only fetch the 100 first items in the bucket
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What can you do to solve a ‘timed out’ error or an error related to too many results being returned?

A

Adjust the pagination in the CLI results.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly