AWS S3 CLI
- Refer Here for high level cli commands
- List s3 buckets
aws s3 ls
- Create a s3 bucket and upload some objects
aws s3 mb s3://qtdec12022
aws s3 ls
aws s3 cp one.mp3 s3://qtdec12022
- upload some objects in new folder tools
aws s3 cp two.mp3 s3://qtdec12022/tools/
aws s3 cp s3://qtdec12022/one.mp3 s3://qtdec12022/tools/one.mp3
- Try to write a ls command which shows all the objects in your s3 bucket
aws s3 ls s3://qtdec12022 --recursive
- Try to move the objects in the top level into folder called as music
- create a sync between s3 bucket and some folder in your laptop
- Make changes in your synced folder on your laptop and sync them back to s3 bucket.
- Create the following file with name index.html
<h1> Hello </h1>
- Create s3 bucket with
<some name>.com
and make index.html as home page to static website.
- Command:
aws s3 website s3://qtwebsitedec.com --index-document index.html --error-document index.html
- To make the object public
aws s3 cp index.html s3://qtwebsitedec.com --acl "public-read
- Make all the objects uploaded in previous bucket also public read
- Enable versioing from cli
Lifecycle Rules
- Create Lifecycle rules