kennu / cwtail

CloudWatch Logs Tail
86 stars 14 forks source link

Allow for AWS_REGION env var #4

Closed jthomerson closed 7 years ago

jthomerson commented 7 years ago

I'm not sure why your code is reading the ~/.aws/config ini file and trying to ascertain the region from there. The SDK will automatically determine the region based on a series of fallbacks. I have deployments in multiple regions, and I can't use cwtail in multiple regions without having different profiles just for the sake of having a different region value.

Could you remove lines 169-180 and just allow the SDK to do its own automatic region detection?

kennu commented 7 years ago

Sorry for being silent for a long time. When I remove lines 169-180 as suggested, I get this error:

ConfigError: Missing region in config

I believe that is the reason why I added the region detection code in the first place.

AWS CLI seems to read the region from ~/.aws/config automatically, and AWS SDK doesn't. Unless I am missing something.

jthomerson commented 7 years ago

Right, but the SDK allows for the AWS_REGION environment variable, which would allow this code to be used in multi-region environments. Pull request #5 adds support for this region var.