Hands-On LabsLab 1: Deploying a Scalable Web Application

Lab 1: Deploying a Scalable Web Application

Scenario

You are a Cloud Engineer tasked with deploying a simple web application that can handle varying amounts of traffic. You will set up a foundational cloud environment using Infrastructure as a Service (IaaS) components.

Architecture

You will create:

  1. A VPC with public and private subnets.
  2. Two Web Server instances (e.g., EC2, Compute Engine) in the private subnets.
  3. An Internet-facing Load Balancer in the public subnets to route traffic to your web servers.

Instructions

Step 1: Network Setup

  1. Navigate to your cloud provider’s console.
  2. Create a new VPC with a CIDR block of 10.0.0.0/16.
  3. Create two public subnets and two private subnets across two different Availability Zones.
  4. Attach an Internet Gateway to the VPC and configure the routing for the public subnets.

Step 2: Provision Compute Resources

  1. Launch two virtual machine instances.
  2. Place them in the private subnets.
  3. Use a startup script (User Data) to install a basic Nginx or Apache web server on boot.

Step 3: Load Balancing

  1. Create a Load Balancer.
  2. Configure a listener on port 80 (HTTP).
  3. Create a target group and register your two virtual machine instances.
  4. Test the configuration by accessing the Load Balancer’s public DNS name.

Validation

You should be able to refresh the browser and see responses alternating between your two different web servers.