Amazon Elastic Compute Cloud (Amazon EC2) is a web service that provides resizable compute capacity in the cloud. It is designed to make web-scale computing easier for developers.
Amazon EC2’s simple web service interface allows you to obtain and configure capacity with minimal friction. It provides you with complete control of your computing resources and lets you run on Amazon’s proven computing environment. Amazon EC2 reduces the time required to obtain and boot new server instances to minutes, allowing you to quickly scale capacity, both up and down, as your computing requirements change. Amazon EC2 changes the economics of computing by allowing you to pay only for capacity that you actually use. Amazon EC2 provides developers the tools to build failure resilient applications and isolate themselves from common failure scenarios.
Benefits 1. ELASTIC WEB-SCALE COMPUTING
Amazon EC2 enables you to increase or decrease capacity within minutes, not hours or days. You can commission one, hundreds or even thousands of server instances simultaneously. Of course, because this is all controlled with web service APIs, your application can automatically scale itself up and down depending on its needs.
2. COMPLETELY CONTROLLED
You have complete control of your instances. You have root access to each one, and you can interact with them as you would any machine. You can stop your instance while retaining the data on your boot partition and then subsequently restart the same instance using web service APIs. Instances can be rebooted remotely using web service APIs. You also have access to console output of your instances.
3. FLEXIBLE CLOUD HOSTING SERVICES
You have the choice of multiple instance types, operating systems, and software packages. Amazon EC2 allows you to select a configuration of memory, CPU, instance storage, and the boot partition size that is optimal for your choice of operating system and application. For example, your choice of operating systems includes numerous Linux distributions and Microsoft Windows Server.
4. DESIGNED FOR USE WITH OTHER AMAZON WEB SERVICES
Amazon EC2 works in conjunction with Amazon Simple Storage Service (Amazon S3), Amazon Relational Database Service (Amazon RDS) and Amazon Simple Queue Service (Amazon SQS) to provide a complete solution for computing, query processing, and storage across a wide range of applications.
Amazon EC2 offers a highly reliable environment where replacement instances can be rapidly and predictably commissioned. The service runs within Amazon’s proven network infrastructure and data centers.
Amazon EC2 works in conjunction with Amazon VPC to provide security and robust networking functionality for your compute resources. Your compute instances are located in a Virtual Private Cloud (VPC) with an IP range that you specify. You decide which instances are exposed to the Internet and which remain private.
Security Groups and networks ACLs allow you to control inbound and outbound network access to and from your instances.
You can provision your EC2 resources as Dedicated Instances. Dedicated Instances are Amazon EC2 Instances that run on hardware dedicated to a single customer for additional isolation.
If you do not have a default VPC you must create a VPC and launch instances into that VPC to leverage advanced networking features such as private subnets, outbound security group filtering, network ACLs and Dedicated Instances.
Steps to Create EC2 Instance
Signing In to AWS Console
Just click the EC2 option under the Compute section.
To launch an EC2 Instance, click the Launch Instance button.
Selecting EC2 AMI
What is AMI?
An AMI is a template that contains the software configuration including an operating system and application server.
You can select an AMI provided by AWS or you can select one of your own AMIs. Here, for the testing purpose, select the AMI type as Ubuntu and then proceed to next.
Selecting EC2 Instance Type
EC2 Instance Types are actually profiles with pre-defined hardware and other resources settings such as a number of vCPUs, RAM and
Disk size. You can choose any of the available instance type as per your requirements. However, instance type containing more hardware resources would be more expensive than others. Luckily, there is one option called Free Tier that allowed you to create and use a T2 Micro instance free of cost with limited time of period. For the testing purpose, select the T2 Micro instance type and proceed to the next page.
Configuring EC2 Instance Settings
In this page, you need to specify some basic settings for your EC2 instance. The following are the basic settings that you need to adjust:\
Network: Use the default VPC or create a new one.
Subnet: Use the default subnet or create a new subnet as per your requirements.
Auto-assign IP: If enabled, then a public IP would be assigned to this EC2 instance, else no public IP would be assigned to this instance.
Adding Storage with EC2 Instance
In this page, you can use the default allocated storage size (8 GB), you can increase it, or you can also add multiple volumes as per your storage requirements. For the testing purpose, just accept the default setting and proceed to the next page.
Adding Tags for EC2 Instance
In this page, you can define tags to identify and differentiate your instance. As of now, adding Name tag would be sufficient. Click Add Tag, specify the instance name, and proceed to the next page.
Configuring EC2 Security Group
AWS security groups are actually virtual firewall that controls the inbound and outbound network traffic. Here, at least you need to allow SSH service for remote access. For this exercise, you can allow SSH it for all IPs, but we highly recommend to select My IP Address option to limit the SSH access. In the production network, be careful and only allow the required ports in the security group.
Launching EC2 Instance
Proceed to the Review page and click Launch to launch instance. The Key Pair window will be displayed. Here either you can use an existing Key Pair or create a new one. For the first time, select create a new key pair, specify key pair name, and then click Download Key Pair.
Finally, click Launch Instances to launch this instance. The instance will be ready within few minutes and you would see it in the EC Instance list in AWS console.
That’s all you need to do to create EC2 instance using AWS Amazon console. Now, you can connect your instance and perform the management task as per your requirement. You can use Putty, GitBash, or any other tool as per your comfort to connect an EC2 instance.