Instructions how to setup an AWS S3 bucket as file repository

Pre-requirements

You need to have an AWS account. If not, you can register here aws.amazon.com As a new customer AWS will provide you with a lot of benefits, including 5 GB of free cloud storage in the first 12 months that you can use together with Psono. More details can be found here: aws.amazon.com/free/

Setup Guide

This guide will walk you through the creation of a bucket, the configuration of the bucket and the creation of a service account, before it helps you to configure it in psono.

Create bucket

1) Login to aws.amazon.com

2) Go to S3

Step 3 Go to s3

3) Click “Create bucket”

Step 3 Create bucket

4) Specify bucket inforamtion and click “Create”

Step 3 Specify bucket inforamtion

Configure CORS

1) Click on your bucket

Step 1 Click on your bucket

2) Go to “Permissions” > “CORS configuration”

Step 2 Go to Permissions - CORS configuration

and paste the following config:

<?xml version="1.0" encoding="UTF-8"?>
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/">
<CORSRule>
    <AllowedOrigin>*</AllowedOrigin>
    <AllowedMethod>GET</AllowedMethod>
    <AllowedMethod>PUT</AllowedMethod>
    <AllowedMethod>POST</AllowedMethod>
    <AllowedMethod>DELETE</AllowedMethod>
    <AllowedHeader>*</AllowedHeader>
</CORSRule>
</CORSConfiguration>

3) Click “Save”

Create a policy

1) Go to IAM

Step 1 Go to IAM

2) Go to Policies and click “Create Policy”

Step 2 Go to Policies and click Create Policy

3) Select JSON

Step 3 Go to JSON

and paste the following config:

{
    "Version": "2012-10-17",
    "Statement": [
        {
            "Sid": "ListObjectsInBucket",
            "Effect": "Allow",
            "Action": [
                "s3:ListBucket"
            ],
            "Resource": [
                "arn:aws:s3:::psono-file-uploads"
            ]
        },
        {
            "Sid": "AllObjectActions",
            "Effect": "Allow",
            "Action": "s3:*Object",
            "Resource": [
                "arn:aws:s3:::psono-file-uploads/*"
            ]
        }
    ]
}

4) Click “Review Policy”

5) Specify a name and description

Step 5 Specify a name and description

6) Click “Create Policy”

Create an user

1) Go to IAM

Step 1 Go to IAM

2) Go to users and click “Add User”

Step 2 Go to users and click add user

3) Specify a “name” and allow “programmatic access”

Step 3 Specify some user information

4) Attach your policy

Step 4 Attach your policy

5) Acquire “Access key ID” and “Secret access key”

Step 5 Acquire "Access key ID" and "Secret access key"

Configure the file repository

1) Login to Psono

Step 13 Login to Psono

2) Go to “Other”

Step 14 Go to other

3) Go to “File Repositories” and click “Create new file repository”

Step 15 Go to "File Repositories" and click "Create new file repository"

4) Configure the file repository

Use any descriptive title, select AWS S3 as type, add your bucket’s name, access key id and secret access key. As region you should specify a region that is closest to you from this list

Step 16 Configure the file repository

You can now upload files from the datastore to this file repository.

Edit me
Tags: