WEBVTT

00:00.480 --> 00:05.260
In this lecture, we will learn
about EC2 instances in AWS.

00:06.580 --> 00:10.200
Perhaps one of the most commonly used
services from AWS

00:10.200 --> 00:14.540
or any cloud provider for that matter
are virtual machines in the cloud.

00:15.420 --> 00:18.140
These virtual machines provide
scalable compute

00:18.140 --> 00:20.420
that can be deployed in a matter of minutes.

00:21.240 --> 00:24.860
In AWS, they are called as EC2 instances,

00:24.860 --> 00:28.280
where EC2 stands for elastic compute cloud

00:28.600 --> 00:31.720
and just like any compute, virtual or physical,

00:31.720 --> 00:37.580
an EC2 instance would run an operating system
such as a distribution of Linux or windows.

00:38.420 --> 00:43.100
We can then make use of these instances
for deploying software such as database,

00:43.100 --> 00:45.260
web servers, application servers

00:45.260 --> 00:48.720
or pretty much anything that you would
normally want to deploy in a physical

00:48.720 --> 00:50.720
or virtual machine, which is on premise.

00:51.800 --> 00:58.080
AWS EC2 provides pre-configured templates
known as Amazon machine image or AMIs.

00:59.280 --> 01:03.360
These templates contain software
configuration such as the operating system

01:03.360 --> 01:07.240
and any additional software to be deployed
on these EC2 instances.

01:08.140 --> 01:16.620
Examples are Ubuntu 20.04, RHEL 8,
Amazon Linux 2, windows 2019, et cetera.

01:17.600 --> 01:22.820
These AMIs have an ID which is specific to
the region where we want to deploy the instance.

01:23.440 --> 01:27.360
EC2 also provides a number of
different configurations of CPU,

01:27.360 --> 01:30.120
memory and networking capacity
for the instances

01:30.120 --> 01:32.520
which are known as instance types.

01:33.400 --> 01:36.400
There are a wide selection of instance types
to choose from

01:36.400 --> 01:39.200
that are optimized to fit different use cases.

01:39.640 --> 01:43.620
One example of the instance type is
the general purpose instance type,

01:43.620 --> 01:47.060
and this can be used for several types
of common workloads.

01:47.820 --> 01:50.660
Then there are compute
optimized instance types

01:50.660 --> 01:54.120
to work on workloads that require
high-performance CPUs

01:54.240 --> 01:57.140
such as batch processing workloads
and data modeling.

01:58.140 --> 02:00.220
The memory optimized instance types

02:00.220 --> 02:02.220
are designed to deliver fast performance

02:02.220 --> 02:05.400
for workloads that process
large data sets in memory.

02:06.220 --> 02:08.200
These are just few of the examples.

02:08.200 --> 02:11.640
For the complete list, please check out
the reference documentation.

02:12.640 --> 02:16.940
The most commonly used instance type
that suits most of the common workloads

02:16.940 --> 02:18.940
is the general purpose instance.

02:19.720 --> 02:22.200
These are further divided
into different categories

02:22.200 --> 02:26.180
such as T2, T3, and M5 instances for example.

02:26.720 --> 02:31.180
Each of these categories can be sized
to the specification that a user may need.

02:31.660 --> 02:36.500
For example, the T2 Nano provides
one virtual CPU and half a gig of RAM.

02:37.020 --> 02:41.000
The T2 micro provides one vCPU
and one gig of RAM.

02:41.540 --> 02:45.900
If you want to go for a higher spec,
you can choose from a number of different sizes

02:45.900 --> 02:50.400
such as the small, medium, large,
all the way up to 2X large.

02:51.220 --> 02:55.500
The sizes shown here are specific to
the T2 general purpose instance type,

02:55.580 --> 02:59.300
and they may not necessarily be
the same for all other instances.

02:59.780 --> 03:03.640
For a comprehensive list, please refer
to the reference documentation.

03:04.600 --> 03:09.940
Persistent storage for these instances is
provided by another service called the EBS,

03:09.940 --> 03:12.660
which stands for elastic block storage.

03:13.040 --> 03:16.500
As of this recording,
there are five types of EBS volumes.

03:16.660 --> 03:20.240
Three of these are high-performance
solid state type disks,

03:20.240 --> 03:23.240
and the other two are low cost hard disk drives.

03:23.820 --> 03:27.400
The size and type of storage
to be attached to an EC2 instance

03:27.400 --> 03:30.360
is available for the user to select
before provisioning.

03:30.740 --> 03:33.780
Additional disks may also be attached
post provisioning.

03:34.940 --> 03:40.020
The EC2 also allows us to pass in user data
to the instances being created.

03:40.540 --> 03:43.700
This allows us to perform
common configuration tasks

03:43.700 --> 03:46.460
or even run scripts when the instances start.

03:46.860 --> 03:50.520
For example, if you want to install
the NGINX package

03:50.520 --> 03:52.660
on an Ubuntu server when it's launched,

03:52.660 --> 03:56.240
we can pass in a shell script
as the user data like this.

03:57.140 --> 04:00.540
For windows instances,
we can also pass in a PowerShell

04:00.540 --> 04:02.660
or a batch script with the same effect.

04:03.640 --> 04:09.080
Once deployed, the Linux EC2 instances
are usually accessed using SSH keys.

04:09.340 --> 04:12.920
For the windows instances,
we can make use of the remote desktop

04:12.920 --> 04:15.980
or RDP along with the username and password.

04:17.040 --> 04:21.080
In the subsequent demo, we will see
how to deploy a Linux EC2 instance

04:21.080 --> 04:23.720
using the AWS management console.

