# Use an S3 User

### Setting up an IAM Role (in development)

If using an IAM role to provide access

1\) **Create a policy that allows access to the bucket:**&#x20;

* Go to the AWS IAM Console → Policies → Create Policy
* Go to the JSON tab
* Copy the following policy and paste it into the visual editor. Replace `{your-bucket-name}` with the name of your S3 bucket.

```
{
    "Version": "2012-10-17",
    "Statement": [
        {
        "Effect": "Allow",
        "Action": [
                "s3:GetBucketLocation",
                "s3:GetObject",
                "s3:ListBucket"

        ],
        "Resource": [
                "arn:aws:s3:::{your-bucket-name}/*",
                "arn:aws:s3:::{your-bucket-name}"
        ]
        }
    ]
}
```

* You can save the policy as `HockeyStack-DataSyncs-S3Access` &#x20;

\
2\) **Create an IAM user:**&#x20;

* Go to the AWS IAM Console → Users → Add Users
* After creating a user name, select "Attach Policies Directly" to add the `HockeyStack-DataSyncs-S3Access`  policy created in the previous step

3\) **Retrieving the Access Key and Secret Access Key**

* In the Users tab, find the user we created&#x20;
* Go to **Security credentials** tab and navigate to the **Access keys** section
* Click **Create access key**
* From the **Use Case** options, select the **Third-party service** option and then click **Next**
* Enter a **Description tag value** and then click **Create access key**
* Copy the **Access key** and **Secret access key** values


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.hockeystack.com/integrations/datasyncs/connecting-your-warehouse/authenticate-s3/use-an-s3-user.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
