# Setup AWS S3 as file repository

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 (opens new window) 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/ (opens new window)

# 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

  1. Click "Create bucket"

Step 3 Create bucket

  1. Specify bucket information and click "Create"

Step 3 Specify bucket information

TIP

Remember the bucket name. You will need it later.

# Configure CORS

  1. Click on your bucket

Step 1 Click on your bucket

  1. Go to "Permissions" > "CORS configuration"

Step 2 Go to Permissions - CORS configuration

and paste the following config:

[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "PUT",
            "POST",
            "DELETE"
        ],
        "AllowedOrigins": [
            "*"
        ],
        "ExposeHeaders": []
    }
]
  1. Click "Save"

# Create a policy

  1. Go to IAM

Step 1 Go to IAM

  1. Go to Policies and click "Create Policy"

Step 2 Go to Policies and click Create Policy

  1. 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/*"
            ]
        }
    ]
}

TIP

Replace psono-file-uploads with your bucket name

  1. Click "Review Policy"

  2. Specify a name and description

Step 5 Specify a name and description

  1. Click "Create Policy"

# Create a user

  1. Go to IAM

Step 1 Go to IAM

  1. Go to users and click "Add User"

Step 2 Go to users and click add user

  1. Specify a "name" and allow "programmatic access"

Step 3 Specify some user information

  1. Attach your policy

Step 4 Attach your policy

  1. 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

  1. Go to "Other"

Step 14 Go to other

  1. Go to "File Repositories" and click "Create new file repository"

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

  1. 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 (opens new window)

Step 16 Configure the file repository

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