Skip to main content

My AWS S3 crash course

This post aims to be your quick start guide to AWS S3, ie. Amazon Web Services. Follow along and you'll feel like you just had a roller coaster ride in AWS S3 world.

First of all, get a free AWS account. AWS includes many services and as mentioned above I will only cover S3 here. You may be wondering what is S3. In simple words S3 is Amazon's cloud backup service. Their Free tier is limited, and any usage beyond the limit will incur charges. So make sure you read through the pricing structure and understand it. Charges can accumulate fast if you don't pay attention or are not careful of your usage. You have been warned. You and only you are responsible for your bills. See disclaimer at the end of this post. Your reading of this post implies your understanding and agreement to the disclaimer.

Once you are equipped with an AWS account, login to it and launch AWS management console.

Create a Bucket

In S3's terminology, a bucket is a collection of files or objects that you want to backup to your S3 cloud.

It is a good practise to compress files to make them into a single file before you upload to S3. This is because individual files would quickly consume your allocated number of objects in a free trier and you will start incurring charges for any usage beyond the limit. Remember that AWS S3 pricing policy tracks numbers of objects, and number of requests you make, therefore, you want to minimize number of objects you upload.

Click Create Bucket, enter your Bucket Name, and Region to your liking and your bucket should be ready to receive files.

Upload File - via web interface

Once you have the bucket ready, you can begin uploading your zip file(s). To upload file via web interface, click Upload button, then click Add Files and finally click Start Upload. Congrats! You have successfully uploaded your first archive.

Retrieve File - via web interface

To download a file, click checkbox next to file you want to download. Click Actions button, Right click on Download and Save Link As.... Click OK to close this menu.

Delete File - via web interface

Similarly, to delete a file Click same checkbox next to file, then Actions->Delete. Click OK to confirm.

Using S3 Command Line Interface

You can access S3 service via command line using Amazon's S3 CLI tool. CLI installer is available on AWS website. Download and install it. Using AWS Identity and Access Management Console, create a new user for s3 command line interface and give it access per the document here:
https://aws.amazon.com/getting-started/tutorials/backup-to-s3-cli/

Now you should be able to access your s3 bucket.

To create a new bucket (if you do not have one already):
aws s3 mb s3://your-bucket-name-here
To upload your zip file to your bucket:
aws s3 cp c:\Users\YourUser\Documents\ImportantDocsApr2017.zip s3://your-bucket-name-here/
To download it, just swap the order:
aws s3 cp s3://your-bucket-name-here/ImportantDocsApr2017.zip c:\Users\YourUser\Documents\DownloadedDocsApr2017.zip 
It's that simple!
Disclaimer: If you follow the information here, there is no warranty, I am not liable if it deletes your data, gets you hacked, burns your house down or anything else. If you follow the information contained here you do so entirely at your own risk.  My views and opinions are my own and not necessarily represent the views of my current or former employers.

© Raheel Hameed and www.raheelhameed.com, 2017. Unauthorized use and/or duplication of this material without express and written permission from this site’s author and/or owner is strictly prohibited. Excerpts and links may be used, provided that full and clear credit is given to author and this website with appropriate and specific direction to the original content.

Comments

Popular posts from this blog

How to make internet browsing family safe

This post covers a couple methods you can use to implement safer internet browsing for your family. As usual I'm not going into too much details, just providing you with high level pointers. It is yours to find out details by yourself.

First thing you would need is to disable the ability to recognize malicious hosts, or hosts that provide contents you do not want to see. For every website you visit, your browser makes a request to one or more DNS servers, typically your ISP's DNS servers, to resolve website hostname into an internet addressable address called "IP address". That IP address is the address of the host that serves the contents of the website. Without knowing this IP, your browser cannot reach the website. So the idea is to limit your browser to recognize safe websites only. How you'd do that? Simple answer, use OpenDNS's DNS servers rather than your ISP's. OpenDNS's servers would limit name resolution to only safe websites. Their list of …

Backup and Restore SVN Repository

SVN provides a simple way to backup or export SVN repository along with modification history. To export repository located at /mnt/svn/branches to a file "dump_file", you would write: svnadmin dump --incremental --deltas /mnt/svn/branches >~/dump_file On the other SVN server, you can restore the entire repository along with the modification history by doing this:
svnadmin create --pre-1.6-compatible /mnt/svn/branches
svnadmin load /mnt/svn/branches <~/dump_file
The first line will create a new empty repository. You can remove --pre-1.6-compatible flag if you like. It's needed only if you want to make your repository compatible with previous versions of SVN. The second line restores your repository from "dump_file". Hurray! Now you can move your SVN repository to the other server without loosing your change history.