Identity and Access Management (IAM) policies determine what actions are allowed for content in your S3 bucket. We must create policies to allow CloudCannon and imgix to perform specific actions for your bucket and any object stored within it. CloudCannon requires permission to upload, edit, and preview your assets, while imgix only requires permission to read and list content from your S3 bucket in order to serve your assets.
For more information about Amazon S3 policies, please see their documentation.
In this step, you will create two policies, one for CloudCannon and one for imgix.
- Open the AWS console and navigate to IAM under Security, Identity, & Compliance section in the main menu.
- Navigate to Policies under Access management.
- Click the Create Policy button.
- Open the JSON tab of the new policy and paste the following JSON code. Make sure to replace “PlaceholderBucketName” with your S3 bucket name.
- Click the Next: Tags button, then click Next again.
- Name your policy “CloudCannon Access Policy”, then click Create policy.
- Repeat steps 3 to 5 and paste the following JSON code. Make sure to replace “PlaceholderBucketName” with your S3 bucket name.
- Name your policy “imgix Access Policy”, then click Create policy.