From: Setting up file and image uploads to S3 - sysadmin - Discourse Meta
Go to S3 and click on Create bucket , then fill out the Bucket name .
access the AWS Identity and Access Management (IAM) console and create a new policy. Click the json tab and paste the following:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:List*",
"s3:Get*",
"s3:AbortMultipartUpload",
"s3:DeleteObject",
"s3:PutObject",
"s3:PutObjectAcl",
"s3:PutObjectVersionAcl",
"s3:PutLifecycleConfiguration",
"s3:CreateBucket",
"s3:PutBucketCORS"
],
"Resource": [
"arn:aws:s3:::=BUCKETNAME=",
"arn:aws:s3:::=BUCKETNAME=/*"
]
},
{
"Effect": "Allow",
"Action": [
"s3:ListAllMyBuckets",
"s3:HeadBucket"
],
"Resource": "*"
}
]
}
Policy name
=BUCKETNAME=
Description
=BUCKETNAME= discourse bucket
Now go to users tab and add a user
Add ENVs to inventory
discourse_extra_envs:
- "DISCOURSE_USE_S3: true"
- "DISCOURSE_S3_REGION: '=LOC='"
- "DISCOURSE_S3_ACCESS_KEY_ID: '=ACCESS_KEY='"
- "DISCOURSE_S3_SECRET_ACCESS_KEY: '=SECRET='"
- "DISCOURSE_S3_CDN_URL: '=BUCKETNAME=-s3.bcnd.literatehosting.com.'"
- "DISCOURSE_S3_BUCKET: '=BUCKETNAME='"
- "DISCOURSE_S3_BACKUP_BUCKET: '=BUCKETNAME=/backups'"
- "DISCOURSE_BACKUP_LOCATION: 's3'"
- "DISCOURSE_MAXIMUM_BACKUPS: 14"
- "DISCOURSE_BACKUP_FREQUENCY: 1"
- "DISCOURSE_AUTOMATIC_BACKUPS_ENABLED: true"