If you are new to S3 it’s recommended that you go through this free AWS S3 crash course.
If you want to know how to install AWS CLI, follow steps on this post.
Get help
aws s3 helpor
aws s3api helpCreate bucket
aws s3 mb s3://bucket-nameRemoving bucket
aws s3 rb s3://bucket-nameTo remove a non-empty bucket (Extremely careful while running this). This will remove all contents in the bucket including subfolders and data in them.
aws s3 rb s3://bucket-name --forceCopy object
aws s3 cp mypic.png s3://mybucket/Copy buckets
aws s3 cp myfolder s3://mybucket/myfolder --recursive(Note: –recursive will copy recursively everything including the subfolders)
Sync buckets
aws s3 sync <source> <target> [--options]
List buckets
aws s3 lsList specific bucket
aws s3 ls s3://mybucketBucket location
aws s3api get-bucket-location --bucket <bucket-name>Logging status
aws s3api get-bucket-logging --bucket <bucket-name>
ACL (Access Control List)The following example copies an object into a bucket. It grants read permissions on the object to everyone and full permissions (read, readacl, and writeacl) to the account associated with user@example.com.
aws s3 cp file.txt s3://my-bucket/ --grants read=uri=http://acs.amazonaws.com/groups/global/AllUsers full=emailaddress=user@example.com
No comments:
Post a Comment