HENNGE / aiodynamo

Asynchronous, fast, pythonic DynamoDB Client

Home Page:https://aiodynamo.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Auth Error With No Default Credentials

BTripp1986 opened this issue · comments

I have access to several AWS accounts via SSO and no default profile for AWS. When I sign in to AWS via SSO the .aws/credentials file is updated with a fresh Access Key, Secret Key, and Security Token.

I specify which credentials I will use with the AWS_PROFILE env var, which is checked as part of the credentials chain lookup. If using boto3 or the aws-cli this method works. With this method I can sign in via SSO to dev and prod accounts. Then if I AWS_PROFILE=dev aws s3 ls(or similar call in boto3) it will run the command against the dev account. Then if I AWS_PROFILE=prod aws s3 ls it will run against prod.

This doesn't seem to work with aiodynamo. In order to get it to work I need to create a default profile and then copy/paste the credentials from the desired profile into the default profile. Aiodynamo should respect the AWS_PROFILE env var.

You can select which profile to use by using aiodynamo.credentials.FileCredentials(profile=...), but I agree that it should default to load from AWS_PROFILE, so I'd accept a PR to that effect.