Chapter 5: Amazon EC2 (Elastic Compute Cloud)
Practice Questions and Lab Exercises
- List five advantages of EC2 over on-premises servers. Explain the shared responsibility model.
- Define AMI, instance type, key pair, security group, EBS, Elastic IP, Region and AZ.
- Decode the instance type
m7g.2xlarge. - Compare On-Demand, Reserved, Savings Plans and Spot pricing with a use case for each.
- What are the default SSH users for Amazon Linux, Ubuntu and CentOS Stream AMIs?
- What happens to the public IP, the EBS volume and billing when you stop vs terminate an instance?
- Lab: Launch an Amazon Linux 2023
t3.microin Mumbai with a security group allowing SSH (My IP) and HTTP. Use the user-data script from Step 8 and open the page in a browser. - Lab: Connect to the same instance from Windows using both PuTTY and OpenSSH.
- Lab: Stop and start the instance and note the public IP change. Then allocate and associate an Elastic IP, repeat, and observe. Finally release the EIP.
Quick Revision
- EC2 = IaaS virtual servers; pay-as-you-go; launch in minutes.
- Launch = AMI + instance type + key pair + security group + storage (+ user data).
- Instance types: family/generation/attribute.size, e.g.
t3.micro. - Pricing: On-Demand, Savings Plans, Reserved, Spot, Dedicated.
- SSH:
chmod 400 key.pem; ssh -i key.pem ec2-user@IP(Ubuntu →ubuntu). Windows: OpenSSH (icacls), PuTTY (.ppk), MobaXterm. - Stop keeps EBS but releases auto public IP; terminate deletes root EBS. Use Elastic IP for fixed IP.