Lab 10 1 AWS Virtual Private Cloud - nicolas-tullio/Tech-Journal GitHub Wiki

Deliverables

Submit Screenshot of your new VPC

image

Submit Screenshot of the created subnet

image

Submit Screenshot of the attached Internet Gateway

image

Submit Screenshot of the Route Table

image

Submit Screenshot of your Running Instance using your new VPC

image

Submit Screenshot of apache page loaded using Elastic IP

image

Screenshot of your server web page loaded using a dns name

image

Steps

Create a New Non-Default VPC

Open the Amazon VPC console from Services in the AWS Console

image

Choose Create VPC

image

On the configuration page

  • Choose VPC and More
  • Enter a name tag for your VPC in the Auto-Generate field
  • Select 1 Availability Zone
  • Select 1 Public Subnet
  • Select 0 Private subnets
  • Customize the CIDR block to be a /24
  • Leave defaults for everything else
  • Click Create VPC

image

image

View information about your VPC

image

Choose Subnets and find the subnet that was created when you created your VPC

image

Choose Internet Gateways and find the internet gateway that's attached to your VPC

image

Choose Route Tables. Select the custom route table (the Main column displays No), and then choose the Routes tab to display the route information in the details pane.

image

Launch an instance into your VPC

Navigate to EC2 > Instances > Launch an instance

Choose a Free-tier Eligible Ubuntu 20.04 AMI

image

Edit Network settings and choose the new VPC and subnet

  • Add a rule to allow inbound HTTP

  • Add a rule to allow inbound SSH

image

Add Name Tag

image

Choose Launch instance and select keypair

image

View Instance details

image

  • The Private IPs field displays the private IP address that's assigned to your instance from the range of IP addresses in your subnet.

  • You will notice that no Public IP is assigned, so you cannot SSH into the system remotely

Assign an Elastic IP address to your instance

Navigate to VPC > Elastic IPs

image

Choose Allocate new address, and then Allocate

image

Select the Elastic IP address from the list, choose Actions, and then choose Associate Address

image

For Resource type, ensure that Instance is selected. Choose your instance from the Instance list. Choose Associate when you're done.

image

  • Your instance is now accessible from the internet

Configure a Web Service and Connect

SSH into your instance

ssh -i nicolas.pem [email protected]

image

Install Apache2

sudo apt-get install apache2

Start apache2 with systemctl

sudo systemctl start apache2

image

Can add/update your DuckDNS account for your new server (duckdns.org)

image

It can take a bit to propagate across DNS

  • Try: https://dnschecker.org/
  • You can put in your hostname and run tests - after a while you will see it start to propagate across the world!

image