awslabs / aws-sdk-rust

AWS SDK for the Rust Programming Language
https://awslabs.github.io/aws-sdk-rust/
Apache License 2.0
2.91k stars 245 forks source link

AWS SDK for Rust doesn't take into account kube2iam authentication #1135

Closed anatoli-iliev closed 1 month ago

anatoli-iliev commented 2 months ago

Describe the feature

We host our functionality in a custom running Kubernetes cluster. For each pod we deploy, we annotate it with the AWS role arn that it needs to be authenticated with. Once we run the pod and execute commands using AWS CLI (such copy files to S3) it works just fine. Unfortunately using the Rust AWS SDK we cannot perform any AWS operations as it expects we to have access_key and secret_key either in credentials file or in env variable. The kube2iam mechanism is not exporting all that and it stays behind the curtains.

AWS SDK for Java supports this out of the box.

Use Case

We are working with a custom Kubernetes provider we have. Our resources within this k8s provider communicate and utilize various AWS services (S3, SQS, etc). So in order for our applications deployed in k8s to authenticate and use the AWS resources we are using kube2iam communication. We annotate our pods with certain specific AWS roles and the AWS SDK for Java works the authentication out of the box. Unfortunately that is not the case with the AWS SDK for Rust. It seems that it expect we to pass aws key id and secret to it either in profile or in env variables in order to work.

Proposed Solution

No response

Other Information

No response

Acknowledgements

A note for the community

Community Note

Velfi commented 2 months ago

Hey @anatoli-iliev, thanks for submitting this issue. I'm guessing that this is an issue caused by IMDS v1 vs IMDS v2. We only support IMDS v2. Does kube2iam work with any of the newer SDKs like the Kotlin SDK?

github-actions[bot] commented 1 month ago

Greetings! It looks like this issue hasn’t been active in longer than a week. We encourage you to check if this is still an issue in the latest release. Because it has been longer than a week since the last update on this, and in the absence of more information, we will be closing this issue soon. If you find that this is still a problem, please feel free to provide a comment or add an upvote to prevent automatic closure, or if the issue is already closed, please feel free to open a new one.