AWS SDKs provide application code with tools to call AWS services.
Credential providers, pagination, and retries
AWS software development kits (SDKs) provide libraries for application code to call AWS services. Credential providers supply credentials for requests, paginationPagination divides a large result into pages retrieved by separate requests. retrieves results in portions, and retries handle eligible temporary failures.
How it works
- The SDK searches its credential provider chainAn ordered search of credential sources that stops when valid credentials are found., an ordered list of credential sources, until it finds valid credentials. Supported providers and order vary by SDK. Standardized providers attempt to renew expired credentials.
- On Amazon EC2, the instance metadata serviceAn EC2 instance endpoint provides instance data and can supply credentials for an attached role. (IMDS) can provide temporary credentials for the instance roleAn IAM role is an identity with permissions that provides temporary credentials when assumed., an IAM identity with permissions. An earlier valid source can take precedence. Containerized applications on Amazon ECS or EKS can use the container credential provider.
- For paginated operations, process each page and send its continuation token in the next request until no token remains. A supported paginator can make those calls for you.
- With the documented 2026 retry behavior enabled, standard mode retries eligible transient errors and throttling errorsThrottling occurs when a service rejects a request because of rate limits.. Throttling occurs when a service rejects a request due to rate limits. Standard mode uses exponential backoffExponential backoff increases the delay between retry attempts on average., increasing delays on average, and jitterJitter randomizes retry delays to spread out requests from multiple clients., randomizing each delay. A retry quotaA retry quota is a token budget that can stop retries when it is depleted., a token budget for retries, can stop retries; non-retryable errors return immediately.
Exam cues
- If the question says an EC2 application must avoid embedded keys, think instance role and IMDS provider, because the SDK can obtain temporary role credentials.
- If the question says a Systems Manager node list is incomplete, think pagination, because
DescribeInstanceInformationreturns a token for the next set. Stopped and terminated nodes are not returned by that operation. - If the question says one throttled resource slows unrelated requests on the same client, think adaptive retry mode, because its rate limiter is per client.
- If the question says access is denied, think fix permissions, not retries, because access denied is non-retryable.
Remember
DescribeInstanceInformationdefaults to 10 items per call;MaxResultsaccepts 5 through 50.- The AWS CLI normally retrieves all pages for supported commands;
--no-paginatemakes only the first call. - The documented 2026 retry behavior requires
AWS_NEW_RETRIES_2026=trueuntil it becomes the default. Older behavior differs. - Under that behavior, the general default is 3 total attempts, including the initial request; DynamoDB and DynamoDB Streams default to 4.
- Standard mode does not delay the first request. Adaptive mode can delay it.
Trap: A page size is not the whole result set. Follow the continuation token or use a supported paginator.
From the AWS docs (19)
- AWS SDKs provide libraries and APIs that help application code access cloud services.
- SDK credential provider chains search sources in order and stop at the first valid credentials; supported providers and chain order vary by SDK.
- Standardized credential providers attempt to renew expired credentials automatically.
- The IMDS provider can obtain temporary credentials for an EC2 instance role from instance metadata.
- An IAM role is an identity with permissions that provides temporary credentials when assumed.
- The container credential provider obtains credentials for containerized applications and can be used with ECS or EKS.
- The IMDS provider is checked after several other providers, so earlier valid credentials can prevent it from being used.
- Many operations split results into pages; the Java 2.x SDK can automatically request subsequent pages or use a response token for manual pagination.
- Systems Manager DescribeInstanceInformation returns a NextToken for the next set; it is empty when there are no further items.
- Boto3 provides a paginator for DescribeInstanceInformation responses.
- DescribeInstanceInformation defaults to 10 items per call and accepts MaxResults from 5 to 50.
- DescribeInstanceInformation does not return stopped or terminated nodes.
- For supported paginated commands, the AWS CLI normally retrieves all available items; --no-paginate makes only the first call.
- The documented 2026 retry behavior requires AWS_NEW_RETRIES_2026=true until it becomes the default; earlier behavior differs in backoff timing, retry quota costs and service defaults.
- Under the documented 2026 behavior standard retry mode uses exponential backoff with jitter and a retry quota, and does not delay the initial request.
- Adaptive retry mode adds a per-client rate limiter that can delay initial requests and can slow unaffected resources sharing that client.
- Under the documented 2026 behavior the general default is three total attempts, including the initial request; DynamoDB and DynamoDB Streams default to four.
- Under the documented 2026 behavior transient and throttling errors can be retried, while non-retryable errors such as access denied are returned immediately.
- Throttling errors indicate that a service rejected a request because of rate limits.
Flashcards
Nothing to review here right now. Pick other topics or another filter.
·
All 9 cards as a list
A Systems Manager inventory script misses managed nodes and receives throttling errors. How should the AWS SDK script handle paginated results and retries?
Follow NextToken until it is empty, or use a supported paginator, and use SDK retry handling with backoff for throttling. Stopped and terminated nodes are not returned.
An EC2 application needs AWS credentials without embedded access keys. Which SDK provider can supply role credentials?
The IMDS credential provider can obtain temporary credentials for the instance role.
An EC2 application unexpectedly uses credentials other than its instance role. What should the team check in its SDK credential chain?
Check for an earlier source with valid credentials; the chain stops there before reaching IMDS.
What does the AWS SDK credential provider chain do when it finds valid credentials?
It stops searching. Provider availability and order vary by SDK.
A Systems Manager DescribeInstanceInformation call returns a NextToken. How does an AWS SDK retrieve remaining nodes?
Supply the token to the next call and continue until the returned token is empty, or use a supported paginator.
With the documented 2026 AWS SDK retry behavior, how many requests are included in the general default maximum attempts?
Three total attempts, including the first request. DynamoDB and DynamoDB Streams default to four.
An AWS SDK client serves several resources and throttling on one slows requests to all of them. Which retry mode can cause this?
Adaptive mode. Its rate limiter is shared by requests using the client.
Will standard AWS SDK retries fix an access-denied error under the documented 2026 retry behavior?
No. Access denied is non-retryable and is returned immediately.
An Amazon ECS application needs AWS SDK credentials without embedding keys. Which SDK provider can retrieve container credentials?
The container credential provider can obtain credentials for containerized applications.