0% found this document useful (0 votes)
60 views21 pages

GettingStartedwithAWS Sample PDF

Uploaded by

steny james
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views21 pages

GettingStartedwithAWS Sample PDF

Uploaded by

steny james
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

Getting Started with AWS

Monster Chan
This book is for sale at http://leanpub.com/GettingStartedwithAWS

This version was published on 2016-05-14

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.

© 2014 - 2016 Monster Chan


Dedicated to the beautiful Joanne. Wish her happy every day!
As the largest cloud computing platform in the world, Amazon Web Services (AWS) provides one of
the most popular web services options available. This easy-to-understand guide is the perfect
introduction to the Amazon Web Services platform and all it can do for you. You’ll learn about the
Amazon Web Services tool set; how different web services (including S3, Amazon EC2 and etc) ; and
how you can implement AWS in your organization.
Contents

1. Setting Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.1 Sign Up for AWS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
1.2 Create a Key Pair . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1

2. Amazon Elastic Compute Cloud . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3


2.1 What is Amazon Elastic Compute Cloud . . . . . . . . . . . . . . . . . . . . . . . . . 3
2.2 Create an Amazon Linux Instance from an Amazon Machine Image (AMI) . . . . . . 3
2.3 Logging In to Your Instance . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

3. Amazon Elastic Block Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14


3.1 What is Amazon Elstic Block Store . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.2 Createing an Elastic Block Store Volume . . . . . . . . . . . . . . . . . . . . . . . . . 14
3.3 Adding an EBS Volume to an Instance . . . . . . . . . . . . . . . . . . . . . . . . . . 15
3.4 Snapshotting an EBS Volume and Increasing Performance . . . . . . . . . . . . . . . 16
1. Setting Up
1.1 Sign Up for AWS
when you sign up for Amazon Web Service (AWS), your AWS account is automatically signed up
for all services in AWS and you can start using them immediately. You are charged only for the
services that you use.
If you create your AWS account less than 12 months ago, you can get started with AWS for free. For
more information, see free¹.
If yout have AWS account already, skip to go next step. If you don’t have a AWS account, use the
following procedure to create one.

1.1.1 To crate an AWS account


1. Open aws², and then click Sign Up.
2. Follow the on-sereen instruction.

Part of sign-up procedure involves receiving a phone call ad entering a PIN using the phone keypad

1.2 Create a Key Pair


AWS users public-key cryptography to secure the login information for your instance. A Linux has
no password; you use a key pair to log in to your instance securely. Your specify the name of the
key pair when you launch your instance, then provide the private key when you log in using SSH.

1.2.1 To create a key pair


1. Open the amazon EC2 console.
2. From the navigation bar, in the region selector, click US West(Oregon).
3. In the navigation pane, click Key Pairs.
4. Click Carete Key Pair.
5. Enter a name for the new key pair in the Key pair name field of the Create Key pair dialog
box and then click Create. Choose a name that is easy for you to remember.
¹http://aws.amazon.com/cn/free
²http://aws.amazon.com

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.

2.1.1 Topics Covered


This chapter will introduce you to basic Amazon EC2 activities, including:

• Creating an Amazon Linux Instance from an Amazon Machine Image (AMI)


• Finding Your Instance in the Amazon Management Console
• Logging into Your Instance

2.2 Create an Amazon Linux Instance from an Amazon


Machine Image (AMI)
To get started creating your first Amazon instance, you will need to access the Amazon EC2 icon
on the Amazon Management Console, and utilize the wizard.

1. Open the AWS Management Console which should still be open in your browser.

3
2. Amazon Elastic Compute Cloud 4

2. Click Amazon EC2 Icon on the AWS Management Console homepage.


2. Amazon Elastic Compute Cloud 5

3. Click the Instances link to create an instance.

4. Click Launch Instance button, to begin the process.


Note: There are many, different operating systems to leverage.
2. Amazon Elastic Compute Cloud 6

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

15. Click View instance to take a look at the new instance.


Tip: Did you know that this can all be done via the command line.

Complete! Once the instance state has changed to running.Your instance will be ready to use!Now,you
will look at logging into instance.

2.3 Logging In to Your Instance


Now that you have launched your EC2 instance.It is time to log into it.

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

3. Copy that connection string to your clipboard.


Mac and Linux instructions
4. On a Mac or Linux computer, modify the permissions of the downloaded PEM file to tighten
the access (security) of the file.Be sure to use the correct path to the location that you saved
your .pem file eadlier.Your command line should look similar to:chmod 600 xxx/xxx.pem
5. On a mac or Linux computer,use terminal to SSH to your instance connection string using
the SSH identity file noted earlier with the user name use-user.Be sure to use corrrect
Public DNS and the correct path to your .pem file.YOur SSH line will look similar to this:

6. Ensure your accept the authenticity statement.


7. Connected!
WIndows instructions
8. Download PuTTY³ to a location of your choice using the following URL (unless you already
have PuTTY).
9. Double-click putty.exe(your download copy or your existing copy).
³http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html
2. Amazon Elastic Compute Cloud 13

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.

3.2 Createing an Elastic Block Store Volume


To get started creating your first Amazon EBS Volume, you will need to access the Amazon EC2
icon on the Amazom Management Console, and then utilize the Volumes Management Panel. EBS
volumes are like hard drives in a computer. Then data on them presists through the lifetime of the
volume and can be transported betweeen virtual machines as needed.

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

7. Click Yes, Create

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.

3.3 Adding an EBS Volume to an Instance


While you were creating the volume, a server instance was being prepared for you to attach volumes
to.

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.

You have now connected an EBS volume to an instance, Congratulations!


3. Amazon Elastic Block Store 16

3.4 Snapshotting an EBS Volume and Increasing


Performance
Creating a snapshot of volume replicates the data in the volume. It also allows you to change the
properties of the volume to features like provisioned IOPS.

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.

You might also like