-
Notifications
You must be signed in to change notification settings - Fork 249
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Env vars to configure IMDS retry and timeouts #625
Comments
Like @kevinpark1217 mentioned our calls to KIAM are proxied by KIAM, and while KIAM is in maintenance mode we're stuck on it for the time being. It appears like the responsiveness of IMDS can depend on load, so supporting these env vars could help users increase reliability when something running the SDK is sharing an instance with a caller that is hitting IMDS hard. I think it's possible to adjust the timeout in code, but supporting the env vars would make it easy for everyone to tweak these settings for all the downstream applications of the SDK. |
It looks like the Go SDK also has this feature request: aws/aws-sdk-go#3495 Seems like these env vars need to be standardized across the SDKs. |
looks like the support across the different SDKs is tracked here https://docs.aws.amazon.com/sdkref/latest/guide/feature-ec2-instance-metadata.html |
I would be interested in working on this, couple of clarifying questions to the team:
|
@Sigurthorb Oops, I didn't see your comment on taking on this issue. I took a stab at it with #626 PR.
I think I should probably change this to 1 for consistency. Let me know if anyone else has opinions on this. My question for the reviewers, what's the standard way of handling parsing error in the AWS sdk?
|
You technically called first dibs with your checkmark to |
When encountering parsing errors, we typically disregard the config source that produced them and move on to other config sources in the provider chain. If all configs are invalid, then we will either set a default or panic depending on the specific config variable. |
@Velfi Sorry for taking a while to follow up on this. I was preparing the slides for the AWS reInvent presentation. I have opened a new PR in the I think it would be good to implement this feature, since Python SDK already supports this. But also, the IMDS retry isn't well exposed for programmatically configuring by other parts of the Rust SDK. |
Also, there appears to be a regression where Checkout here. (takes a while to auto scroll to the correct position) Edit: Opened an issue and a PR (smithy-lang/smithy-rs#1822) |
I have found another way to implement timeout and retry attempts through code rather than environment variables. Please check out smithy-lang/smithy-rs#1867 |
@kevinpark1217 sorry for the slowness, we're still working on getting the next version released. |
@kevinpark1217 - Your changes to override the IMDS client have been released with I'm going to leave this feature request open for now to track interest in this configuration as environment variables. |
Describe the feature
Other official AWS SDK libraries support specifying
AWS_METADATA_SERVICE_NUM_ATTEMPTS
andAWS_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 project intercepting and redirecting IMDS requests, it can be flaky.
Applications such as 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
andAWS_METADATA_SERVICE_TIMEOUT
environment variables support.Other Information
No response
Acknowledgements
A note for the community
Community Note
The text was updated successfully, but these errors were encountered: