DEV Community

Cover image for EC2 101: Understanding the Basics of Amazon's Elastic Compute Cloud
Nitesh Thapliyal for AWS Community Builders

Posted on

EC2 101: Understanding the Basics of Amazon's Elastic Compute Cloud

Learn how to use AWS EC2 efficiently with this blog post. In this post, we'll cover connecting to your instance using the AWS Management Console or using ssh which allows you to connect directly to your instance through its private IP address

ec2

What is EC2(Elastic Compute Cloud)?

AWS EC2 is a cloud service that allows you to run virtual servers in Amazon's elastic infrastructure. It's a powerful way to create your own server infrastructure without any need for configuration or management. With AWS EC2, you'll have access to fast and reliable computing power, backed with the service's 99.999999% uptime guarantee.

AWS EC2 is a cloud computing service for running applications that can be accessed from anywhere with internet access.

Features

  • Elastic

EC2 allows users to quickly and easily scale the number of virtual machines (known as "instances") they are using up or down, depending on the needs of their application.

  • Pay-as-you-go

Users are only charged for the resources they actually consume, with a granular per-second billing.

  • Customizable

EC2 instances can be customized with different combinations of CPU, memory, storage, and networking resources, allowing users to choose the configuration that best meets the needs of their application.

  • Secure

EC2 instances can be launched in a virtual network that the user defines, and security groups can be used to control inbound and outbound network traffic.

  • Support for multiple operating systems

including Amazon Linux, Ubuntu, Windows Server, and many others

  • Integration with other AWS services

EC2 instances can easily be configured to work with other AWS services, such as Amazon RDS for database services, Elastic Block Store (EBS) for persistent storage, and Elastic Load Balancing for distributing incoming traffic among multiple instances.

  • Auto Scaling and Load balancing

They can automatically increase or decrease the number of instances in response to changes in demand for the application, and automatically distribute incoming traffic among multiple instances.

  • Spot Instance

an option which allows to bid for spare EC2 instances capacity.


Components of EC2 service

There are several components that are used when launching an Amazon Elastic Compute Cloud (EC2) service:

  1. Virtual private cloud (VPC): A VPC is a virtual network that allows you to launch AWS resources in a logically isolated area.

  2. Subnet: EC2 instances are launched within a subnet, which is a range of IP addresses within a VPC.

  3. Security groups: Security groups are used to control inbound and outbound network traffic to and from an EC2 instance.

  4. Key pair: A key pair is used to securely connect to an EC2 instance using SSH.

  5. Elastic IP: Elastic IP address is a static public IP address, that can be allocated, associated, and disassociated to instances as required.

  6. Block Storage: It allows to create storage volumes that can be attached to instances as additional storage or it can be used to create snapshots for backups

  7. Instance: An EC2 instance is a virtual server that runs on Amazon's infrastructure. The instance type determines the CPU, memory, storage, and network resources that are made available to the instance.

  8. Images: They are pre-configured machine images that include the operating system, software, and any necessary configuration settings. These images can be used to launch new instances.

  9. Auto Scaling group: This group allows you to automatically scale the number of instances in response to changes in demand for your application.

  10. Load balancer: A load balancer distributes incoming traffic among multiple instances, helping to ensure that your application is highly available and can handle a large amount of traffic.

  11. Elastic Container Service(ECS) or Elastic Kubernetes Service(EKS) : Used for launching containerized applications.


Use Case of EC2 service

  • Hosting web applications: You can use EC2 instances to host web applications, by installing a web server (such as Apache or Nginx) and deploying your application code on the instances.

  • Running batch jobs: You can use EC2 instances to run batch jobs, such as data processing or image rendering, by creating custom AMIs (Amazon Machine Images) with the necessary software installed and then launching instances from those AMIs.

  • Building a test and development environment: You can use EC2 instances to build a test and development environment, by creating custom AMIs with the necessary software and configuration, and then launching instances from those AMIs.

  • Creating a Virtual Desktop Infrastructure (VDI): With EC2 you can create a virtual desktop infrastructure that allows users to access their desktops remotely.

  • Building a High Performance Computing(HPC) clusters: EC2 instances can also be used to build high performance computing clusters to perform complex calculations.

  • Running containerized applications: you can use EC2 service to launch containerized applications using Elastic Container Service (ECS) or Elastic Kubernetes Service (EKS)

  • Hosting databases: You can use EC2 instances to host databases, such as MySQL or PostgreSQL, either by installing the database software on the instances directly or by using a service like Amazon RDS.

  • Building a data pipeline: You can use EC2 instances to build a data pipeline, using tools such as Apache Kafka or Apache NiFi, to collect, process, and analyze large amounts of data.


Steps to launch EC2 Service

  • Sign in to the AWS Management Console:

signin

  • Choose the region:

region

  • Search for EC2 service:

ec2 search

  • Click on Launch instance:

Launch Instance

  • Give name to your instance and choose an image:

Image

  • Select instance type and choose key pair if created:

type

  • Configure your network rules:

nw

  • Launch the instance:

launch

  • Connect to the instance:

connect

Img

  • Connect using SSH

ssh

Now you can see our instance is connected

conections

Hope this blog helped you to learn something about AWS EC2

Happy Learning✨

Top comments (0)