EC2 SeriesProject 2

Flask App with Load Balancer

Deploy a scalable Flask application with Application Load Balancer and Auto Scaling Groups

Difficulty

Intermediate

Duration

4-6 hours

Cost

~$15-25 (if left running)

Project Overview

Build upon your EC2 knowledge by deploying a scalable Flask web application with an Application Load Balancer. This project introduces advanced networking concepts, auto-scaling, and high availability patterns. We acknowledge this is not the prefered method to create this application, however the manual setup will help to comprehend the services being created.

You'll create a custom VPC, deploy multiple EC2 instances running a Flask application, configure an Application Load Balancer for high availability, and implement Auto Scaling Groups for automatic scaling and healing.

Learning Objectives

Technical Skills

  • • Deploy Python Flask applications
  • • Create custom VPC networking
  • • Configure Application Load Balancers
  • • Set up Auto Scaling Groups

AWS Concepts

  • • Custom VPC design and implementation
  • • Multi-AZ deployment strategies
  • • Launch Templates and versioning
  • • Target Groups and health checks

Technologies Used

Flask
Web Framework
ALB
Load Balancer
Auto Scaling
Scaling Groups
VPC
Networking

Prerequisites

  • • Complete EC2 Project 1 or have equivalent EC2 experience
  • • AWS CLI configured with appropriate permissions
  • • Basic understanding of networking concepts (subnets, routing)
  • • Familiarity with Flask or similar web frameworks
  • • Understanding of load balancing concepts

Architecture Overview

Architecture diagram for EC2 Project 2

Project Steps

1

Create the Flask App Bootstrap Script

+
2

Create a Custom VPC with Public and Private Subnets

+
3

Create Security Groups for ALB and EC2

+
4

Create Application Load Balancer

+
5

Create Launch Template

+
6

Create Auto Scaling Group

+
7

Test Your Application

+
8

Monitor and Scale Your Application

+
9

Clean Up Resources

+