Getting started with AWS Support (Basic)

Updated 2018 July 16th to include a section on S3 buckets

Several years ago I learned that one could sign up to the Amazon Web Services (AWS) for free. This sign up allows you to test many of their web services for free, for a year, as long as your usage is within the AWS Free Tier. To sign up to the AWS Support (Basic), you need a credit card and a phone number that you can be contacted on (I got an automated called on my phone and had to punch in a PIN to finish the registration process).

Once you have registered, you can log into the Console Home, where all the web services are shown:

awsSo much cloud stuff.

I learned that there were some Instructional Videos and Labs and I watched the first video [Introduction to Amazon Elastic Compute Cloud (EC2)]. The Amazon EC2 is just one of the services provided by the AWS and it looks like the one I would be most interested in. I downloaded the User Guide, which I also sent to my Kindle (a colleague once looked at my Kindle collection and gave me a weird look, so perhaps you don't want to do this).

I went through this Getting Started guide, which provides all the details for launching an EC2 instance. I first created an AWS Identity and Access Management (IAM) user via the console. I followed the instructions at "Create an IAM User" in the Setting Up with Amazon EC2 guide. The point of the IAM user is that it's recommended to access AWS using an AWS IAM user.

The next step is to create a key pair, which allows you to ssh into the instance. Make sure you set the permissions of your private key file so that only you can read it, i.e. chmod 400 file.pem. The last step is to Create a Security Group; just follow the guide. To find your public IP address use this tool, which is provided by AWS.

Now we're ready to Launch an Amazon EC2 Instance; you can simply follow the guide. The t2.micro instance type provides you with 1 CPU and 1 GB of RAM; selecting anything else will cost you money. As explained in the guide, use the security group and key pair you created in the steps prior. When I selected the "Amazon Linux AMI 2015.03 (HVM)" instance, I noticed that it doesn't come with a C compiler, so you may decide to use another image. Launching an instance for less than an hour will count for a total hour.

After the instance has successfully launched, we are ready to connect to the instance. Just find out the public DNS from the Amazon EC2 console and run:

#the user is really ec2-user
#replace DNS with your real DNS
ssh -i file.pem ec2-user@DNS

ec2Negative space ASCII ART.

When you terminate your instance you will get this warning:

"On an EBS-backed instance, the default action is for the root EBS volume to be deleted when the instance is terminated. Storage on any local drives will be lost."

There is of course a way to save your volume and I will update this post when I find out. Note that the AWS Free Tier provides you with 750 hours per month of Linux, RHEL, or SLES t2.micro instance usage. This would allow you to run one t2.micro instance for the entire duration of the month (24 * 31 = 744).

S3 Buckets

Amazon S3 is cloud storage for the internet. The S3 Standard Storage costs a couple of cents per gigabyte.

Click on "Services", then under "Storage" click on S3. Click on Create bucket and fill out the form accordingly; I just accepted all the default settings.

Install the AWS Command Line Interface.

pip install awscli

Create access key ID and secret access key on website, then run aws configure. Use --profile to have several profiles.

aws configure --profile personal

aws s3 ls --profile personal
2018-07-16 14:28:35 name_of_bucket

Now upload.

echo blah > blah.txt
aws s3 cp blah.txt s3://davetang/ --profile personal

See Using High-Level s3 Commands with the AWS Command Line Interface for more commands.

Further reading

Build Your Foundation with AWS

AWS resources

The EC2 User Guide

Tutorial: Introduction to AWS Cloud Computing

Print Friendly, PDF & Email

Creative Commons License
This work is licensed under a Creative Commons
Attribution 4.0 International License
2 comments Add yours
  1. Cloud computing is a very powerful resource, specially if you have to do some solo bioinformatics work, and don’t have access to a cluster.

    Remember to Stop the instance when you finished working with it, otherwise amazon will keep charging you!! You can also be charged for extra volumes you may have taken.

    1. Thanks for the comment Giovanni. I was also quite worried about being charged; I set up an alert and hopefully it alerts me when I start getting charged.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.