i-dot-ai / redbox

Bringing Generative AI to the way the Civil Service works
https://i-dot-ai.github.io/redbox/
MIT License
83 stars 27 forks source link

[AWS SUPPORT] Support AWS Task Roles for S3 Access without Explicit AWS Keys #764

Open tom1322s opened 1 month ago

tom1322s commented 1 month ago

Description: The current implementation for creating an S3 client in the settings.py file explicitly requires AWS access keys, as seen in settings.py:

This approach is not optimal when running within AWS environments such as ECS tasks with IAM roles that have the necessary S3 permissions. In these scenarios, AWS automatically manages the credentials, eliminating the need to explicitly provide AWS access keys.

Proposed Solution: Remove the explicit requirement for AWS access keys in the S3 client creation logic. Allow the AWS SDK to automatically manage credentials when the application is running in an AWS environment with IAM roles.

brunns commented 1 month ago

These settings are optional - can we just not set them in whatever .env is in use in these environments, or is there more to it?