EC2
Last updated
Last updated
Amazon Elastic Compute Cloud (Amazon EC2) provides scalable computing capacity in the Amazon Web Services (AWS) Cloud.
Using Amazon EC2 eliminates your need to invest in hardware up front, so you can develop and deploy applications faster.
You can use Amazon EC2 to launch as many or as few virtual servers as you need, configure security and networking, and manage storage.
Amazon EC2 enables you to scale up or down to handle changes in requirements or spikes in popularity, reducing your need to forecast traffic.
Amazon Machine Image (AMI) is a template that contains a software configuration (for example, an operating system, an application server, and applications).
From an AMI, you launch an instance, which is a copy of the AMI running as a virtual server in the cloud.
An instance is a virtual server in the cloud.
You can launch different types of instances from a single AMI.
An instance type essentially determines the hardware of the host computer used for your instance.
A key pair, consisting of a public key and a private key, is a set of security credentials that you use to prove your identity when connecting to an Amazon EC2 instance.
Amazon EC2 stores the public key on your instance, and you store the private key. For Linux instances, the private key allows you to securely SSH into your instance.
Security group acts as a virtual firewall for your EC2 instances to control incoming and outgoing traffic.
Inbound rules control the incoming traffic to your instance, and outbound rules control the outgoing traffic from your instance.
You can add rules to each security group that allow traffic to or from its associated instances.
You can modify the rules for a security group at any time.
A tag is a label that you assign to an AWS resource.
Each tag consists of a key and an optional value, both of which you define.
Tags enable you to categorize your AWS resources in different ways, for example, by purpose, owner, or environment.
An instance store provides temporary block-level storage for your instance.
This storage is located on disks that are physically attached to the host computer.
Computing is a very broad term, the nature of your task decides what kind of computing you need.
Therefore, AWS EC2 offers 5 types of instances which are as follows
General Instances: For applications that require a balance of performance and cost. E.g email responding systems, where you need a prompt response as well as it should be cost-effective since it doesn’t require much processing.
Compute Instances: For applications that require a lot of processing from the CPU. E.g analysis of data from a stream of data, like a Twitter stream
Memory Instances: For applications that are heavy in nature, therefore, require a lot of RAM. E.g when your system needs a lot of applications running in the background i.e multitasking.
Storage Instances: For applications that are huge in size or have a data set that occupies a lot of space. E.g When your application is of huge size.
GPU Instances: For applications that require some heavy graphics rendering. E.g 3D modeling etc. Now, every instance type has a set of instances which are optimized for different workloads: General Instances - t2, m4, m3 Compute Instances - c4, c3 Memory Instances - r3, x1 Storage Instances - i2, d2 GPU Instances - G2 Instances which are not a part of that group are limited to 5 Gbps speed in multi-flow traffic. Cluster Networking is ideal for a high-performance analytics system.
1.They are the instances that run on single-tenant hardware dedicated to a single customer.
2.They are perfect for workloads where a corporate policy or industry regulation requires that your instance should be isolated from any other customer’s instance, therefore they go for their own separate machines, and their instances are isolated at the hardware level.
1. Login to your AWS account and click on AWS EC2.
2. Under create an instance, click on launch instance.
Now you have to select an Amazon Machine Image (AMI), AMIs are templates of OS and they provide the information needed to launch an instance.
When we want to launch an instance we have to specify which AMI we want to use. It could be Ubuntu, windows server etc.
1 .The AMIs could be preconfigured or you can configure it on your own according to your requirements.
2. While configuring you will reach a point where you have to select an EBS storage option.
**Elastic Block Storage (EBS) is a persistent block level storage volume which is used with EC2. Here each block acts as a hard drive.
AWS EC2 Pricing
AWS EC2 free tier allows 750 hrs of t2.micro instance usage per month! The free tier for EC2 is valid for 1 year from the SignUp of your AWS account.
There are basically 3 pricing options in EC2:
1 Spot Instances
2 On-Demand Instances
3 Reserved Instances
Spot Instances is a pricing option which enables you to bid on unused EC2 instances. The hourly price for a Spot Instance is set by AWS EC2, and it fluctuates according to the availability of the instances in a specific Availability Zone. Basically, you will set a price for an instance above which you do not wish to get charged for. The price that you set is for per hour basis, therefore the moment the price for that instance becomes greater than what you have set, the instance gets shut down automatically.
On-Demand Instances are used when you want to pay for the hour, with no long-term commitments and upfront payments. They are useful for applications that may have unpredictable workloads or for test applications that are being deployed for the first time.
Reserved Instances provide you with significant discounts as compared to On-Demand Instances. With Reserved Instances you reserve instances for a specific period of time with three payment options:
1 No Upfront
2 Partial Upfront
3 Full Upfront
And two-term lengths: One Year Term and Three Year Term
**AWS EC2 Login to AWS Management Console.
2. Select your preferred Region. Select a region from the drop-down, the selection of the region can be done on the basis of the criteria discussed earlier in the blog.
3. Select EC2 Service Click EC2 under Compute section. This will take you to the EC2 dashboard.
4. Click Launch Instance.
5. Select an AMI: because you require a Linux instance, in the row for the basic 64-bit Ubuntu AMI, click Select.
6. Choose an Instance - Select t2.micro instance, which is free tier eligible.
7. Configure Instance Details. - Configure all the details and then click on add storage
8. Add Storage
9. Tag an Instance
Type a name for your AWS EC2 instance in the value box. This name, more correctly known as a tag, will appear in the console when the instance launches. It makes it easy to keep track of running machines in a complex environment. Use a name that you can easily recognize and remember.
10. Create a Security Group
11. Review and Launch an Instance Verify the details that you have configured to launch an instance.
12. Create a Key Pair & launch an Instance: Next, in this AWS EC2 Tutorial, select the option ‘Create a new key pair’ and give a name of a key pair. After that, download it in your system and save it for future use.
13. Check the details of a launched instance.