How to use Amazon webservices?

 

HOW TO USE AMAZON WEB SERVICES

 

  1. How to use Amazon S3 (Simple Storage Service)
  2. How to use Amazon EC2 (Elastic Compute Cloud)

2.1.     How to create a Key Pair

2.2.     How to create an Instance

2.3.    How to connect to an Instance

  1. How to register a personal AMI (Amazon Machine Image)

3.1.    How to upgrade your instance using AMI

  1. How to use Amazon EBS (Elastic Block Store)HOW TO USE AMAZON WEB SERVICES

4.1.    How to backup your data

4.2.    How to increase the capacity of an instance

 

  1. 1.       How to use Amazon S3 (Simple Storage Service)

From the Amazon Web Services dashboard you have to find the Storage & Content Delivery section in order to click on S3.

 

On S3 you are going to be able to create buckets (which are like folders) to upload and organized your files.

From the main window you can create a bucket, delete it and paste files into an existing bucket.

To create a bucket just click on the Create Bucket button and choose a name and the region.

 

For each bucket that you create you can manage access, writing and list permissions and other things such established a lifetime for your files.

You can find these options on the properties of the bucket.

 

Once you have created your bucket, you are able to put folders and files inside. You just have to enter to your bucket and click Upload if you want to upload files or Actions if you want to do something else.

 

If you want to upload a lot of files at the same time, you must do it on a zip file due to upload speed.

 

 

  1. 2.       How to use Amazon EC2 (Elastic Compute Cloud)

From the Amazon Web Services dashboard you have to find the Compute & Networking section in order to click on EC2.

Once you get there, you might be able to see the EC2 Dashboard where the first thing that shows it’s a summary of the resources that you got and the service health.

 

2.1. How to create a Key Pair

The first thing that we must do on here it’s to create a Key pair which it works like a password to our instances (virtual machines).

You can find it on the Network & Security section of the left menu.

 

To create a key pair you just have to click the Create Key Pair button and choose a name for it. Then it will ask you to open or save the public key. You have to save the file because you are going to need it to make a remote connection to your instance.

 

2.2. How to create an Instance

On the Instances section of the left menu, we can see, create and manage our instances.

To create a new one you just have to click the Launch Instance button.

 

The first thing that you have to choose is the AMI that you are going to use.

Depending on what services you will use you can choose between an Amazon Linux AMI, several Linux distributions or Windows server images.

 

The next step is to choose the Instance type. You have to look up which type is better according to your needs.
It depends on the type of instance the amount of memory, storage or the type of network performance that you can have.

 

On the next step you are going to be able to configure details like the network and subnet configuration, if you are going to monitoring… and advanced details like the kernel and ram disk ID.

On the next window you can modify the storage by default or add a new volume to your instance. You can choose the type and size of each volume.

In this step you can give a name to your instance. It is called tag and is kept on keys.
It’s a good practice to name every instance with a descriptive name.

In the sixth step you are going to work whit Security Groups. These groups are the same as firewall rules.

You are obligated to put a rule for SSH because that’s the way that you are going to connect to your instance.

You can select almost every protocol to make a new rule or custom your own.

 

The next thing that you are going to see is a summary of the operation that it’s going to make. If you hit the Launch button on this page, it’s going to ask you about what key pair are you going to use. You have to select the one that you created.

Now you have already created your instance.

 

2.3. How to connect to an Instance

The first thing that you are going to use is PuttY. You can download from here http://www.putty.org/

You are going to need the main exe and puttygen.exe to connect your remote desktop.

In the picture beside you can see both programs and a public key file downloaded during the creation of the key.

 

First of all you have to create the private key through the public key that you downloaded when you created the key pair.

Open Puttygen.exe and go to the Conversions menu. You have to click on “Import Key”. Here you have to select the .pem file that you saved before.

 

You should be looking at a window like the one besides. You have to establish a Key passphrase (like a password) and click on Save private Key. This is going to generate a file with the .ppk extension that you will need to make the connection.

 

Now you have to open the putty.exe file.

