1. Connect AWS S3
Open Command Prompt
run AWS Configure
enter AWS Access Key ID
enter AWS Secret Access Key
Default region name – its shown by default for your account but you can enter it specifically for the Region you want to access the s3 bucket.
default output format – json
2. List all S3 Buckets
run command – aws s3 ls
3. Create S3 Bucket
run command – aws s3 mb s3://bucketcreationcli
Syntax : aws s3 mb s3://<bucketname> | Note : Bucket name must be unique and must not contain spaces or uppercase letters. See rules for bucket naming | for easy configuration of buckets with the permissions use AWS console for creating s3 bucket
4. Upload Folder with files inside it to S3 bucket from Local System
change directory in command prompt where folder is located on local system; which needs to be uploaded to s3 bucket
run command – aws s3 cp s3-uploadtesting s3://bucketcreationcli/s3-uploadtesting –recursive
Syntax : aws s3 cp s3://<bucketname>/<foldername> –recursive
5. Download Folder with files inside it to Local System from S3 bucket
run command – aws s3 cp s3://bucketcreationcli/ . –recursive
Download Folder with files inside it to Local System from S3 bucketSyntax : aws s3 cp s3://<bucketname>/ . –recursive
6. Upload Single file to S3 bucket in a specific Folder from Local System
run command – aws s3 cp s3-uploadtesting\File.txt s3://bucketcreationcli/s3-uploadtesting/file.txt
Upload Single file to S3 bucket in a specific Folder from Local SystemSyntax : aws s3 cp <foldername>\<filename> s3://<bucketname>/<foldername>/<filename>
7. Delete File from S3 Bucket
run command – aws s3 rm s3://bucketcreationcli/”S3 Upload.txt”
Syntax : aws s3 rm s3://<bucketname>/<“filename”>
8. Delete Folder with files inside it from S3 Bucket
run command – aws s3 rm s3://bucketcreationcli/s3-uploadtesting –recursive
Delete Folder with files inside it from S3 BucketSyntax : aws s3 rm s3://<bucketname>/<filename> –recursive
9. Delete Specific file in a folder from S3 Bucket
run command – aws s3 rm s3://bucketcreationcli/s3-uploadtesting/”s3 upload.txt”
Delete Specific file in a folder from S3 Bucket
Syntax : aws s3 rm s3://<bucketname>/<foldername>/<“filename”>