Skip to content

Commit

Permalink
Create presigned URLs using AWS CLI
Browse files Browse the repository at this point in the history
  • Loading branch information
RealOrangeOne committed Oct 29, 2024
1 parent 8c80579 commit 612d1bf
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions docs/notes/infrastructure/aws-presigned-urls-cli.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
---
title: Create presigned URLs using AWS CLI
tags:
- AWS
sources:
- https://docs.aws.amazon.com/cli/latest/reference/s3/presign.html
---

Sometimes, you only have access to the `aws` CLI, and need to generate presigned URLs to S3 objects.

The `aws s3 presign` command will do this, creating URLs signed as the currently-authenticated user.

```bash
export AWS_ACCESS_KEY_ID=xxx AWS_SECRET_ACCESS_KEY=xxx
aws s3 presign --expires-in 3600 s3://my-bucket/file.txt
```

!!! note
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 comments on commit 612d1bf

Please sign in to comment.