# AWS S3

To configure storage for the user **"di-test"** with an existing S3 bucket **"di-test-bucket"**, follow these steps:

1. Create IAM User and Permissions.

   1. Log in to the AWS Console: <https://console.aws.amazon.com/>
   2. Navigate to **IAM** → **Users** → **Add users**.
   3. Enter **di-storage** as the username.
   4. Select **Attach policies directly**, then click **Create policy**.
   5. Choose the **JSON** tab and paste the following content:

      ```json
      {
        "Version": "2012-10-17",
        "Statement": [
          {
            "Effect": "Allow",
            "Action": [
              "s3:GetBucketLocation",
              "s3:GetObjectAttributes",
              "s3:PutObject",
              "s3:GetObject",
              "s3:ListBucket",
              "iam:SimulatePrincipalPolicy"
            ],
            "Resource": [
              "arn:aws:s3:::di-test-bucket/*",
              "arn:aws:s3:::di-test-bucket",
              "arn:aws:iam::<account_id>:user/di-test"
            ]
          }
        ]
      }
      ```
   6. Replace `<account_id>` with your AWS Account ID (without dashes).
   7. Complete the user creation process.
   8. Name the policy **di-policy** and save it.
   9. Back on the user creation page, refresh the policy list, find **di-policy**, and attach it to the user.
   10. Complete the user creation process.

2. Generate Access Keys

   1. Go to the newly created user **di-test**, open the **Security credentials** tab.
   2. Click **Create access key** → Choose **Third-party service**.
   3. Generate the keys and **copy** the Access Key ID and Secret Access Key. These will be used in Deep Image.

3. Set Up Storage in Deep Image

   1. Log in to the[ Deep Image web app](https://deep-image.ai/app/).
   2. Navigate to **Profile** → **My Profile** → [**Storages**](https://deep-image.ai/app/my-profile/storages). <br>

      <figure><img src="/files/mYDfK0yqgAHKm4k8bF1u" alt=""><figcaption></figcaption></figure>
   3. Select **AWS** as the storage type and click **ADD**.
   4. Fill in the following:
      1. **Name**: `di-storage`
      2. **Bucket**: `di-test-bucket`
      3. **Access Key** and **Secret Access Key** from step 2.<br>

   <figure><img src="/files/GzZSAL2dbzNjqNGdmLGK" alt=""><figcaption></figcaption></figure>

4. Using Your Storage - [Usage](/storages/usage.md)<br>


---

# 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://documentation.deep-image.ai/storages/setup/aws-s3.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.
