When setting up Press3 to store your static WordPress assets on your own Amazon S3 bucket, you'll need to provide credentials for a user who has access to the S3 bucket. For maximum security, this user should only have access to what they need to.
In this article, we'll show you how to create an IAM policy for your user that has access to only the bucket that's going to be used.
Note: This article assumes that you've already created an S3 bucket for use with Press3. If you haven't yet done so, take a look at our article on creating Amazon S3 buckets.
- Start by logging into the IAM section of your AWS console.
- On the left side menu, click on Policies to access your IAM policies.
- To create a new policy, click on the Create Policy button at the top of the page.
- When creating policies, you can either use the visual editor or configure your policy using JSON. For this article, we’ll be using JSON. Simply click on the JSON tab to access the JSON editor.
- Within the JSON editor, enter the following policy, replacing BUCKET_NAME with the name of your S3 bucket.
This policy will ensure that the user has permissions to access and make changes to items inside the bucket, but can’t do anything else, including access other S3 buckets that may exist on your account.
Once the bucket policy is in place, click on Review Policy.
Finally, create a name and optional description for your policy, then click on Create Policy to create the new policy.
That's it! Your policy is now created! From here, you can easily create a new IAM user that uses this policy for accessing your S3 bucket with Press3.