s3 is known as Simple Storage Service by AWS is an object storage service that offers great scalability, data availability, security, and performance.
Note: The AWS CLI must be configured on your local work station. simple by downloading it from AWS. I will create a blog for this in the future. After installing AWS CLI for your Operating System (windows, MacOS or linux)
Follow the next steps now to configure the AWS CLI (How to Copy from a server to s3 and vice versa)
$aws configure AWS Access Key ID [None]: Your Access Key ID AWS Secret Access Key [None]: Your Secret Key Default region name [None]: Enter your desired region in this format (us-west-2) Default output format [None]: I usually leave this by default as (json)
Nevertheless, After configuring the AWS CLI, the next would be to enter the right syntax to copy files to and from s3.
Note: Nonetheless, You will need to have the right permissions in place to perform these task.
Here are the use cases
Copy from s3 to Host: Moreover, we have a bucket sitting at the root level with a folder in it and a file inside the folder.
Then, you will need to specify the path on your server you want this to be copied to.
aws s3 cp s3://s3bucketname/s3foldername/fileexample.7z G:fileexample.7z
Copy from host to s3: What this does is simply copy the file in drive C and upload it to s3. However, we have the bucket, the folder inside the bucket, and the file that will reside inside the bucket. Furthermore, Follow by the right region you want the file to be uploaded to
aws s3 cp C:filename.zip s3://s3bucketname/s3foldername/fileexample.zip --region ap-northeast-1