aws-samples / amazon-textract-textractor

Analyze documents with Amazon Textract and generate output in multiple formats.
Apache License 2.0
388 stars 142 forks source link

Use AWS_REGION and AWS_DEFAULT_REGION environment variables in Textractor when available #354

Closed Belval closed 5 months ago

Belval commented 5 months ago

Issue #, if available: #352

Description of changes: This change checks if the AWS_REGION or AWS_DEFAULT_REGION environment variable is available before defaulting to the default profile. Following the awscli implementation, the former takes precedence over the latter. This improve user experience in managed environments such as SageMaker notebooks.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.