Skip to content

Commit 612d1bf

Browse files
committed
Create presigned URLs using AWS CLI
1 parent 8c80579 commit 612d1bf

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
---
2+
title: Create presigned URLs using AWS CLI
3+
tags:
4+
- AWS
5+
sources:
6+
- https://docs.aws.amazon.com/cli/latest/reference/s3/presign.html
7+
---
8+
9+
Sometimes, you only have access to the `aws` CLI, and need to generate presigned URLs to S3 objects.
10+
11+
The `aws s3 presign` command will do this, creating URLs signed as the currently-authenticated user.
12+
13+
```bash
14+
export AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx
15+
aws s3 presign --expires-in 3600 s3://my-bucket/file.txt
16+
```
17+
18+
!!! note
19+
URLs are signed with a region of `us-east-1`. Pass `--region` or set `$AWS_REGION` to override. URLs with the wrong region are not valid.

0 commit comments

Comments
 (0)