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

# كيفية إنشاء مستخدم AWS IAM وحاوية S3

> كيفية إنشاء مستخدم AWS IAM وحاوية S3.

export const Image = ({img, alt, size = "lg"}) => {
  const normalizedSize = ["sm", "md", "lg"].includes(size) ? size : "lg";
  return <div className={`ch-image-${normalizedSize}`}>
      <Frame>
        <img src={img} alt={alt} />
      </Frame>
    </div>;
};

> يوضح لك هذا الدليل كيفية إعداد مستخدم AWS IAM وحاوية S3 في AWS،
> وهي خطوة أساسية مطلوبة لأخذ النسخ الاحتياطية إلى S3 أو تهيئة ClickHouse
> لتخزين البيانات على S3

<div id="create-an-aws-iam-user">
  ## إنشاء مستخدم AWS IAM
</div>

في هذا الإجراء، سننشئ مستخدمًا لحساب خدمة، وليس مستخدم تسجيل دخول.

1. سجّل الدخول إلى AWS IAM Management Console.

2. في علامة التبويب `Users`، حدِّد `Create user`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-1.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=24489adfdf390487a8b511420d7d8b1d" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1940" data-path="images/_snippets/s3/2025/s3-1.webp" />

3. أدخل اسم المستخدم

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-2.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=f737f23768d96b91a409378c4e4e0a1a" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1408" data-path="images/_snippets/s3/2025/s3-2.webp" />

4. حدِّد `Next`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-3.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=65703827e3f10db09594596d6e3d35f5" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1860" data-path="images/_snippets/s3/2025/s3-3.webp" />

5. حدِّد `Next`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-4.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=d41dd4c0b5d067589e414f38db694232" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1850" data-path="images/_snippets/s3/2025/s3-4.webp" />

6. حدِّد `Create user`

تم الآن إنشاء المستخدم.
انقر على المستخدم الذي أنشأته للتو

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-5.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=24ef93acc68a605601356713d5169880" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="792" data-path="images/_snippets/s3/2025/s3-5.webp" />

7. حدِّد `Create access key`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-6.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=f82dd58b921a7392007ec046f7662e25" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1900" data-path="images/_snippets/s3/2025/s3-6.webp" />

8. حدِّد `Application running outside AWS`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-7.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=0d09defe598f3ee22f158e4ad77a12a9" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1942" data-path="images/_snippets/s3/2025/s3-7.webp" />

9. حدِّد `Create access key`

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-8.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=70a885c0ce833983debde5b7f6a203a7" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1080" data-path="images/_snippets/s3/2025/s3-8.webp" />

10. نزّل مفتاح الوصول والمفتاح السري بصيغة ‎.csv‎ لاستخدامهما لاحقًا

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-9.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=bd2cd2b2d15ab4e79f6acc37d7fb54d6" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="3912" height="2036" data-path="images/_snippets/s3/2025/s3-9.webp" />

<div id="create-an-s3-bucket">
  ## إنشاء حاوية S3
</div>

1. في قسم حاوية S3، حدّد **Create bucket**

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-10.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=80ebf03184a2f06dfc4aaceb02224d50" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="2518" data-path="images/_snippets/s3/2025/s3-10.webp" />

2. أدخل اسم الحاوية، واترك الخيارات الأخرى على القيم الافتراضية

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-11.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=fd90239626fc89bc318053e216a5722c" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1118" data-path="images/_snippets/s3/2025/s3-11.webp" />

<Note>
  يجب أن يكون اسم الحاوية فريدًا على مستوى AWS بالكامل، وليس على مستوى المؤسسة فقط، وإلا فسيظهر خطأ.
</Note>

3. اترك `Block all Public Access` مفعّلًا؛ إذ لا حاجة إلى الوصول العام.

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-12.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=b76c23d7e534079c093293fe3a150e3a" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1106" data-path="images/_snippets/s3/2025/s3-12.webp" />

4. حدّد **Create Bucket** في أسفل الصفحة

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-13.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=a380d4f43f51a0559cd42058c6eb5287" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1872" data-path="images/_snippets/s3/2025/s3-13.webp" />

5. حدّد الرابط، وانسخ ARN، واحفظه لاستخدامه عند تهيئة سياسة الوصول الخاصة بالحاوية

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-14.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=e6a7199c1f3c437c3492595ea9b5960b" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="934" data-path="images/_snippets/s3/2025/s3-14.webp" />

6. بعد إنشاء الحاوية، اعثر على حاوية S3 الجديدة في قائمة حاويات S3 وحدّد اسم الحاوية، ما سينقلك إلى الصفحة الموضحة أدناه:

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-15.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=2c0d6a76427e40a0bf696a6a1627a983" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1400" data-path="images/_snippets/s3/2025/s3-15.webp" />

7. حدّد `Create folder`

8. أدخل اسم مجلد ليكون الوجهة لقرص S3 في ClickHouse أو للنسخة الاحتياطية، ثم حدّد `Create folder` في أسفل الصفحة

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-16.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=7278bdaa08d0214a24e214d29a6cd2a9" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="3992" height="1352" data-path="images/_snippets/s3/2025/s3-16.webp" />

9. ينبغي أن يكون المجلد الآن ظاهرًا في قائمة الحاوية

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-17.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=65828c6ebd93b40b4484825e65b6af34" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="1330" data-path="images/_snippets/s3/2025/s3-17.webp" />

10. حدّد مربع الاختيار للمجلد الجديد وانقر على `Copy URL`. احفظ URL لاستخدامه في تهيئة التخزين الخاصة بـ ClickHouse في القسم التالي.

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-18.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=51694277aca44488f5ca6b0c1a84e81f" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="992" data-path="images/_snippets/s3/2025/s3-18.webp" />

11. حدّد علامة التبويب **Permissions** وانقر على الزر **Edit** في قسم **Bucket Policy**

<Image size="lg" img="https://mintcdn.com/private-7c7dfe99-vortex-format/tee0vtC1xMN3cEIV/images/_snippets/s3/2025/s3-19.webp?fit=max&auto=format&n=tee0vtC1xMN3cEIV&q=85&s=7db02c381e08232e0c64d650be086419" alt="AWS IAM Management Console - إضافة مستخدم جديد" width="4040" height="954" data-path="images/_snippets/s3/2025/s3-19.webp" />

12. أضف سياسة للحاوية، كما في المثال أدناه

```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>
  تتيح السياسة أعلاه تنفيذ جميع الإجراءات على الحاوية
</Note>

| المعلمة   | الوصف                                                 | قيمة مثال                                                             |
| --------- | ----------------------------------------------------- | --------------------------------------------------------------------- |
| Version   | إصدار مفسّر السياسة، اتركه كما هو                     | 2012-10-17                                                            |
| Sid       | معرّف السياسة الذي يحدده المستخدم                     | abc123                                                                |
| Effect    | ما إذا كان سيتم السماح بطلبات المستخدم أو رفضها       | Allow                                                                 |
| Principal | الحسابات أو المستخدم الذي سيُسمح له                   | 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>
  ينبغي لك العمل مع فريق الأمان لديك لتحديد الأذونات التي ينبغي استخدامها؛ واعتبر هذه نقطة بداية.
  لمزيد من المعلومات حول السياسات والإعدادات، راجع وثائق AWS:
  [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. احفظ تهيئة السياسة
