With IRSA
Using your own S3 bucket for Datasaur projects with IRSA delegated permission
Last updated
Using your own S3 bucket for Datasaur projects with IRSA delegated permission
Last updated
Specific for self-hosted from AWS Marketplace, the delegated permission method being used would be through IAM Roles for Service Accounts (IRSA). Although the overall approach is almost the same as the original approach (parent page), this page is still needed to avoid any confusion between the two and make it clear for the self-hosted users through AWS Marketplace. One of the main differences is when creating the IAM role, specifically the 4th step.
This attribute will be used when you create a project to tell Datasaur which file should be used. You can get it by using the path after bucket name on S3 URI. See the example below.
Bucket name: datasaur-test
S3 URI: s3://datasaur-test/some-folder/image.png
File key: /some-folder/image.png
By integrating your bucket into Datasaur, you would be able to create projects using files directly from your S3.
Let's begin by setting up an Integration in Team Settings. By default, Datasaur uses its own storage to manage your projects. By adding another one, we can use your preferred storage provider when creating projects.
Open your team page, then go to Settings > Integrations.
Click on "Add External Object Storage". A new window will pop up. Do not close the pop up because we will use the External ID and it will be generated each time you close the form.
You can start by filling the Bucket name attribute. It will be used to reference and differentiate between external object storage.
We'll get back to this window later. Let's leave it for now.
This step would allow Datasaur to access resources in your bucket.
Log into your AWS account, then go to S3 management console.
Click on your preferred bucket. And also, it's highly recommended to enable the lifecycle policy for both temp/
and export/
prefix to be removed in 7 days.
Open Permissions. Edit the Cross-origin resource sharing (CORS) section, and paste the following configurations.
Bucket name: Fill with the name of the bucket that you just set the CORS for.
Bucket prefix: It will be added at the start of the bucket so that you can group it according to your needs, e.g. test
will refer to /{bucket-name}/test
.
Allowed origins: Change it to your self-hosted domain for the Datasaur app.
You need to create a policy to access your S3 bucket. If you have already setup a policy for accessing the bucket, feel free to skip this step.
In your AWS IAM management console, go to Policies, then click on Create Policy.
Choose the JSON tab, and paste the following configurations. Don't forget to replace the resource with your bucket name. The write permission will be used to upload the selected files to your bucket whereas the get bucket location will be used to configure the request based on your bucket's region.
Click on Next: Tags. We don't require tags to be added, but you can add tags here if you want.
Click on Next: Review. Input a name for the AWS Policy, a description (optional), and click on Create Policy.
After we've created a policy for your S3 bucket, we need to attach it to a role which will be assumed by Datasaur to access your bucket.
Back on the IAM management console, go to Roles, then click on Create role.
Choose AWS account in the trusted entity type section.
Click on the Custom trust policy for the trusted entity type attribute. You can then paste this configuration below.
Replace the values for AWS account ID, IRSA role name, and external ID accordingly. Use the displayed AWS Account ID. You can define your own external ID, just be sure to update the value in the external object storage form.
In the Add permissions section, pick the policy that we've just created from the previous step. Then, click on Next.
Input a name, (optional) a description, and click on Create role.
After that, back on the Roles page, click on your newly created role.
Copy the Role ARN from the page and paste it in Datasaur Team Settings Page.
Before you create the integration, you do a check connection to make sure your setup is done correctly. If it's a success, you can continue to create the external object storage.
Now, you will be able to create projects using files directly from your S3 bucket, and also change the Default Storage option to whichever one you want from Team Settings page.
If you have any questions or comments, please let us know, and we'll be happy to support you.