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.
- Frontend: Python Flask web application
- Container: Docker container running on AWS ECS
- Database: AWS RDS (MySQL/MariaDB)
- Infrastructure: Managed through Terraform
- AWS Account with appropriate permissions
- Terraform installed locally
- Docker installed locally
- AWS CLI configured
- Python 3.x
- pip package manager
- Build the Docker image:
docker build -t orbwatch .- Run the container locally:
docker run -d --net=host orbwatchThe infrastructure is split into two parts: network and application infrastructure. Each has its own Terraform configuration.
- Navigate to the network directory:
cd terraform/network- Initialize Terraform:
terraform init- Review the planned changes:
terraform plan- Apply the network infrastructure:
terraform apply- Navigate to the infrastructure directory:
cd terraform/infra- Initialize Terraform:
terraform init- Review the planned changes:
terraform plan- Apply the application infrastructure:
terraform applyNote: The network infrastructure must be deployed before the application infrastructure, as the application infrastructure depends on the network resources.
Required environment variables:
DB_HOST: RDS endpointDB_USER: Database usernameDB_PASSWORD: Database passwordDB_NAME: Database name