# S3 bucket policy current example

**URL:** https://meta.discourse.org/t/s3-bucket-policy-current-example/213446
**Category:** Support
**Created:** [December 30, 2021, 12:22pm UTC](https://meta.discourse.org/t/s3-bucket-policy-current-example/213446 "2021-12-30T12:22:33Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [December 30, 2021, 12:22pm UTC](https://meta.discourse.org/t/s3-bucket-policy-current-example/213446/1 "2021-12-30T12:22:33Z")

</div>

Referring to this topic on how to set up an S3 bucket policy for Discourse:

> [@Set up file and image uploads to S3](https://meta.discourse.org/t/setting-up-file-and-image-uploads-to-s3/7229):
>
> So, you want to use S3 to handle image uploads? Here’s the definitive guide, but also see [Configure an S3 compatible object storage provider for uploads](https://meta.discourse.org/t/configure-an-s3-compatible-object-storage-provider-for-uploads/148916) to see how to configure your app.yml. S3 registration Head over to [https://aws.amazon.com/free/](https://aws.amazon.com/free/) and click on [Create a Free Account] During the create account process, make sure you provide payment information, otherwise you won’t be able to use S3. There’s no registration fee, you will only be charged for [what you use](https://aws.amazon.com/s3/pricing/), if you exceed the [AWS …](https://aws.amazon.com/free/)

it appears to be out of date, and missing things currently needed, such as Principal information. Is there any more current advice on what to do? I know I am asking to be spoon fed, but as one poster pointed out this is more or less black magic to most people and any help would be appreciated. I am specifically referring just to the given bucket policy example, not the entire thread.

---

<div class="post-metadata">

### Author: ![tggm](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tggm/32/212852_2.png) [@tggm](https://meta.discourse.org/u/tggm)
#### Post date: [December 31, 2021, 6:55pm UTC](https://meta.discourse.org/t/s3-bucket-policy-current-example/213446/2 "2021-12-31T18:55:01Z")

</div>

I also have this issue. The `s3:HeadBucket` action does not exist and AWS throws a ton of errors about the policy.

---

<div class="post-metadata">

### Author: ![Andro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/andro/32/173721_2.png) [@Andro](https://meta.discourse.org/u/Andro)
#### Post date: [January 1, 2022, 9:56am UTC](https://meta.discourse.org/t/s3-bucket-policy-current-example/213446/3 "2022-01-01T09:56:42Z")

</div>

I spent time learning about the policy concepts. I developed this which works, but it’s all wide open, and so needs considerable refinement. But it does allow you to get on and setup all the rest of the requirements for S3 storage for Discourse. A starting point that currently works, at least.

```plaintext
{
    "Version": "2012-10-17",
    "Id": "Policy1640915383804",
    "Statement": [
        {
            "Sid": "Stmt1640915382266",
            "Effect": "Allow",
            "Principal": "*",
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::xyzzy-file-uploads",
                "arn:aws:s3:::xyzzy-file-uploads/*"
            ]
        }
    ]
}

```
