Extension:AWS

AWS extension allows MediaWiki to use Amazon S3 (instead of the local directory) to store images.

Why is this needed
When images are in S3, Amazon EC2 instance which runs MediaWiki doesn't contain any important data and can be created/destroyed by Autoscaling.

Alternatives
Instead of using Amazon S3 (and this extension), you can create an Amazon EFS drive and mount it to $wgUploadDirectory. It's recommended for small wikis.

Installation

 * 1) Download the extension:
 * 2) Move the AWS directory to the "extensions" directory of your MediaWiki, e.g.   (assuming MediaWiki is in  ).
 * 3) Run   from   (to download dependencies). If you don't have Composer installed, see Composer for how to install it.
 * 4) Choose a unique name (not taken by another AWS user) for your Amazon S3 buckets, e.g.  . Create four S3 buckets: ,  ,  ,.
 * Note: this name will be seen in URL of images.
 * 1) Authorize MediaWiki to access Amazon S3:
 * 2) If your EC2 instance has an IAM instance profile (recommended), copy everything from "Needed IAM permissions" (see below) to inline policy of the IAM role. See https://console.aws.amazon.com/iam/home#/roles
 * 3) If your EC2 instance doesn't have an IAM profile, obtain key/secret for AWS API. You'll need to write it in LocalSettings.php (see below).
 * 4) Modify LocalSettings.php (see below).
 * 1) Modify LocalSettings.php (see below).

See https://github.com/edwardspec/mediawiki-aws-s3/blob/master/README.md for more details.

Step 2: needed IAM permissions
Visit the IAM Management Console - https://console.aws.amazon.com/iam/home - and add "Inline policy" to the IAM role of your Webserver.

Inline policy should contain the following permissions (replace  with the prefix of your S3 buckets, e.g.  ):

Note: you must create S3 buckets yourself (not wait for MediaWiki to do it).