AWS S3 Cheatsheet

Complete AWS S3 reference: buckets, objects, permissions, security, sync and presigned URLs.

Command/ItemDescriptionExampleCategory
aws s3 lsList all S3 bucketsaws s3 lsBucket
aws s3 mbCreate a bucketaws s3 mb s3://my-bucketBucket
aws s3 rbRemove a bucketaws s3 rb s3://my-bucket --forceBucket
aws s3 cpCopy files to/from S3aws s3 cp file.txt s3://my-bucket/file.txtObjects
aws s3 mvMove/rename objectsaws s3 mv file.txt s3://my-bucket/Objects
aws s3 rmDelete an objectaws s3 rm s3://my-bucket/file.txtObjects
aws s3 syncSync local folder & bucketaws s3 sync ./dist s3://my-bucketSync & Transfer
S3 ACLAccess control for objects/bucketsaws s3api put-bucket-acl --bucket my-bucket --acl public-readPermissions
Bucket PolicyJSON policy to control accessaws s3api put-bucket-policy --bucket my-bucket --policy file.jsonPermissions
IAM RolesAccess via AWS roles instead of keysAttach S3FullAccess to an IAM RoleSecurity
KMS EncryptionEncrypt S3 objects with KMSaws s3 cp file s3://bucket --sse aws:kmsSecurity
Presigned URLGenerate temporary read/write linksaws s3 presign s3://my-bucket/file.txtURL & Access
Object VersioningKeep history of object versionsaws s3api put-bucket-versioning --bucket my-bucket --versioning-configuration Status=EnabledSecurity