awslabs / awslabs/aws-sdk-rust

Env vars to configure IMDS retry and timeouts

Open
#625 12 comments 5 reactions 0 assignees View on GitHub
feature-request good first issue p3
Dominant language
Rust
Stars
3.3k
Forks
290
Avg merge
1d 12h
Merged PRs (30d)
3

Description

### Describe the feature

Other official AWS SDK libraries support specifying `AWS_METADATA_SERVICE_NUM_ATTEMPTS` and `AWS_METADATA_SERVICE_TIMEOUT` environment variables to automatically retry IMDS requests.

This feature is currently missing in the `aws-sdk-rust` making it more difficult for applications to handle rare credential failures originating from IMDS requests.

### Use Case

When applications are deployed in Kubernetes cluster with [KIAM](https://github.com/uswitch/kiam) project intercepting and redirecting IMDS requests, it can be flaky.

Applications such as [Vector](https://github.com/vectordotdev/vector) will out right abort and throw-away the current operation when it encounters an IMDS credential error. It would be super beneficial to have the retry abilities built-in to the SDK itself.

### Proposed Solution

Implement retry logic into the library with `AWS_METADATA_SERVICE_NUM_ATTEMPTS` and `AWS_METADATA_SERVICE_TIMEOUT` environment variables support.

### Other Information

_No response_

### Acknowledgements

- [x] I may be able to implement this feature request
- [ ] This feature might incur a breaking change

### A note for the community

### Community Note
* Please vote on this issue by adding a 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to the original issue to help the community and maintainers prioritize this request
* Please do not leave "+1" or "me too" comments, they generate extra noise for issue followers and do not help prioritize the request
* If you are interested in working on this issue, please leave a comment

Contributor guide

Open the contributing guide

Research direction

The issue names no files or tests; start by locating the IMDS credential request implementation and its existing environment-variable configuration. Add support for AWS_METADATA_SERVICE_NUM_ATTEMPTS and AWS_METADATA_SERVICE_TIMEOUT, including retry and timeout behavior, and verify the configured behavior with tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
aws, rust
Domain
backend, cloud
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.