Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding support for AWS IAM role credentials #128

Closed
wants to merge 1 commit into from

Conversation

andreaswittig
Copy link
Contributor

Besides using IAM user credentials, AWS automatically injects credentials into most of their services (EC2, Fargate, Lambda, ...). The AWS SDK makes use of these credentials out-of-the-box. However, that mechanism does not work when setting the values manually, as it was the case inside the S3 provider so far.

Therefore, I made the environment variables STORE_ACCESS_KEY and STORE_SECRET_KEY optional. When the S3 client gets created without specific credentials, it will automatically try to access the IAM role credentials when running on an AWS platform like EC2 or Fargate.

By the way, this feature has been requested before. See #95 for details.

Many thanks to @QingWei-Li for maintaining this amazing project. It is a great example for a slick web application built on S3.

Comment on lines +6 to +7
accessKey: getEnv('STORE_ACCESS_KEY'),
secretKey: getEnv('STORE_SECRET_KEY'),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This uses the old config system, which is the main reason why this cannot be merged yet.

@tecc tecc added the enhancement New feature or request label Sep 8, 2022
@tecc tecc mentioned this pull request Sep 11, 2022
@tecc
Copy link
Member

tecc commented Sep 11, 2022

Closing in favour of #143.

@tecc tecc closed this Sep 11, 2022
tecc added a commit that referenced this pull request Sep 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants