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:
- A VPC with public and private subnets.
- Two Web Server instances (e.g., EC2, Compute Engine) in the private subnets.
- An Internet-facing Load Balancer in the public subnets to route traffic to your web servers.
Instructions
Step 1: Network Setup
- Navigate to your cloud provider’s console.
- Create a new VPC with a CIDR block of
10.0.0.0/16. - Create two public subnets and two private subnets across two different Availability Zones.
- Attach an Internet Gateway to the VPC and configure the routing for the public subnets.
Step 2: Provision Compute Resources
- Launch two virtual machine instances.
- Place them in the private subnets.
- Use a startup script (User Data) to install a basic Nginx or Apache web server on boot.
Step 3: Load Balancing
- Create a Load Balancer.
- Configure a listener on port 80 (HTTP).
- Create a target group and register your two virtual machine instances.
- 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.