mirror of
https://github.com/OpenSignLabs/OpenSign.git
synced 2026-08-24 16:42:33 +02:00
Update s3 documentation
This commit is contained in:
@@ -6,34 +6,76 @@ title: AWS S3
|
||||
### AWS S3 -
|
||||
- Step 1 : Create a S3 bucket
|
||||
- Login to [AWS console](https://aws.amazon.com/console/)
|
||||
- Navigate to S3 under services
|
||||
- Hit "Create Bucket" button on upper right corner
|
||||
- Remove the check from "block all public access" checkbox(we need this in order to provide access to not-logged in users after OTP verification)
|
||||
- Set bucket versioning and tags as per your requirements
|
||||
- Hit "Create bucket" button
|
||||
- Step 2 : Create IAM user and provide access to AWS bucket
|
||||
- Search for "IAM" on the search bar in AWS console
|
||||
- On IAM dashboard, click the number of users(count) under IAM resources table
|
||||
- Hit "create user" button on the upper right corner of the page
|
||||
- Enter the user name & click next
|
||||
- Click create policy, search for S3 and provide the Read, Write & list permissions
|
||||
- Click next and click "Create user"
|
||||
- Step 3 : Generate Credentials
|
||||
- Go to IAM/Users in AWS console
|
||||
- Hit the hyperlink for the user created in the previous step
|
||||
- Click the "Security credentials" tab
|
||||
- Scroll down to "Access keys" and hit "Create access key"
|
||||
- In the next step select "Application running outside AWS"
|
||||
- Add a description tag if needed & hit "Create access key"
|
||||
- Navigate to S3 under services.
|
||||

|
||||
- Hit "Create Bucket" button on upper right corner.
|
||||

|
||||
- Now provide bucket name and don't change any other options scroll down and click on "Create Bucket" button.
|
||||

|
||||

|
||||
- Click on name of bucket from list which we have just created.
|
||||
- Now go to permission Tab and scroll down to botton.
|
||||

|
||||
- At the bottom you will see cross-origin resource sharign (cors) section click on "Edit" button.
|
||||

|
||||
- Now paste below line of code and add origin url in AllowedOrigins array and click on "Save changes".
|
||||
```
|
||||
[
|
||||
{
|
||||
"AllowedHeaders": [
|
||||
"*"
|
||||
],
|
||||
"AllowedMethods": [
|
||||
"GET",
|
||||
"PUT",
|
||||
"POST"
|
||||
],
|
||||
"AllowedOrigins": [
|
||||
"httpS://localhost:3001",
|
||||
|
||||
],
|
||||
"ExposeHeaders": [
|
||||
"x-amz-server-side-encryption",
|
||||
"x-amz-request-id",
|
||||
"x-amz-id-2"
|
||||
],
|
||||
"MaxAgeSeconds": 3000
|
||||
}
|
||||
]
|
||||
```
|
||||
- Once done go to "Properties" there you will see region of bucket e.g us-east-1
|
||||
- set bucktname as "DO_SPACE" in ENV.
|
||||
- set region as "DO_REGION" in ENV.
|
||||
- Replace region in this url s3.{region}.amazonaws.com and set it as "DO_ENDPOINT" in ENV.
|
||||
- Replace bucketName and region in this url https://{bucketName}.s3.{region}.amazonaws.com and set us as "DO_BASEURL" in ENV.
|
||||
- Step 2 : Create a aws policy
|
||||
- Navigate to IAM under services
|
||||

|
||||
- Now click on "Polices" from left side "access management" menu.
|
||||
- Hit "Create Policy" button on upper right corner.
|
||||

|
||||
- Search for S3 and Tick PutObject and GetObject from Action Allowed list.
|
||||

|
||||

|
||||
- provide policy name and hit on 'Create Policy".
|
||||

|
||||
- Step 3 : Create IAM user.
|
||||
- Now click on "Users" from left side "access management" menu and then click on "Create User" button.
|
||||

|
||||
- Provide username and click on Next button.
|
||||
- Now select "Attach policies directly" from Permissions options.
|
||||

|
||||
- Now search policy in "Permission Policies" section which we have created in previous step.
|
||||

|
||||
- Now scroll down and Click on "Create User" Button.
|
||||
- Step 4 : Generate Credentials
|
||||
- Now Click on username form list which we have created in previous step.
|
||||
- Click on "Create Access Key" from right corner.
|
||||

|
||||
- In the next step select "Application running outside AWS".
|
||||

|
||||
- In the next step you will see "Access key" and "Secret Access key". Copy both the values.
|
||||
- Set the value of "Access key" to "DO_ACCESS_KEY_ID" environment variable
|
||||
- Set the value of "Secret Access key" to "DO_SECRET_ACCESS_KEY" environment variable
|
||||
- Step 3 : Copy bucket credentials
|
||||
- Visit "Amazon S3 -> Buckets" in aws console
|
||||
- Click the bucket created in previous steps & visit the properties tab
|
||||
- Under "Bucket overview" you will find the value of AWS region(for ex. ap-south-1). Set that value to env variable "DO_REGION"
|
||||
- You can create the value for "DO_ENDPOINT" env variable by appending the region value to amazonaws.com (for ex. s3.ap-south-1.amazonaws.com)
|
||||
- You can create the value for "DO_BASEURL" by adding the bucketname in front of the endpoint value(for ex. https://bucketname.s3.ap-south-1.amazonaws.com)
|
||||
|
||||
- Set the value of "Access key" to "DO_ACCESS_KEY_ID" environment variable.
|
||||
- Set the value of "Secret Access key" to "DO_SECRET_ACCESS_KEY" environment variable.
|
||||
Visit below link if you face any issues while following the above instructions -
|
||||
- https://repost.aws/knowledge-center/create-access-key
|
||||
|
||||
Reference in New Issue
Block a user