Lab 4 – Pre-sign URL (sử dụng CLI)

1. Yêu cầu đã cài sẵn AWS CLI và thiết lâp profile tại máy local
2. Upload 1 file bất kì lên S3
3. Tham khảo câu lệnh sau để phát hành 1 presign url cho object trên s3
<https://docs.aws.amazon.com/cli/latest/reference/s3/presign.html>
4. Sử dụng URL để download file trên trình duyệt.
5. Đợi hết thời gian hiệu lực của url, thử lại => expired.

1. Yêu cầu đã cài sẵn AWS CLI và thiết lâp profile tại máy local (có thể cài thêm MFA tăng tính bảo mật)

image.png

2. Upload 1 file bất kì lên S3

image.png

Nếu chưa Block Public Access thì bật theo mặc định

image.png

3. Tham khảo câu lệnh sau để phát hành 1 presign url cho object trên s3

https://docs.aws.amazon.com/cli/latest/reference/s3/presign.html

image.png

nếu không config thì mặc định lấy region us-east-1

# cách 1:
aws s3 presign s3://amzn-s3-nvminh162-bucket/test-image/new.JPEG 
			--expires-in 60 
			--region ap-southeast-1 
			--profile mfa-developer01-202602060

# cách 2:
aws s3 presign s3://amzn-s3-nvminh162-bucket/test-image/new.JPEG 
		--expires-in 60
		--profile mfa-developer01-20260206

image.png

4. Sử dụng URL (download file trên trình duyệt)

image.png

5. Đợi hết thời gian hiệu lực của url, thử lại => expired.