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

R&D Setup ASW S3 buckets so the users can pay for the reading from it #22

Closed
khorolets opened this issue Feb 17, 2022 · 1 comment · Fixed by #27
Closed

R&D Setup ASW S3 buckets so the users can pay for the reading from it #22

khorolets opened this issue Feb 17, 2022 · 1 comment · Fixed by #27
Assignees

Comments

@khorolets
Copy link
Member

khorolets commented Feb 17, 2022

Given that we can setup S3 in a way that the users will pay for their read usage

#6 (comment)

We want to enable it to anyone who runs or will need to run their own indexer in order to remove the pain from the process.

We want to check how to set it up and how to use it so we can document it and recommend to use NEAR Lake Framework

@khorolets
Copy link
Member Author

khorolets commented Feb 21, 2022

  • Using Requester Pays bucket for storage transfer and usage

  • Configuring Requester Pays on a bucket

  • In a Bucket Permission settings we need to unblock public access (Block public access (bucket settings))

  • Create or edit bucket policy (allows to read objects and list objects in the specified bucket

    {
      "Version": "2012-10-17",
      "Statement": [
          {
              "Sid": "PublicRead",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:GetObject",
              "Resource": "arn:aws:s3:::near-lake-data-tesnet/*"
          },
          {
              "Sid": "PublicList",
              "Effect": "Allow",
              "Principal": "*",
              "Action": "s3:ListBucket",
              "Resource": "arn:aws:s3:::near-lake-data-testnet"
          }
      ]
    }
    
  • Access control list (ACL):
    Grant Authenticated users group (anyone with an AWS account) List and Read


After these changes, all requests to our S3 have to be done by authenticated users (any AWS user) with request_payer provided. The requester will be charged for the queries to AWS by AWS

I'm going to apply the changes listed above to buckets:

  • near-lake-data-testnet
  • near-lake-data-mainnet

I need to update the README about it and close this after that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants