Pagination and error handling
The AWS Command Line Interface (CLI) reports errors that help identify why a command failed. For an access denied error, check the caller’s identity and permissions.
How it works
- Check the command’s return codeA return code is the process status that a CLI command reports after it finishes., the process status reported to the script, and inspect the error details.
- For access denied, check the caller’s identity and permissions. For invalid parameters, correct the syntax or values.
- Use
--debugto inspect processing details, including parameter parsing, requests and responses.
Exam cues
- If a deployment command returns access denied, think check the caller’s identity and permissions, because the error points to an access problem.
- If a command has invalid parameters, think correct the syntax or values, because the request needs correction.
Remember
- Return code
252indicates invalid syntax or parameters;253indicates an invalid environment or configuration;254means the service returned an error. - For S3 transfers, code
1indicates a failed transfer, while code2can indicate skipped files.
Trap: Return code
2can also mean a command parsing failure; its meaning depends on the command.
Fetch page
Follow continuation
From the AWS docs (10)
- The --no-paginate option stops automatic token following and returns only the first service page.
- If a service changes item order, different --page-size and --max-items values can cause missing or duplicate results; align them or retrieve the complete list.
- AWS CLI v2 uses standard retry mode by default, with two retries after the initial call for three total attempts.
- AWS_RETRY_MODE and AWS_MAX_ATTEMPTS configure retry behavior; max_attempts includes the initial call.
- Access denied errors require checking identity and permissions; invalid command parameters require correcting syntax or values.
- CLI return code 252 indicates invalid command syntax, an unknown parameter or an incorrect parameter value that prevents execution.
- CLI return code 253 indicates invalid environment or configuration, including missing credentials.
- CLI return code 254 indicates the request reached the service and the service returned an error.
- For S3 transfer commands, code 1 indicates a failed transfer and code 2 can indicate skipped files; code 2 also represents command parsing failures.
- The --debug option shows processing details including parameter parsing, requests, raw responses and formatted output.
Flashcards
tap to flip
Nothing to review here right now. Pick other topics or another filter.
·
All 1 cards as a list
An AWS CLI command returns an access denied error during an infrastructure deployment. What should the team check?
Check the caller identity and permissions.