4. Amazon EC2: Launch and Connect to Your Linux Server
4.1 What Is EC2? Key Concepts
EC2 mhanje AWS kadun "bhadyane ghetlela computer". Tumhi size nivadta (instance type), aat konta OS pahije te nivadta (AMI), kulup-killi nivadta (key pair) aani gate che niyam tharavta (security group). Technically, EC2 tumchi virtual machine AWS chya data centre madhe Nitro hypervisor var chalavto.
AWS Region: Asia Pacific (Mumbai) ap-south-1
+---------------------------------------------------------------------+
| Availability Zone ap-south-1a Availability Zone ap-south-1b |
| +---------------------------+ +---------------------------+ |
| | VPC subnet | | VPC subnet | |
| | +---------------------+ | | +---------------------+ | |
| | | EC2 instance | | | | EC2 instance | | |
| | | AMI: Ubuntu 24.04 | | | | AMI: AL2023 | | |
| | | Type: t3.micro | | | | Type: t3.small | | |
| | | SG: web-sg | | | | SG: web-sg | | |
| | +----------+----------+ | | +----------+----------+ | |
| | | EBS vol | | | EBS vol | |
| +---------------------------+ +---------------------------+ |
+---------------------------------------------------------------------+
| Term | What it is | Example / notes |
|---|---|---|
| Instance | A virtual server | i-0abc123def4567890 |
| AMI (Amazon Machine Image) | Template with OS + software used to launch instances | Amazon Linux 2023, Ubuntu 24.04, CentOS Stream 9, your own custom AMI |
| Instance type | Hardware size: vCPU, RAM, network | t3.micro (2 vCPU, 1 GiB), t3.medium (2 vCPU, 4 GiB) |
| Key pair | Public/private key used for SSH login instead of a password | AWS keeps public key; you download mykey.pem once |
| Security group (SG) | Stateful virtual firewall at instance level | Allow TCP 22 from My IP, TCP 80/443 from 0.0.0.0/0 |
| EBS volume | Network-attached block storage (virtual hard disk) | Root volume 8 GiB gp3 |
| Instance store | Temporary disk physically attached to host | Data lost on stop/terminate (only on some types) |
| Elastic IP | Static public IPv4 address | Survives stop/start; re-mappable |
| Region | Geographic area with multiple data centres | ap-south-1 Mumbai, us-east-1 N. Virginia |
| Availability Zone (AZ) | One or more isolated data centres inside a region | ap-south-1a, ap-south-1b, ap-south-1c |
| VPC / subnet | Your private network / a slice of it in one AZ | Default VPC 172.31.0.0/16 |
| User data | Script that runs automatically at first boot | Install Nginx on launch |
| IAM role (instance profile) | Gives the instance AWS permissions without storing access keys | Allow instance to read from S3 |
Why this matters for security
AWS follows the shared responsibility model (सामायिक जबाबदारी मॉडेल): AWS secures the physical data centre, hardware and hypervisor; you secure the OS, patches, security groups, keys, applications and data. Almost every EC2 breach you read about is on the customer side – an open port, a leaked key or an unpatched service.
Ravindra Bagale's Tip
After opening a new AWS account, many students launch an instance straight away. Do two things first: put MFA on the root user and set an email alert in AWS Budgets. Then use an IAM user for daily work. Security and cost control first, experiments later – remember this.
Ravindra Bagale's Tip – मराठी
नवीन AWS account उघडल्यावर बरेच students लगेच instance launch करतात. आधी दोन कामं करा: root user ला MFA लावा आणि AWS Budgets मध्ये email alert set करा. मग रोजच्या कामासाठी IAM user वापरा. Security आणि खर्चावर नियंत्रण आधी, प्रयोग नंतर – लक्षात ठेवा.
Ravindra Bagale's Tip – हिंदी
नया AWS account खोलते ही बहुत से students तुरंत instance launch कर देते हैं. पहले दो काम करो: root user पर MFA लगाओ और AWS Budgets में email alert set करो. फिर रोज़ के काम के लिए IAM user इस्तेमाल करो. Security और ख़र्च पर नियंत्रण पहले, प्रयोग बाद में – याद रखो.
Practice task
In your own words, write one line each for: instance, AMI, instance type, key pair, security group, EBS volume, region, AZ and IAM role.