In the left menu, go to Connection/SSH/ Auth. You have to browse for the private key that you saved before.

In the session section of the left menu, you should put your Public DNS as host name.

Now you can click Open and you should be able to connect to your instance.

 

During this process, you have to be sure that the public key that you are using it’s the same that you use when you create your instance because if it’s not it will not work.

 

If everything is correct, you will be able to connect to your instance. You have to login with the default user depending on the AMI that you choose. Then you have to put the passphrase that you establish to the private key and that’s all.

 

  1. 3.       How to register a new AMI (Amazon Machine Image)

An AMI is a special type of preconfigured virtual machine image that is used to instantiate (create) an instance. It serves as the basic unit of deployment for services delivered using EC2.

First of all you have to enter to EC2 in order to find the Images section on the left menu.

 

To create a new AMI you have two different options:

You can use an instance as model or you can upload to your S3 storage a totally custom image.
In both cases you have to choose Register new AMI in the options of the Actions button.

On the creation screen you can give the link of your file on S3 or give a name for a new AMI and you can choose the Kernel ID and the RAM disk ID.

 

Once you finish the creation of your AMI, you can use it to launch new instance by clicking on the Launch button…

… Or in the EC2 creation menu by choosing the My AMIs option instead of the default systems that Amazon offers to us.

 

3.1. How to upgrade your instance using AMIs

 

The first thing that you should do, just in case, is a snapshot of your volume. You can check how to do it in the next pages or by clicking here.

Then you have to go to the instance that you want to upgrade and choose the Create Image option between the options of the Actions button.

You can give a name, a description and customize your volumes.

Now you can launch a better instance using this AMI as base and you will have a better server.

 

  1. 4.       How to use Amazon EBS (Elastic Block Store)

From the Amazon Web Services dashboard you have to find the Compute & Networking section in order to click on EC2.

 

You have to click Volumes on Elastic Block Store section on the left menu.

There you are going to be able to create, delete and manage the volumes (virtual hard drives) of your instances and even create volumes to work as “flash drives” attaching and detaching on the instances in any moment.

 

This is the volumes manage window. You can see the volumes that you have, create new ones, delete or modified the old ones.

To create a new volume you just have to click on the Create Volume button.

 

There are several operations that you can do with a volume. You can delete it, detach/attach the volume to an instance, change the configuration, and the most important: you can create snapshots to secure your data.

 

If you are creating a new volume you should attach it to an existence instance.
Click on the attach action and you should get a window like the one besides.

In this window you must choose the instance that you are going to use and click the Attach button.

 

4.1. How to backup your data

By clicking on Snapshots on the left menu you will be able to see and manage the different snapshots that you got.

 

To create a new one, you have to click the Create Snapshot button. You must write the ID or the tag of the volume that you want to back up, a name and a description and click on the create button.

 

4.2. How to increase the capacity of an instance

In AWS there’s no such thing like expand a volume so if you want to increase the capacity of your instance you will have to follow this steps.

 

First of all, you have to do a snapshot of the currently state of the instance to be sure that you don’t lose any data. You can do this from the volumes section or from snapshots either.

 

The next step is to turn off your instance. You have to go to the Instances section and select the action Stop.

It’s impossible to do this operation while the instance is up in the same way that you can’t change the main hard drive of a real system.

 

Once the instance is stopped you have to detach the old volume in order to attach the bigger one as the main volume.

You can detach the volume by clicking on the Actions button and choosing Detach Volume.

 

Now you have to create a new volume with the desired size and be sure that put the snapshot that you take of the older volume in the Snapshot ID box before hit the create button to be sure that you have your data.

 

Once that you have your new volume create you must attach it to the instance.

You have to remember to change the device box to /dev/sda1 because that’s the main HD on Ubuntu systems.

 

Then you just have to Start the instance and check that everything is working properly. You may have to wait a while since AWS says that the instance is running due to the services inside the machine.

 

 

Please check this document for more Detail : HOW TO USE AMAZON WEB SERVICES