Archive for September, 2022

Useful S3 CLI commands

Wednesday, September 14th, 2022

Create Bucket

aws s3api create-bucket --acl public-read \
--bucket bucket-20220914-s3-6 \
--region ap-east-1  \
--create-bucket-configuration LocationConstraint=ap-east-1

https://awscli.amazonaws.com/v2/documentation/api/latest/reference/s3api/create-bucket.html

Remarks – how to enable versioning, encryption

Delete Bucket

aws s3 rb s3://bucket-20220914-s3-6 --force

Prepare S3 bucket to serve Website

aws s3 website \
s3://bucket-20220914-s3-6 \
--index-document index.html