> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-mintlify-fbfa8bee.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# How to create an AWS IAM user and S3 bucket

> How to create an AWS IAM user and S3 bucket.

export const Image = ({img, alt, size}) => {
  return <Frame>
      <img src={img} alt={alt} />
    </Frame>;
};

> This guide shows you how you can set up an IAM user and S3 bucket in AWS,
> a prerequisite step for taking backups to S3 or configuring ClickHouse to
> store data on S3

<h2 id="create-an-aws-iam-user">
  Create an AWS IAM user
</h2>

In this procedure, we'll be creating a service account user, not a login user.

1. Log into the AWS IAM Management Console.

2. In the `Users` tab, select `Create user`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-1.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=3e16000ac6c2d43b61e450ee7b2f5821" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1940" data-path="images/_snippets/s3/2025/s3-1.png" />

3. Enter a user-name

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-2.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=dd80fffadb693af591ea44971e7f2e72" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1408" data-path="images/_snippets/s3/2025/s3-2.png" />

4. Select `Next`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-3.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=9137e43704305120463970d47d8cf2e1" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1860" data-path="images/_snippets/s3/2025/s3-3.png" />

5. Select `Next`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-4.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=2903752a40f857eb5864976f04109d82" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1850" data-path="images/_snippets/s3/2025/s3-4.png" />

6. Select `Create user`

The user is now created.
Click on the newly created user

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-5.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=4c2fa389e5929f56df40444a55bbc74b" alt="AWS IAM Management Console - Adding a new user" width="4040" height="792" data-path="images/_snippets/s3/2025/s3-5.png" />

7. Select `Create access key`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-6.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=cfc53de5f55b4bc7eceb41ccc99688eb" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1900" data-path="images/_snippets/s3/2025/s3-6.png" />

8. Select `Application running outside AWS`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-7.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=d5afb983f7439e3c0e3d9586f5828806" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1942" data-path="images/_snippets/s3/2025/s3-7.png" />

9. Select `Create access key`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-8.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=ee08881800876f71af7a59898153ed5e" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1080" data-path="images/_snippets/s3/2025/s3-8.png" />

10. Download your access key and secret as a .csv for use later

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-9.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=822078f97251a9622f7bace556f33828" alt="AWS IAM Management Console - Adding a new user" width="3912" height="2036" data-path="images/_snippets/s3/2025/s3-9.png" />

<h2 id="create-an-s3-bucket">
  Create an S3 bucket
</h2>

1. In the S3 bucket section, select **Create bucket**

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-10.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=6b740b2c9ef2d94fe786fe9227ae111e" alt="AWS IAM Management Console - Adding a new user" width="4040" height="2518" data-path="images/_snippets/s3/2025/s3-10.png" />

2. Enter a bucket name, leave other options default

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-11.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=d1742a92ad933feca48937b1f0a35ed7" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1118" data-path="images/_snippets/s3/2025/s3-11.png" />

<Note>
  The bucket name must be unique across AWS, not just the organization, or it will emit an error.
</Note>

3. Leave `Block all Public Access` enabled; public access isn't needed.

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-12.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=85e38d1137734a81a14e2a596172ed24" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1106" data-path="images/_snippets/s3/2025/s3-12.png" />

4. Select **Create Bucket** at the bottom of the page

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-13.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=38291ed208dd9ea127e29f25446c3c98" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1872" data-path="images/_snippets/s3/2025/s3-13.png" />

5. Select the link, copy the ARN, and save it for use when configuring the access policy for the bucket

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-14.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=9f944aef8f0b6e0661a6fd6c223db0a7" alt="AWS IAM Management Console - Adding a new user" width="4040" height="934" data-path="images/_snippets/s3/2025/s3-14.png" />

6. Once the bucket has been created, find the new S3 bucket in the S3 buckets list and select the bucket name which will take you to the page shown below:

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-15.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=5bf7ecbb4c7815a46bd02e319a12fdd9" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1400" data-path="images/_snippets/s3/2025/s3-15.png" />

7. Select `Create folder`

8. Enter a folder name that will be the target for the ClickHouse S3 disk or backup and select `Create folder` at the bottom of the page

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-16.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=cfadfc3c6279bf305d7bbed67fa39d55" alt="AWS IAM Management Console - Adding a new user" width="3992" height="1352" data-path="images/_snippets/s3/2025/s3-16.png" />

9. The folder should now be visible on the bucket list

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-17.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=72a1112e8c5780e5a5a67a3f09d62736" alt="AWS IAM Management Console - Adding a new user" width="4040" height="1330" data-path="images/_snippets/s3/2025/s3-17.png" />

10. Select the checkbox for the new folder and click on `Copy URL`. Save the URL for use in the ClickHouse storage configuration in the next section.

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-18.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=21b45cb7b23684f9cf099a63b6f803f5" alt="AWS IAM Management Console - Adding a new user" width="4040" height="992" data-path="images/_snippets/s3/2025/s3-18.png" />

11. Select the **Permissions** tab and click on the **Edit** button in the **Bucket Policy** section

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-mintlify-fbfa8bee/Qke-GQkmVyWEhvPu/images/_snippets/s3/2025/s3-19.png?fit=max&auto=format&n=Qke-GQkmVyWEhvPu&q=85&s=36cf473c2c898352c2c37b796478160f" alt="AWS IAM Management Console - Adding a new user" width="4040" height="954" data-path="images/_snippets/s3/2025/s3-19.png" />

12. Add a bucket policy, example below

```json theme={null}
{
    "Version": "2012-10-17",
    "Id": "Policy123456",
    "Statement": [
        {
            "Sid": "abc123",
            "Effect": "Allow",
            "Principal": {
                "AWS": "arn:aws:iam::782985192762:user/docs-s3-user"
            },
            "Action": "s3:*",
            "Resource": [
                "arn:aws:s3:::ch-docs-s3-bucket",
                "arn:aws:s3:::ch-docs-s3-bucket/*"
            ]
        }
    ]
}
```

<Note>
  The policy above makes it possible to perform all actions on the bucket
</Note>

| Parameter | Description                                                 | Example Value                                                         |
| --------- | ----------------------------------------------------------- | --------------------------------------------------------------------- |
| Version   | Version of the policy interpreter, leave as-is              | 2012-10-17                                                            |
| Sid       | User-defined policy id                                      | abc123                                                                |
| Effect    | Whether user requests will be allowed or denied             | Allow                                                                 |
| Principal | The accounts or user that will be allowed                   | arn:aws:iam::782985192762:user/docs-s3-user                           |
| Action    | What operations are allowed on the bucket                   | s3:\*                                                                 |
| Resource  | Which resources in the bucket will operations be allowed in | "arn:aws:s3:::ch-docs-s3-bucket", "arn:aws:s3:::ch-docs-s3-bucket/\*" |

<Note>
  You should work with your security team to determine the permissions to be used, consider these as a starting point.
  For more information on Policies and settings, refer to AWS documentation:
  [https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html](https://docs.aws.amazon.com/AmazonS3/latest/userguide/access-policy-language-overview.html)
</Note>

13. Save the policy configuration
