AWS EC2 101
Tags: aws, cloudcomputing, ec2, devops
Published: 2023-06-12 18:47:50

![Day11](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/tdj6isus5e1nih3pbobk.png)

[11/30] #30DaysOfAWS Today, AWS EC2 & Hands-On.

**AWS EC2 (Elastic Compute Cloud)** is a web service provided by Amazon Web Services (AWS) that offers resizable compute capacity in the cloud. It allows you to quickly provision virtual servers, known as EC2 instances, and configure them based on your specific requirements.

**EC2 Instance Types**

EC2 instances come in various types, each optimized for different workloads and use cases. Here are some common instance types.

- General-purpose instances: General-purpose instances are a good choice for a wide variety of workloads, including web servers, databases, and development environments. They offer a good balance of CPU, memory, and storage, making them a versatile option for many types of applications.
    
- Compute-intensive instances: Compute-intensive instances are designed for workloads that require a lot of CPU power, such as high-performance computing (HPC) and machine learning. They offer high levels of CPU performance, making them ideal for applications that need to process large amounts of data or run complex simulations.

- Memory-intensive instances: Memory-intensive instances are designed for workloads that require a lot of memory, such as big data analytics and media streaming. They offer high levels of memory performance, making them ideal for applications that need to store large amounts of data or process large amounts of data in parallel.
    
- Storage-intensive instances: Storage-intensive instances are designed for workloads that require a lot of storage, such as file servers and backup systems. They offer high levels of storage performance, making them ideal for applications that need to store large amounts of data or access data quickly.

**Purchasing Options**

When it comes to purchasing EC2 instances, AWS offers the following options.

- On-Demand Instances: You pay for compute capacity by the hour or second, with no long-term commitments or upfront payments. This option is flexible and suitable for applications with unpredictable workloads.

- Reserved Instances: Reserved Instances provide a significant discount (up to 75%) compared to On-Demand pricing. You commit to using instances for a specific term (1 or 3 years). Reserved Instances are recommended for steady-state workloads.

- Spot Instances: Spot Instances allow you to bid on unused EC2 capacity, enabling you to get compute instances at a much lower price (up to 90% discount). However, spot instances can be terminated if the Spot price exceeds your bid or if AWS needs the capacity. They are ideal for fault-tolerant and flexible workloads.

- Dedicated Instances: Dedicated Instances run on hardware dedicated to a single AWS account. This option provides additional isolation and compliance requirements but is generally more expensive.

- Dedicated Hosts: Dedicated Hosts give you full control over the underlying hardware. You can use your existing server-bound software licenses and meet specific compliance requirements. However, Dedicated Hosts are the most expensive option and are typically used in specific use cases.

These purchasing options allow you to choose the most cost-effective and suitable model based on your workload characteristics, budget, and required flexibility.

**Step-by-step tutorial** for how to create EC2 instance. You can download it using this [URL](https://lasantha-fileshare-s3-932747549174-v1.s3.us-east-2.amazonaws.com/AWSEC2HandsOn.pdf).

EC2 User Data [file](https://gist.github.com/sanju2/f744153261fe4e776295d2627f9ec2bb).

Thanks for reading the Article.