# 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="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FBUDlyyOfWoBZPBiNuwGC%2Fimage.png?alt=media&#x26;token=65773b52-0d7e-4d3f-b68f-0eb3d8b3ceea" 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="https://2652559519-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F3i5YcUkcXyIsWHIhRO2d%2Fuploads%2FSdvi6WiJ9Xs3NWdvmmeL%2Fimage.png?alt=media&#x26;token=9d60c7e6-dd83-4609-abfc-eb8a7381f3c7" alt=""><figcaption></figcaption></figure>

4. Using Your Storage - [usage](https://documentation.deep-image.ai/storages/usage "mention")<br>
