Ravindra BagaleCourses & study guides

Chapter 5: Amazon EC2 (Elastic Compute Cloud)

Practice Questions and Lab Exercises

  1. List five advantages of EC2 over on-premises servers. Explain the shared responsibility model.
  2. Define AMI, instance type, key pair, security group, EBS, Elastic IP, Region and AZ.
  3. Decode the instance type m7g.2xlarge.
  4. Compare On-Demand, Reserved, Savings Plans and Spot pricing with a use case for each.
  5. What are the default SSH users for Amazon Linux, Ubuntu and CentOS Stream AMIs?
  6. What happens to the public IP, the EBS volume and billing when you stop vs terminate an instance?
  7. Lab: Launch an Amazon Linux 2023 t3.micro in 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.
  8. Lab: Connect to the same instance from Windows using both PuTTY and OpenSSH.
  9. 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.