Sitemap
DevOps.dev

Devops.dev is a community of DevOps enthusiasts sharing insight, stories, and the latest development in the field.

What is AWS EC2?

5 min readJun 24, 2024

--

Hey everyone!

In this blog, we’ll explore what AWS EC2 is. This is the third blog in the DevOps: Laugh, Learn, Repeat series.

If you’re completely new to this, my suggestion is not to overwhelm yourself with too much information. Understand what you can and move ahead ( let the future you suffer 😉 )

What we are going to cover

  • What is AWS EC2?
  • Create our first EC2 instance.
  • Delete the EC2 instance.

What is AWS EC2?

EC2 stands for Elastic Compute Cloud.

EC2 is a web service that provides secure, resizable compute capacity in the cloud. Basically Servers.

You can create your own server and

  • choose your OS like Ubuntu, Windows, etc.
  • create a firewall.
  • configure RAM and secondary memory.
  • and many more things.

we will learn all of this in upcoming blogs.

Pricing Models

  1. On-demand Pricing
  • Fixed rates by hour ( or by second )
  • For users that want low-pricing and flexibility.
  • No up-front payment or long-term commitment.
  • For applications that are short-term, spiky, or unpredictable.

In upcoming blogs, we will use this model, but we won’t incur any charges as we have a free tier enabled.

2. Reserved Pricing

  • For applications with steady or predicatable usage.
  • Make up-front payments to reduce costs.

3. Spot Pricing

  • For applications that have flexible start and end times.
  • Users with urgent computing needs need a large amount of capacity.
  • Amazon EC2 Spot Instances let you take advantage of unused EC2 capacity in the AWS cloud and are available at up to a 90% discount compared to On-Demand prices.
  • But if a requirement arises for the unused EC2 capacity, then AWS will terminate the instance or ask you to pay the fees according to on-demand pricing.

4. Dedicated Host

  • Used for regulatory compliance and requirements that may not support multi-tenancy.
  • Allow organizations to use licenses and certificates on AWS EC2.

Create our first EC2 Instance

Just follow the instructions for now. The purpose right now is to create an EC2 instance. So don’t worry about what we are doing.

Before starting, make sure you are in N. Virginia region. You can choose any region, but if you don’t understand regions, just follow me to avoid charges.

Press enter or click to view image in full size

Search for EC2 in the search bar and click on it.

Press enter or click to view image in full size

In Side panel, click on Instances

Press enter or click to view image in full size

Click on Launch Instances

Press enter or click to view image in full size

Now configure as given below

Get Bhavesh Anandpara’s stories in your inbox

Join Medium for free to get updates from this writer.

Set Name as server

Press enter or click to view image in full size

Select Ubuntu as the OS and make sure AMI is free-tier eligible to avoid any charges.

Press enter or click to view image in full size

Select the instance type as t2.micro, this is free-tier eligible.

Press enter or click to view image in full size

Click on Create new key pair

Press enter or click to view image in full size

Give key pair name as creds and configure as given below. Click on Create key pair.

Press enter or click to view image in full size

A file named creds.pem must be downloaded on your system. I created a new folder in the system named AWS_practical and I will be moving my creds.pem file there.

Create a security group and Allow SSH traffic from and Allow HTTP traffic from the internet.

This is a very crucial step. Otherwise, you won’t be able to SSH into your system.

Press enter or click to view image in full size

Click on Launch Instance

Press enter or click to view image in full size

Your EC2 instance is now up and running.

Press enter or click to view image in full size

Go to Instances from the side panel.

Press enter or click to view image in full size

And you have successfully created an EC2 Server 🎉

Press enter or click to view image in full size

Let’s SSH into the server

I am using a Windows system so I will be using CMD as my terminal. If you are on Linux system, you can open linux Terminal.

Go to the folder where you have stored your creds.pem file.

Press enter or click to view image in full size

Now click on Instance ID of your server.

Press enter or click to view image in full size

Copy Public IPv4 address of the instance.

Press enter or click to view image in full size

Now, in terminal, run this command

ssh -i creds.pem ubuntu@<your_public_ipv4_address>
Press enter or click to view image in full size
output

Once you SSH into the system, you can run any Linux command on the server.

Press enter or click to view image in full size

Basically, you have created a Ubuntu server on the internet, which you can access from your system.

You can run your applications here.

Make Sure that you delete your server now that we don’t need it anymore

Press enter or click to view image in full size

That’s all for today, folks. Catch up with this series later for more updates on DevOps and AWS from your host and dost — Bhavesh

If you found this helpful, feel free to like it and share your thoughts in the comments! ✨

Next, we will be creating an Apache server and hosting a static website on an EC2 instance.

--

--

Bhavesh Anandpara
Bhavesh Anandpara

Written by Bhavesh Anandpara

I'm new to the tech world! I'm currently learning DevOps. Having just graduated, I'm working on creating resources related to DevOps for students and freshers.

DevOps.dev
DevOps.dev

Published in DevOps.dev

Devops.dev is a community of DevOps enthusiasts sharing insight, stories, and the latest development in the field.