GettingStartedwithAWS Sample PDF
GettingStartedwithAWS Sample PDF
Monster Chan
This book is for sale at http://leanpub.com/GettingStartedwithAWS
This is a Leanpub book. Leanpub empowers authors and publishers with the Lean Publishing
process. Lean Publishing is the act of publishing an in-progress ebook using lightweight tools and
many iterations to get reader feedback, pivot until you have the right book and build traction once
you do.
1. Setting Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Sign Up for AWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Create a Key Pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
Part of sign-up procedure involves receiving a phone call ad entering a PIN using the phone keypad
1
1. Setting Up 2
6. The private key file is automatically downloaded by your browser. The base file name is the
name you specified as the name of your key pair, and the file name extension is .pem. Save
the private key file in a safe place.
Important
This is the only chance for you to save the private key file. You’ll need to provide the name
of your key pair when launch an instance and the corresponding private key each time you
connect to the instance.
7. Prepare the private key file. This process depends on the operating system of the computer
that you’re using. 1). If your computer runs Mac OS X or Linux, use the following command
to set the permission for your private key file so that only you can read it.
$ chmod 400 my-key-pair.pem
2). If your computer runs Windows, use the following step to convert your .pem to a .ppk file
for use with PuTTY.
a. Download and install PuTTY from http://www.chiark.greenend.org.uk/∼sgtatham/putty/.
Be sure to install the entire suite.
b. Start PuTTYgen (for example, from the Start menu, click All Programs > PuTTY >
PuTTYgen).
c. Under Type of key to generate, select SSH-2 RSA.
d. Click Load. By default, PuTTYgen displays only files with extension .ppk. To locate your
.pem file, select the option to display files of all types.
e. Select your private key file and then click Open. Click OK to dismiss the confirmation
dialog box.
f. Click Save private key. PuTTYgen displays a warning about saving the key without a
passphrase. Click Yes.
g. Specify the same name that you used for the key pair (for example, my-key-pair) and then
click Save. PuTTY automatically adds the .ppk file extension.
2. Amazon Elastic Compute Cloud
2.1 What is Amazon Elastic Compute Cloud
Amazon EC2 is a web service that provides resizable computer capacity in the cloud. It is also
designed to make web-scale computing easier for everyone.
Amazon EC2 is more than just a virtual machine. The Amazon EC2 Service offers a variety of
benefits and features, such as elasticity, complete user control of resources, flexibility, reliability and
security. It is also quick easy to get up and running with Amazon EC2.
1. Open the AWS Management Console which should still be open in your browser.
3
2. Amazon Elastic Compute Cloud 4
5. In the first dialogue window, Step 1: Choose an Amazon Machine Image, choose the Amazon
Linux AMI instance by clicking Select next to that AMI.
6. Step 2: Leave the instance type set to the default, which is t1.micro. To continue, click Next:
Configure Instance Details.
2. Amazon Elastic Compute Cloud 7
7. Step 3: Configure Instace Details, we will leave all of the default options and chick Next: Add
Storage.
Tip: It is worthwhile to note the various options here. This is the location where you would set
access, network setting, monitoring, and other options.
8. Step 4: Add Storage, keep the default virtual hard driver. Click Next: Tag Instance.
Note:You can easily add more virtual hard drives or change the driver size here.
2. Amazon Elastic Compute Cloud 8
9. Step 5: Tag Instace, name your instance by using the tag instance interface. You’ll notice that
the left hand text box is populated with “key” Name and right hand text box is empty. In the
empty box, type a name such as “EC2 Lab” and click Next: Configure Security Group.
Tip: This is greate place to put a name for your virtual werver in the Value field…maybe
something creative.
10. Step 6: Configure Security Group, accept the default security group, as it shows port 22 (SSH)
from anywhere to this Linux instance. CLick Review and Launch.
2. Amazon Elastic Compute Cloud 9
ssh
11. Setp 7: With Review Instance Lauch you get an overview of all setting of your instance. Click
Launch to continue.
2. Amazon Elastic Compute Cloud 10
12. A key pair, which can created in Setting up,should auto-populate in the second drop down
box.
13. Click the acknowledgment! checkbox stating that you have access to the private key.
14. Now, click Launch Instance!
Tip: Key pair are know you access your instance after it is created. If you do not have a key
pair. You will NOT be able to access the Instance.
2. Amazon Elastic Compute Cloud 11
Complete! Once the instance state has changed to running.Your instance will be ready to use!Now,you
will look at logging into instance.
1. As you are already at the instance view with the Amazon EC2 dashboard,click the selection
box next to your instance Name (ie.EC2 Lab).
2. Find your Public DNS name on the screen, which look something like the following:
Tip: Use everything to the right of “Public DNS:” as a connection string to connect to this
instance.
2. Amazon Elastic Compute Cloud 12
10. Type ec2-user@ into the Host Name field,then paste the Connection string you copied to your
clipboard into the Host Name input in PuTTY (using CTRL+V).Your full Host Name field will
look something like this:
[email protected]
Note:if you didn’t copy your Pulbic DNS name earlier,you can find it in the AWS Management
Console Services > EC2 > Instance.Check the box next to your instance and the Public DNS
should appear on the page.
11. Expand the SSH category by clicking on the word “Auth” (not the + symbol next to the word
“Auth”).
12. Click Browse.
13. Navigate to the location where you saved the .ppk file earlier in the lab.
14. Select the .ppk file you downloaded.
15. Click Open.
16. In the PuTTY client, click Open.
17. WHen prompted, click YES to allow PuTTY to cache the server’s host key.
18. You are presented with a connected instance! Easy!
3. Amazon Elastic Block Store
3.1 What is Amazon Elstic Block Store
Amazon Elastic BLock Store (EBS) provides block evel storage volumes for use with Amazon EC2
instances. Amazon EBS volumes are network-attached and persist independently from the life of an
instance.
1. Click the Amazon EC2 Icon on the homepage and go to that dashboard.
2. You have to Launch a instance and all the seeting by default will be ok.
3. In the navigaton panel on the left under Elastic Block Store Click Volumes go to the EBS
control panel.
4. Here you will see a volume already in use. If you do not, please wait a monent and click the
refresh icon located in the upper right corner of the window. This volume exists for a server
that has been created for you for this lab excise. Take note of the Availability Zone that the
volume exists in, shown in the top panel.
5. Create a new volume by clicking Create Volume.
6. In the Create Volume windows, select the following:
a. Volume Type: Standard
b. Size: 1 GiB
c. Availability Zone: (match this from the zone noted in the previous step).
14
3. Amazon Elastic Block Store 15
Congratulations! You have a new volume ready to attached to an instance. Continue on to add that
volume to your instance and manipulate the volume.
1. Frome the EC2 > Elastic Block Store > Volumes window that you were just in, you should now
see 2 volumes. Right-click the volume whose state is available and choose Attach Volume. If
you volume still shows a State of creating, click the refresh icon, located in the upper right
corner of the window.
2. Select the instance. If you had more than one instance, you would need to select the
appropriate instance at this point. Also note that the next Device is already selected for you.
Click YES, Attach.
1. Back at the EC2 > Elastic Block Store > Volumes windows, right-click the 1 GiB volume you
created, and choose Force Detach.
Note: In procudtion, you would want to shut down your instance so you do not force deatch the
drive. However, for this lab, we will choose force detch to focus more on other festures.
2. Click Yes, Froce.
3. Right-click the volume again, and choose Create Snapshot.
a. Ensure the Volume matches the volume you created (it should by default)
b. For the Name, input: ebslab
c. For Descrupt, input: lab elb volume snapshot
d. Click Yes, create
4. Go to EC2 > Elastic Block Store > Snapshots to view your created snapshot.
5. Right-click the snapshot, and choose Create Volume from Snapshot.
6. Here, you will increase the volume size enable provisioned IOPS for increased preformance.
Select the following setting in the Create Volume windows:
a. Volume Type: Provisioned IOPS
b. Size: 8GiB
c. Availability Zone: (select the availability zone you noted earlier in the lab).
d. Click yes, create
3. Amazon Elastic Block Store 17
7. Reutrn to EC2 > Elastic Block Store > Volumes to find your newly created high performance
drive. This drive would contain all the data from the original drive, as well!
Congratulations! You have created a snapshotted volume that would contain all the data from the
original drive, but is larger and has guaranteed IOPS.