AWS  101: EC2 Service every DevOps Novice must know

AWS 101: EC2 Service every DevOps Novice must know

Getting started with the launch of EC2 Instances and getting hands on EC2

What is AWS?

Amazon Web Services (AWS) is the world’s most comprehensive and broadly adopted cloud platform, offering over 200 fully featured services from data centres globally. Millions of customers—including the fastest-growing startups, largest enterprises, and leading government agencies—are using AWS to lower costs, become more agile, and innovate faster.

I assume that If you are here you are already knowing the basics about the AWS, but if you are new to the AWS I will highly recommend you to go through my previous article listed below which would cover your basics to the AWS and the Introduction to the IAM Groups which are considered to be the stepping stones to the world of AWS.

AWS Introduction and IAM Service

What is EC2 ?

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.

Things to remember

  • By using the AWS service we are not owning anything we are just renting the services we need

  • EC2 is by far the most widely used service of AWS

  • It eliminates the upfront investment thus reduces a burden of maintaining the service also. All is taken care by AWS itself

  • We can scale up or scale down the when there is increase or decrease in the website traffic so as to add them in the auto-scaling group.

  • All the AWS Services works as Pay for what you need and are charged hourly.[Though some services are free for studying purpose].

NOTE - AWS Free Tier generally has the t2 micro instances as free for around 720 hours so use this as much as possible.

Types of EC2 instances:

General Purpose

They are having equal balance between the networking memory and computing resources. Some examples are A1,T2,T3, M4 etc.

Compute Optimized

As the name suggests that they are used when we prioritise the Computing power over others. Some Examples would be C4,C5 etc.

Memory Optimised

For the workload which processes large data sets some examples are R4, R5, X1 etc.

GPU Optimised

For performing the functions such as floating point number calculations, graphics processing, or data pattern matching. Some examples are P2, P3, G3 etc.

Storage Optimised

For the instances which requires heavy read and write access to large data sets on loacal storage. Examples: D2, H1 etc.

Amazon Machine Images(AMI)

An 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. You can launch multiple instances of an AMI, as shown in the following figure.

Remember Your instances keep running until you stop, hibernate, or terminate them, or until they fail. If an instance fails, you can launch a new one from the AMI.

AMI they are generally categorised into 2 types with the associated storage's

AMI with the Elastic Block Store [EBS] Storage:

These are ideal for the Persistent Storage as they are having the network attach drives that preserves the data through the instance stops and terminations.

AMI with the Instance Storage:

These are ideal for the Temporary Storage as the storage is located on the disks that are physically attached to the host computer and when the instances are stopped or terminated the data is not persisted.

exhausted.gif

Now if you are already exhausted by the getting through here lets try to get our hands dirty and dive into the EC2 part.

How to launch a EC2 Instance ?

  • Login through the root account [If you have not created the IAM users] or Login through the user which has full access for the EC2 and search for EC2 in the search bar above.

image.png

Note: It is highly recommended that you should create the separate user for this using IAM. If you want to refer that how to create users through IAM here is the link that will help you to create the user and groups.

IAM Service

  • Launch the Instance by clicking on the Launch Instance --> Redirected to the "Launch an Instance Page" --> Fill the Name and Tag field

image.png

  • Select the AMI you want to get started with. [I have choosen the Ubuntu for demo purpose.]

image.png

Note : Always choose the AMI which are Free tier eligible for the demo purpose though you can use the paid ones also but the bill will be generated here.

  • While selecting the Instance Type select the Free Tier Eligible machines which comes of standard configuration.

image.png

  • In key pair always try to create a new pair and save the generated key safely as it will only be generated once, name it unique ; if want to use the instance using the SSH then go for the .pem format to download or else go for .ppk format.

image.png

  • In Network Settings always try to create the security group and allow ssh traffic from anywhere. [It is selected by default].

image.png

  • Click on launch Instance --> [Redirected to launch an instance tab] -->Click on "Connect to Instance" button in Connect to your instance Card.

image.png

  • After clicking on it would be redirected to connect to instance --> Click on EC2 Instance Connect (Default Selected) --> Hit on Connect Button

image.png

  • And Viola you would be connected to your EC2 instance

image.png

Phew that's quite a Hands-On ! (Worth It !)

I hope this article has received well with all of you guys. It will definitely help you to get on and get started with the AWS Journey and I will definitely try to keep posting often and make sure that you enjoy while learning the things and getting it done.

I know you must be feeling like this now

deadpool.gif

Till then Stay tuned for the next one. I hope you are having a good day !

Every Feedback is appreciated it will help me to get better and deliver you guys a great content.

Did you find this article valuable?

Support Aditya Dhopade by becoming a sponsor. Any amount is appreciated!