After version 4.16.0, WordPress File Upload plugin can upload files to an Amazon S3 bucket.
This article contains instructions on how to configure Amazon S3 so that the plugin can connect and upload files to it.
Two things need to be configured in Amazon S3, the IAM user and the bucket permissions where the files will be stored.
IAM User & Access Keys
The plugin uses Access Keys of an IAM user to get access to an S3 account and upload files.
This user can be the root user of your Amazon AWS account, or any other IAM user created through IAM Management Console.
It is recommended to create a new IAM user that will have only the permissions required by the plugin to upload files to S3.
In case the root user is used, the only thing needed is to generate Access Keys that will be used by the plugin, as follows:
- Log in to AWS Console with your root user account.
- From your user’s menu on the top-right side of the page open My Security Credentials.
- Open Access Keys tab. In there you can find your access key ID and secret access key pairs.
- You can use any of them. Note that you need both the access key ID and secret access key. The above list displays only the access key IDs. If you haven’t kept the secret access keys somewhere, then you need to create a new key from Create New Access Key button.
If you use another existing user account created through IAM Management Console, or create a new one (recommended), then you need to make sure that it has the following permissions:
- AmazonS3FullAccess
- IAMReadOnlyAccess
After that, you just need to log in AWS Console with this user, go to My Security Credentials and get the access key ID and secret access key pair.
S3 Bucket Permissions
The selected bucket, where the files will be stored, needs to have the appropriate permissions.
By default, Amazon S3 buckets block public access. It needs to be enabled for the selected bucket.
To enable public access you need to do the following:
- After logging in AWS Console you need to go to S3 area.
- Select the bucket where the files will be uploaded and open Permissions tab.
- It is shown that the bucket is not public. You need to press the Edit button below to change it. The public access settings need to be as follows:
- Only the first and second options need actually to be unselected. This is sufficient for the plugin to upload files to the bucket. Then you need to press Save changes to save the new settings.
- You will notice that in Permissions overview, it is now shown that Objects can be public. This means that the plugin can upload files to the bucket and can make them public if the administrator of the website chooses so (by default files uploaded by the plugin to an S3 bucket are private).
Please note that if you create a new IAM user or a new bucket, the plugin may not be able to upload files immediately. Usually it takes some hours until all AWS servers get synchronized.
For any questions or further information you can contact us.
The Iptanus Team
One thought on “How to Configure Amazon S3 for WordPress File Upload Plugin”