AWS FAQ: What is EC2?
2. What is Amazon EC2 and how is it used?
Amazon EC2 (Elastic Compute Cloud) provides scalable virtual servers (instances) in the cloud. You can run applications, host services, and scale capacity on-demand.
πΊοΈ Step-by-Step Instructions:
- Log into AWS Management Console.
- Navigate to EC2 and launch a new instance.
- Choose an AMI, instance type, and key pair.
π₯ Example Input:
AMI: Amazon Linux 2
Instance type: t2.micro
π Expected Output:
A running virtual server with SSH access on the AWS cloud.
β EC2 Launch Script:
#!/bin/bash
yum update -y
yum install httpd -y
systemctl start httpd
π Detailed Explanation:
- Elasticity: Scale up/down based on traffic.
- Customizability: Choose OS, software, and resources.
- Pay-as-you-go: Only pay for usage.
π οΈ Use Cases:
- Hosting websites and web apps.
- Running back-end services or APIs.
- Batch data processing and dev environments.
