# AWS CLI

## **Tổng quan**

**AWS CLI** là công cụ dòng lệnh dùng để làm việc với object storage tương thích S3.

Bạn có thể sử dụng AWS CLI với **vStorage (HAN02)** bằng cách trỏ endpoint về: <https://han02.vstorage.vngcloud.vn>

Sử dụng AWS CLI khi bạn cần:

* Tự động hóa thao tác bucket/object (CI/CD, backup, migration).
* Upload, download, sync dữ liệu hàng loạt, tạo presign URL.
* Troubleshoot quyền truy cập bằng các lệnh có thể lặp lại.

Tài liệu chính thức: [AWS CLI](https://aws.amazon.com/cli/).

***

### Yêu cầu

* Có project vStorage tại **HAN02**.
* S3 endpoint:\
  `https://han02.vstorage.vngcloud.vn`
* S3 Access Key và Secret Key của project ([tham khảo mục tạo S3 key](/vng-cloud-document/vn/vstorage/object-storage/object-storage-han02/bat-dau-voi-object-storage/buoc-2-khoi-tao-s3-key.md)).
* Cài đặt AWS CLI trên máy ([tham khảo hướng dẫn cài đặt aws-cli](#tong-quan)).

***

### Kiểm tra kết nối nhanh

Sau khi cấu hình xong, chạy lệnh sau để kiểm tra:

```
aws s3 ls \
  --endpoint-url https://han02.vstorage.vngcloud.vn \
  --profile han02-prod
```

***

{% hint style="info" %}
**⚠️** Lưu ý quan trọng

Từ phiên bản **AWS CLI v2.23.0 trở lên**, AWS mặc định bật thuật toán checksum **CRC64\_NVME**.

Hiện tại vStorage hỗ trợ các thuật toán checksum sau:

* CRC32
* CRC32C
* SHA1
* SHA256

Khuyến nghị sử dụng **AWS CLI phiên bản thấp hơn v2.23.0** để tránh lỗi không tương thích.

Nếu sử dụng AWS CLI v2.23.0 trở lên, cấu hình thêm:

```
aws configure set request_checksum_calculation when_required --profile han02-prod
```

{% endhint %}

***

## **Chi tiết**

* [Tích hợp công cụ AWS CLI với vStorage](/vng-cloud-document/vn/vstorage/object-storage/object-storage-han02/3rd-party-softwares/aws-cli/tich-hop-cong-cu-aws-cli-voi-vstorage.md)
* [Sử dụng công cụ AWS CLI](/vng-cloud-document/vn/vstorage/object-storage/object-storage-han02/3rd-party-softwares/aws-cli/su-dung-cong-cu-aws-cli.md)


---

# 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.vngcloud.vn/vng-cloud-document/vn/vstorage/object-storage/object-storage-han02/3rd-party-softwares/aws-cli.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.
