HENNGE / aiodynamo

Asynchronous, fast, pythonic DynamoDB Client
https://aiodynamo.readthedocs.io/
Other
69 stars 20 forks source link

Add kubernetes credentials to the list of possible credentials #127

Closed thiagosalvatore closed 1 year ago

thiagosalvatore commented 2 years ago

We've been using AioDynamo for a while in my current company. The existing credentials work pretty well with ECS and EC2 machines. However, when running inside a Kubernetes cluster (like EKS), the metadata from the EC2 instance is not available and we don't have the credentials from AWS as environment variables because our pod basically assumes a role on AWS. We also don't have a file with credentials or anything like that. That said, we needed a way to fetch the credentials from AWS that our pod has, and luckily AWS offers us a way to do that by calling get_credentials.

This PR does the following:

  1. Creates a new KubernetesCredentials;
  2. Updates typing-extensions to support the most recent version;
  3. Add boto3-stubs to our dev dependencies;
ojii commented 2 years ago

I think I know how to implement this natively (we have a custom credentials implementation for connecting with a saml response which is very similar) but my biggest concern is how to test this on EKS, since I've never touched either k8s or EKS. could you provide some guide how I could test the implementation?

ojii commented 1 year ago

I'm sorry, but I will close this PR. I'd love to add support for this, but the first step to do so would be to provide a way to test it and the implementation needs to be async native to be included in this repo.