storage icon indicating copy to clipboard operation
storage copied to clipboard

Connect storage to external AWS S3 bucket

Open bernardomichel opened this issue 2 years ago • 1 comments

Improve documentation

Link

https://github.com/supabase/storage-api

Describe the problem

We want to help everybody who wants to hosting their own storage module. In our case, we need to connect a k8s self hosted supabase deployment with an AWS S3 bucket. When we surfing the documentation, we facing at a link to how we can create a IAM User to access through aws-cli or aws-sdk, but we never read about how we can configure the storage container.

We take a look at the code searching for something like AWS_ACCESS_ID, or SECRET_ID but nothing comes up. After that, I understand that we have to "upload" a credentials file to the container in order to authenticate aws-sdk commands.

And finally, we found the solution!

Describe the improvement

You have to save a credentials file at /root/.aws in the storage container to be authenticated. You have to upload a file at /root/.aws/credentials with:

[default]
aws_access_key_id = xxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Additional context

bernardomichel avatar Apr 11 '22 05:04 bernardomichel

Can we also choose our own endpoint?

NeoGold-Dev avatar Jul 20 '22 15:07 NeoGold-Dev

Hey, What's about the AWS CLI? Shoul I go manually inside the container to download it and set the credentials ? I think this method isn't the best ...

sblum51 avatar Sep 07 '22 12:09 sblum51

You can use any mechanism supported by the aws sdk, which are documented at https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html

In this specific scenario, you could use e.g. environment variables on your container definition. Or if you're using EKS, you can use https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html as well.

darora avatar Sep 07 '22 12:09 darora

You can use any mechanism supported by the aws sdk, which are documented at https://docs.aws.amazon.com/sdk-for-javascript/v2/developer-guide/configuring-the-jssdk.html

In this specific scenario, you could use e.g. environment variables on your container definition. Or if you're using EKS, you can use https://docs.aws.amazon.com/eks/latest/userguide/iam-roles-for-service-accounts.html as well.

I am also looking on using a self-hosted S3 backend, like mini.io. How would I proceed with your information? Can anyone elaborate further on that?

valerius21 avatar Sep 08 '22 16:09 valerius21

Improve documentation

Link

https://github.com/supabase/storage-api

Describe the problem

We want to help everybody who wants to hosting their own storage module. In our case, we need to connect a k8s self hosted supabase deployment with an AWS S3 bucket. When we surfing the documentation, we facing at a link to how we can create a IAM User to access through aws-cli or aws-sdk, but we never read about how we can configure the storage container.

We take a look at the code searching for something like AWS_ACCESS_ID, or SECRET_ID but nothing comes up. After that, I understand that we have to "upload" a credentials file to the container in order to authenticate aws-sdk commands.

And finally, we found the solution!

Describe the improvement

You have to save a credentials file at /root/.aws in the storage container to be authenticated. You have to upload a file at /root/.aws/credentials with:

[default]
aws_access_key_id = xxxxxxxxxxxxxxxxxxxxx
aws_secret_access_key = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

Additional context

Thank you! this wasn't documented anywhere that I could find. I never would have figured this out.

Why does it seem they are removing self-hosting documentation? I can find less about self-hosting now than I could a few months ago.

captainR0bbo avatar Dec 17 '22 15:12 captainR0bbo

Thank you! this wasn't documented anywhere that I could find. I never would have figured this out.

Why does it seem they are removing self-hosting documentation? I can find less about self-hosting now than I could a few months ago.

money. they're launching. they probaply don't want stakeholders asking questions about people leaving the platform and not paying them :D

valerius21 avatar Dec 17 '22 17:12 valerius21

We rebuilt the docs website from ground up recently. Appreciate the feedback, will share with the team that the self hosting docs aren't discoverable in the new site.

We encourage folks to self host if the hosted platform doesn't meet their requirements. We recently added storage to the self hosted dashboard and even new features like the image transformations feature are already available in the self hosted version. In fact, there are features like rate limiting and webhooks support for storage where the platform version lags the self hosted version.

inian avatar Dec 19 '22 02:12 inian

Let's make the self-hosting docs more visible ⚡️ We're going to move all the self-hosting docs into their own top-level section on the Docs website and start adding all the relevant information there.

MildTomato avatar Dec 19 '22 08:12 MildTomato

Started the move https://github.com/supabase/supabase/pull/11098

MildTomato avatar Dec 19 '22 08:12 MildTomato

Awesome! Didn't expect to get any sort of response. The new Docs site does look great!

captainR0bbo avatar Dec 19 '22 15:12 captainR0bbo

@captainR0bbo Just merged it

MildTomato avatar Dec 20 '22 03:12 MildTomato

Thank you!

captainR0bbo avatar Dec 20 '22 19:12 captainR0bbo