What is EC2 and Creating An Instance

Katia
HackerNoon.com
Published in
6 min readJul 1, 2019

--

With the recent upcoming development of cloud computing, the popularity of AWS and other cloud systems has grown significantly, generating a larger demand for professionals that are able to use and navigate these new technologies. Whether you are a working professional studying for a AWS certification or simply curious to learn more, my goal is to summarize through a series of articles the basic concepts covered in the AWS Cloud Practitioner Exam.

What is EC2?

EC2 stands for Elastic Compute Cloud. It is one of AWS’s oldest and most commonly used services. EC2 allows you create Instances: virtual machines with customizable options for CPU, RAM, and operating systems on the AWS infrastructure.

Why would it be beneficial for a business to utilize this service?

If a business sets up their own servers, it will require a large budget to acquire and configure all hardware and a substantial amount of time to set everything up. Then, the business will be responsible for maintaining all hardware and monitoring any hardware failures that may occur. If the corporation rents servers, they will be bound by a long commitment through a contract and require all payment upfront. Additionally, with a contract, the business is paying for a fixed capacity. If the fixed capacity is too large, then money will be lost.

EC2 fixes a lot of these underlying issues by offering a flexible, scalable, and secure compute capacity through flexible payment options. An EC2 instance can be spun up in minutes. The business can specify how much RAM, CPU, and which operating system to use for the instance. All hardware is maintained by AWS and contracts are not required. EC2 comes with preconfigured templates called Amazon Machine Images (AMIs) that package all bits that are needed for the server. Let’s take a look at the payment option that are offered when using EC2.

EC2 Pricing Models:

There are a variety of options for pricing for different instance use cases.

On Demand — This allows you to pay a fixed hourly rate with no contracts, no commitments, and no limit on capacity. This is very beneficial to users that want the flexibility to not have any upfront payments, users that need short term services, or students that are learning or experimenting with the Amazon Management Console.

Reserved — This model requires a specified capacity reservation. Users are required to sign a 1 year or 3 year contract. However, this payment model offers a huge discount. The more you are able to pay upfront and the longer term the contract, the less you pay. This is great for users that have applications that have predictable usage and state. Standard Reserved Instances are 75% off of On Demand prices and are fixed capacity at all times. Convertible Reserved Instances offer up to 54% off of On Demand prices. Users are able to change the attributes and capacity of their instance with this plan as long as it is worth equal or greater value only. Scheduled Reserved Instances are available to run only during certain times in a day, week, or month on a predictable schedule.

Spot — Bidding for a price the user is willing to pay for the instance capacity. If the price is equal to the bidding price the instance is running, otherwise instance is terminated. This is beneficial for applications with very flexible start and end dates.

Dedicated Hosts — A physical EC2 server that is not shared with any other customers. This is generally used when users have strict compliance requirements or must preserve software licenses.

EC2 Instance Types:

EC2 has a very large variety of instance types to suit different use cases. Instance types vary in different combination of memory, storage, CPU, and networking capacity. Lets breakdown the basic Instance Type categories:

General Purpose — Web Servers, Development Environments, General Use Applications

Compute Optimized — Compute Intensive applications and high-performance web

Memory Optimized — Applications that are intensive on memory usage such as big data

Accelerated Computing — Additional hardware used to initiate large amounts of parallel processing, such as graphics processing

Storage Optimized — Need for large amounts of additional storage

How To Set Up an Instance In the Management Console

So now you know what EC2 is, the instance types, pricing plans, and benefits. Let’s create your first instance.

This part of the tutorial will require you to create an account with Amazon Web Services. All new users can select the Free Tier Plan that provides free service for the first year. Be mindful that not all services and configurations are free, so make sure to only choose Free Tier applicable options. Here is a link to create an account: Free Tier Account

Once you have created your account navigate to the EC2 services under the services tab.

Make sure to choose the N. Virginia region, since this service is not global unlike S3 and other services. Now create a new Instance:

Choose an Amazon Machine Image (AMI). This determines the operating system, application server, and applications that are required to launch your instance. Make sure to check the Free Tier Options only. Look through all offered options. In this tutorial we will be using Amazon Linux 2 AMI, SSD Volume Type.

Now choose an Instance Type. For the Free Tier there is only one option so go ahead and select that.

At this point you have the option accept all additional default settings and Review and Launch. If you would like to customize general settings, storage, tags, or security groups go to Next instead.

For Storage Settings you can change your EBS root to be either SSD or Magnetic.

Once you click Review and Launch you will be prompted to create a private/public key.

Create a new key pair, give a name, and download the private key .pem file. Make sure to keep this file in a safe place, since anyone with access to the file will be able to SSH into the instance. Once the key is downloaded go ahead and launch the instance.

It should only take a couple minutes for the instance to start up. You will now see on the instances tab that the instance state is running. This means you successfully created your first instance and it only took a couple minutes!

I hope this article has been helpful in understanding the basics of EC2 and will help prepare you for the AWS Cloud Practitioner Exam. Make sure to take some practice exams online before your test date. This is the first article in my Cloud Practitioner Overview series, so more articles are to follow soon!

--

--

Katia
HackerNoon.com

Just a dev, trying to dive into the world of Web3