Create a VPC and launch an EC2 to publish a page using AWS CLI commands

Lab Details

  1. This lab walks you through creating a VPC, some subnets, an Internet Gateway, a route table, and then configuring these services to work together to form an effective VPC. We will then launch an EC2 instance. into the VPC and create a web page using AWS CLI commands.

  2. Duration: 1 hour 15 minutes

  3. AWS Region: US East (N. Virginia) us-east-1

Architecture Diagram

Task Details

  1. Log into the AWS Management Console.

  2. Create an IAM Role.

  3. Launching an EC2 Instance

  4. SSH into EC2 Instance

  5. Create a VPC using AWS CLI.

  6. Create a Subnet.

  7. Create an Internet Gateway using AWS CLI

  8. Attach Internet gateway to VPC.

  9. Create a custom Route table.

  10. Create a public route in the Route table that points to the Internet gateway using AWS CLI.

  11. Associate the subnet to your Route table.

  12. AWS CLI command to create Security Group

  13. Create a security group rule with AWS CLI

  14. Create a new key pair.

  15. Store User Data in a File

  16. AWS CLI command to create EC2s

  17. Allocate an Elastic IP address.

  18. Attach the Elastic IP with EC2 Instance.

  19. View the EC2 instance.