Amazon S3

Amazon Simple Storage Service 

Buckets

Create an S3 Bucket

aws s3 mb s3://mybucket --region eu-west-2

The bucket name must be globally unique i.e. unique across AWS not just your account.

List S3 Buckets

aws s3 ls 

Copy to an S3 Bucket

This recursively copies a directory and all files...

aws s3 cp mydirectory s3://mybucket --recursive --acl public-read

Empty an S3 Bucket

Delete from an S3 Bucket

Delete an S3 Bucket

aws s3 rb s3://mybucket

aws s3 rb s3://mybucket --force 

Using the --force option deletes all objects and subfolders in the bucket and then removes the bucket 

Access an S3 file by URL

The following URLS are equivalent...

https://s3.myregion.amazonaws.com/mybucket/myfolder/myfile.txt

https://mybucket.s3.myregion.amazonaws.com/myfolder/myfile.txt

Sync with an S3 Bucket

Bibliography