Last updated Oct 9, 2022

AWS EC2 Explained: Complete Guide to Instances, Setup & Pricing

Discover AWS EC2 fundamentals, from launching instances to understanding pricing and scalability for hosting modern applications.

AWS EC2 Explained: Complete Guide to Instances, Setup & Pricing

In this article, we will learn about what is AWS EC2 and what features it provides.

So, let's get started...

What is EC2?

Amazon Elastic Compute Cloud(EC2) is like your desktop computer which is located somewhere around the globe and accessible over the internet.

When creating an EC2 instance, you can specify its hardware, including the number of CPUs, RAM, and storage/volume, similar to a Virtual machine.

We refer to this service as elastic due to the flexibility it offers when creating EC2 instances or virtual machines.

EC2 is the way that allows doing Iaas(Infrastructure as a service) in AWS.

Purpose of EC2

Businesses primarily utilize EC2 to host applications and make them available to millions of people via the Internet. EC2 is also capable of high-scale, high-performance data processing, and operations, among other things.

Why EC2

Flexibility

While using EC2 you can Customize Hardware according to the workload to run the required.

Cost Saving

AWS Charges according to the instance in running state/time and resource provision.

Lifecycle

With using EC2 we can easily Start/Stop/Terminate or Replace instace with just some clicks.

Security

The instance is created inside the VPC of your AWS Account with complete control of the in-outbound network.

EC2 sizing & configuration options:

While creating EC2, we have the following options available for configuration:

1)Operating System (Windows, Linux, Mac OS)

2) CPU (Select according to How much compute power & core are needed for your application)

3) RAM

4) Storage 

5) Firewall rules (Security Group)

6) Bootstrap Script

Bootstrapping means launching commands when a machine starts.

If you want to run any script on the first launch of the instance you can use bootstrapping.

Using the bootstrap script we can automate something like Installing updates, Installing the software, Downloading some files from the internet, etc...

Types of EC2 Instances

There are different types of EC2 instances that are optimized for different use cases.

Below we mentioned some of the Categorized based on the workload to run on the instance:

General Purpose

The General purpose instances are great for a diversity of workloads such as a web server.

Used during Developing, building, and testing

Example: T2 micro,m4

Compute Optimized

The Compute Optimized instances can be a good choice for computer-intensive tasks that require high-performance processors.

Used for Batch/Video Processing, Media Transcoding, Scientific Model, ML, High-Performance web server, and dedicated game server as these types of tasks required high-intensive CPU

Example : c5,c6,c7g

Memory Optimized

The memory-optimized instances are suitable for Fast performance for workloads that process large data sets in memory

Used for DB, cache, and Real-Time Analytics

Example: R5, X1

Storage Optimized

The storage-optimized instances are good choices for storage-intensive tasks that require high, sequential read and write access to large data sets on local storage.

Used for Transaction Workload and High Network, High-Frequency online transaction processing(OLTP) systems

Example: D3, H1

For more details, https://aws.amazon.com/ec2/instance-types/

Tags

Available for projectsLet’s build together

Need this built properly,
not just explained?

I take on Angular and NestJS work directly — auth systems, multi-tenant SaaS, API rewrites and the deploy pipeline underneath them. You talk to the person writing the code.

Projects delivered
20+ Projects delivered
Angular • NestJS
7+ years Angular • NestJS
Average reply time
1 day Average reply time

What I can help with

  • Auth and permissions systems
  • Multi-tenant SaaS foundations
  • API design and rewrites
  • Deploy pipelines and VPS setup
  • Bug fixing and performance optimization
Send me a message

Tell me about your project and I’ll get back with a realistic scope and price.

Turn
Your Ideas
Into Reality

Stay in the loop

Get the finished tutorials, projects and resources in your inbox.

Join 5,000+ developers and get new tutorials, source code, product updates and exclusive content — straight to your inbox.

  • No spam
  • Useful content only
  • Unsubscribe anytime

Subscribe to TutsCoder

Be the first to get new tutorials, projects and tips.

Join 5,000+ developers already learning with us.

Learn
Build
Grow

Discussion

Comments

Share your thoughts, ask questions or suggest improvements. Let’s learn and grow together!

Loading comments…

Join the discussion

Sign in to join the discussion. Your account also keeps your saved tutorials and path progress.