Skip to content

Instantly share code, notes, and snippets.

@ehsahil
Last active June 19, 2019 18:19
Show Gist options
  • Save ehsahil/1eebf1a9e962c1d39cff8203e17dd03d to your computer and use it in GitHub Desktop.
Save ehsahil/1eebf1a9e962c1d39cff8203e17dd03d to your computer and use it in GitHub Desktop.
1. Listing AWS bucket content. (Testing for list permission)
Sahils-MacBook-Pro:~ sahil$ aws s3 ls s3://bucket
2. Writing on AWS Bucket. (Testing for write Permission)
Sahils-MacBook-Pro:~ sahil$ aws s3 cp test.txt s3://bucket (Copying test.txt into the bucket with no public file read permission)
Sahils-MacBook-Pro:~ sahil$ aws s3 mv test.txt s3://bucket (Moving test.txt into the bucket with no public file read permission)
Copy test.txt file into the aws s3 bucket with public file read permission.
Sahils-MacBook-Pro:~ sahil$ aws s3 cp test.txt s3://bucket --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers
Sometimes the bucket are only available in a particular region. For that use the following regions with `--region` flag.
1. US East (N. Virginia) - us-east-1
2. US East (Ohio) - us-east-2
3. US West (N. California) - us-west-1
4. US West (Oregon) - us-west-2
5. Canada (Central) - ca-central-1
6. Asia Pacific (Mumbai) - ap-south-1
7. Asia Pacific (Seoul) - ap-northeast-2
8. Asia Pacific (Osaka-Local) *** - ap-northeast-3
9. Asia Pacific (Singapore) - ap-southeast-1
10. Asia Pacific (Sydney) - ap-southeast-2
11. Asia Pacific (Tokyo) - ap-northeast-1
12. China (Beijing) - cn-north-1
13. China (Ningxia) - cn-northwest-1
14. EU (Frankfurt) - eu-central-1
15. EU (Ireland) - eu-west-1
16. EU (London) - eu-west-2
17. EU (Paris) - eu-west-3
18. South America (São Paulo) - sa-east-1
Example:
Sahils-MacBook-Pro:~ sahil$ aws s3 ls s3://bucket --region us-east-2
3. Deleting files from the bucket.
Sahils-MacBook-Pro:~ sahil$ aws s3 rm s3://bucket/test.txt
Reference : https://docs.aws.amazon.com/general/latest/gr/rande.html
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment