AWS Builder Center
AWS Beginners Guide: What Is Amazon EC2 and What Are Instances?

AWS Beginners Guide: What Is Amazon EC2 and What Are Instances?

What Is Amazon EC2 and What Are Instances?




What Is Amazon EC2?

Amazon Elastic Compute Cloud (EC2) is an AWS service that allows you to launch virtual servers in the cloud without purchasing physical hardware.
EC2 is commonly used to host websites, backend applications, and development environments.

What Is an EC2 Instance?

An EC2 instance is a virtual server that provides computing resources such as CPU, RAM, storage, and networking.
For example, you could launch an Ubuntu instance to host a Node.js backend.
An Amazon Machine Image (AMI) provides the template used to launch an instance, including its operating system and potentially preinstalled software.
AMI = Template | Instance = Virtual server

Instance Types

AWS offers different instance families for different workloads.
Family
Typical use
General purpose
Web servers and development
Compute optimized
CPU-intensive applications
Memory optimized
Memory-intensive applications
Storage optimized
Data-intensive workloads
Accelerated computing
Machine learning and GPU workloads

Instance Lifecycle and Costs

You can start, stop, reboot, or terminate an instance.
  • Running: Executes workloads and generally incurs compute charges.
  • Stopped: Compute charges generally stop, but persistent storage may still incur costs.
  • Terminated: Permanently shut down and cannot be restarted.
Costs depend on the instance type, runtime, region, storage, and data transfer.

Practical Example

To deploy a backend on EC2:
  1. Launch an Ubuntu instance.
  1. Configure a security group to control network access.
  1. Connect to the instance.
  1. Install Node.js and deploy your application.
  1. Configure HTTPS and monitoring.

Conclusion

EC2 provides virtual servers on demand.
Remember:
  • EC2: The cloud computing service.
  • Instance: The virtual server.
  • AMI: The template used to launch the server.
  • Instance type: Determines available computing resources.

Official Documentation

Any opinions in this article are those of the individual author and may not reflect the opinions of AWS.
Enjoyed reading this content? Let the author know!

Your likes, comments, shares, and saves help creators reach more builders.

Loading recommendations

Loading article