-
Notifications
You must be signed in to change notification settings - Fork 2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Log notes on how to set up AWS S3 for Uppy from scratch (draft)
- Loading branch information
Showing
1 changed file
with
72 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
Assuming you have MY-UPPY-USER and MY-UPPY-BUCKET, here’s how you can allow MY-UPPY-USER to get STS Federated Token and upload files to MY-UPPY-BUCKET: | ||
|
||
1. Set CORS settings on `MY-UPPY-BUCKET` bucket: | ||
|
||
```json | ||
[ | ||
{ | ||
"AllowedHeaders": [ | ||
"*" | ||
], | ||
"AllowedMethods": [ | ||
"GET", | ||
"PUT", | ||
"HEAD", | ||
"POST", | ||
"DELETE" | ||
], | ||
"AllowedOrigins": [ | ||
"*" | ||
], | ||
"ExposeHeaders": [ | ||
"ETag", | ||
"Location" | ||
] | ||
} | ||
] | ||
``` | ||
|
||
2. Add a Policy to `MY-UPPY-BUCKET`: | ||
|
||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "MyMultipartPolicyStatement1", | ||
"Effect": "Allow", | ||
"Principal": { | ||
"AWS": "arn:aws:iam::*:user/MY-UPPY-USER" | ||
}, | ||
"Action": [ | ||
"s3:PutObject", | ||
"s3:ListMultipartUploadParts", | ||
"s3:AbortMultipartUpload" | ||
], | ||
"Resource": "arn:aws:s3:::MY-UPPY-BUCKET/*" | ||
} | ||
] | ||
} | ||
``` | ||
|
||
3. Add a Policy to `MY-UPPY-USER`: | ||
|
||
**Optional** if you’d like to enable signing on the client: | ||
|
||
```json | ||
{ | ||
"Version": "2012-10-17", | ||
"Statement": [ | ||
{ | ||
"Sid": "MyStsPolicyStatement1", | ||
"Effect": "Allow", | ||
"Action": [ | ||
"sts:GetFederationToken" | ||
], | ||
"Resource": [ | ||
"arn:aws:sts::*:federated-user/*" | ||
] | ||
} | ||
] | ||
} | ||
``` |