HENNGE / aiodynamo

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

Unable to use AWS_REGION env var #140

Closed BTripp1986 closed 1 year ago

BTripp1986 commented 1 year ago

Boto3 and the AWS CLI allow the user to set the region with the env var AWS_REGION, but aiodynamo does not check for this var and instead only looks for the AWS_DEFAULT_REGION env var.

BTripp1986 commented 1 year ago

I plan to make a contribution to take care of this issue as well as #139, assuming that the help would be welcomed. I should have some time within the next week to try to address these issues.

ojii commented 1 year ago

aiodynamo doesn't check for either AWS_REGION or AWS_DEFAULT_REGION, instead you have to provide it the region yourself. You can use aiodynamo.client.Client(region=os.environ['AWS_REGION'], ...) if you know that this environment variable is set. Unfortunately, that's not the only way AWS signals the region, in some cases it has to be loaded from the metadata service. Also, it's possible to use DynamoDB cross-region, in which case that variable should be ignored. For those reasons, aiodynamo makes no assumptions about your AWS region and requires you to provide it explicitly. I'm sorry, but I would like to keep this behavior the way it is.

BTripp1986 commented 1 year ago

Thank you for the explanation