lithops-cloud / lithops

A multi-cloud framework for big data analytics and embarrassingly parallel jobs, that provides an universal API for building parallel applications in the cloud ☁️🚀
http://lithops.cloud
Apache License 2.0
317 stars 105 forks source link

[AWS] Use credentials and config from AWS SDK file #1114

Closed aitorarjona closed 7 months ago

aitorarjona commented 1 year ago

Fix for #1107

This pull request adds functionality to retrieve AWS SDK config and credentials from the standard config file (~/.aws/config and ~/.aws/credentials) or env vars (more info).

Consequently, it deprecates using aws_access_key_id and aws_secret_access_key in aws Lithops config section.

This approach is not only more secure, as we avoid sending secrets to the runtime via payload, but also we support users with SSO-based accounts, which will need configure a profile in their ~/.aws/config file and retrieve their session credentials dynamically. E.g.:

[profile my-sso-profile]
sso_start_url = https://XXXXXXXX.awsapps.com/start
sso_region = us-east-1
sso_account_id = XXXXXXXXXXX
sso_role_name = XXXXXXXXXXXXXXXXX
region = us-east-1

Summary:

Developer's Certificate of Origin 1.1

   By making a contribution to this project, I certify that:

   (a) The contribution was created in whole or in part by me and I
       have the right to submit it under the Apache License 2.0; or

   (b) The contribution is based upon previous work that, to the best
       of my knowledge, is covered under an appropriate open source
       license and I have the right under that license to submit that
       work with modifications, whether created in whole or in part
       by me, under the same open source license (unless I am
       permitted to submit under a different license), as indicated
       in the file; or

   (c) The contribution was provided directly to me by some other
       person who certified (a), (b) or (c) and I have not modified
       it.

   (d) I understand and agree that this project and the contribution
       are public and that a record of the contribution (including all
       personal information I submit with it, including my sign-off) is
       maintained indefinitely and may be redistributed consistent with
       this project or the open source license(s) involved.
aitorarjona commented 1 year ago

@JosepSampe please don't merge yet

aitorarjona commented 1 year ago

@JosepSampe ready for review and merge

aitorarjona commented 1 year ago

@JosepSampe Hi Josep, all requests have been implemented. Please we should need this merged ASAP, we switched to an SSO-based account and the current implementation in main does not work well (and also to be ready for the next release #1137 ). Thanks!

JosepSampe commented 1 year ago

My last comments are about the 2 other AWS backend (Batch & EC2).

aitorarjona commented 7 months ago

Closing for now, #1164 partially solves the issue described