Skip to content

ehoang0106/containerized

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Containerized My Python Flask Web App with AWS ECS, RDS, and Terraform

This project demonstrates a containerized Python Flask web application deployed on AWS ECS (Elastic Container Service) with RDS (Relational Database Service) as the backend database, all managed through Terraform infrastructure as code.

Architecture Overview

  • Frontend: Python Flask web application
  • Container: Docker container running on AWS ECS
  • Database: AWS RDS (MySQL/MariaDB)
  • Infrastructure: Managed through Terraform

Prerequisites

  • AWS Account with appropriate permissions
  • Terraform installed locally
  • Docker installed locally
  • AWS CLI configured
  • Python 3.x
  • pip package manager

Docker Setup

  1. Build the Docker image:
docker build -t orbwatch .
  1. Run the container locally:
docker run -d --net=host orbwatch

Infrastructure Deployment

The infrastructure is split into two parts: network and application infrastructure. Each has its own Terraform configuration.

Network Infrastructure

  1. Navigate to the network directory:
cd terraform/network
  1. Initialize Terraform:
terraform init
  1. Review the planned changes:
terraform plan
  1. Apply the network infrastructure:
terraform apply

Application Infrastructure

  1. Navigate to the infrastructure directory:
cd terraform/infra
  1. Initialize Terraform:
terraform init
  1. Review the planned changes:
terraform plan
  1. Apply the application infrastructure:
terraform apply

Note: The network infrastructure must be deployed before the application infrastructure, as the application infrastructure depends on the network resources.

Environment Variables

Required environment variables:

  • DB_HOST: RDS endpoint
  • DB_USER: Database username
  • DB_PASSWORD: Database password
  • DB_NAME: Database name

About

Create a dashboard that checks data using AWS to practice my Terraform skills

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published