Elastic Cloud Compute or EC2 was the very first service that Amazon introduced in 2006 as part of AWS. It allows the user to launch and manage virtual server instances in Amazon’s data centers. EC2 provides resizable computing capacity and eliminates the costs of purchasing hardware. With EC2 it is possible to launch as many instances as the user wants, configure security and networking and manage storage. Additionally, Amazon EC2 enables to scale instances up and down based on the fluctuation in network traffic. EC2 instances are essentially virtual computing environments and are available in different sizes and configurations in order to meet customer’s specific needs. Currently, AWS offer five types of instances based on their size – micro, small, medium, large and xlarge. These are additionally split into several categories based on whether the instances are general purpose instances, compute-optimized instances, memory-optimized instances, GPU instances or storage-optimized instances. Micro instance belongs to its own category and is usually associated with free tier usage of AWS. Once the user launches new instance, he gets complete control over and he is able to interact with it as he would do with a physical machine. He has a root access to it, he can add additional storage, he can log in to it, he can stop or reboot it and ultimately he can terminate it. Because EC2 belongs to the family of AWS it benefits from the same features as the rest of services. As such EC2 provides the ability to launch instances in multiple locations, across multiple regions and availability zones, and also provides very secure and stable environment by enabling configuration of firewall settings and managing access to the instances. To preserve instance data when it is not running each instance, upon its creation, has associated persistence storage volumes called Amazon Elastic Block Store (EBS) volumes. Exposed as standard block devices EBS offers much greater durability that over local Amazon EC2 local stores volumes that can’t retain information after instance termination. Moreover, EBS are automatically replicated by AWS and can have snapshots created out of them. These snapshots can be later used as starting points for new EBS volumes. Another benefit that EC2 offers is to associate EC2 instances with Elastic IP addresses. These public static IP addresses enable overriding of cloud computing’s default, dynamic association of IP address to resource each time it is being used, by associating themselves with AWS account rather than particular resource. Elastic IP addresses can be quickly remapped among instances and because of these customers using EC2 can be shielded from potential failures. On top of these features EC2 offers Auto Scaling and Elastic Load Balancing. With Auto Scaling, AWS take control of managing increases and decreases in computational capacity based on user-defined configuration. Elastic Load Balancing employs a set of fault-tolerant, scaled load balancers that automatically spread requests among running instances based on their current load [19].
In order to launch an EC2 instance, several steps are needed to take. First of all, it is necessary to select an underlying Amazon Machine Image or AMI. AMI is an encrypted machine image stored in Amazon Simple Storage Services that contains configuration necessary to boot new instances. Vaguely speaking, AMI is a snapshot of an operating system containing information about all the software that is installed on that operating system. AMIs are either public (available on Amazon Resource Center) or private (only available to their creators and users with rights to access them). They can also be paid or freely available. Amazon already offers great variety of AMIs that can be used to launch instances of many popular enterprise Linux distributions such as Amazon Linux, Red Hat Enterprise Linux, SUSE Linux Enterprise Server or Ubuntu Server, as well as instances of Microsoft Windows Servers (2003, 2008 and 2012). Additionally, AWS Marketplace offer many other custom AMIs created either by Amazon itself or community of developers that can contain various preinstalled software. This can be anything from database servers, application servers, web servers and frameworks to individual applications. Once an AMI is chosen, a user is free to specify the type and number of instances he wants and optionally an availability zone. Afterwards, the user has an option to add additional storage to his new instance. By default, each instance possesses one EBS volume called root. This volume stores all the information about OS and installed software. The user can increase root volume’s initial capacity and optionally add other volumes. Following the storage, access to the instance must be configured. For this purpose Amazon Web Services introduced the concept of security groups. Each EC2 instance is protected by Amazon EC2 firewall. Security groups contain list of rules that enable to user-specified IP addresses to access instances through user-specified ports. Thus each rule permits to choose TCP, UDP or ICMP protocol, select port range and, finally, limit sources – IP addresses can access the instance. By default, each security group should have at least one rule allowing the user to connect to the instance it is associated with. In order to connect to Linux instances, SSH21 is used (port 22) while in order to connect to Windows instances, we use RDP22 (port 3389). Finally, so that the user can securely connect to the instance it is necessary to select either an existing key pair or to create a new one. This key pair refers to a couple, which is composed of user-owned private key and public key that is stored on Amazon server. Public key is then used by Amazon server to generate the administrator password for newly created instance and once this instance is fully configured and running, the password is encrypted and sent to the user. Upon its reception the user uses his private key to decrypt the password and proceeds to log in to the instance [20].