A secure, cloud-based task management application built with AWS CDK, Flask, and MySQL.
TaskChecklist is a full-stack web application that allows users to create, view, and manage tasks through a clean, responsive interface. The application is deployed on AWS using Infrastructure as Code (IaC) principles with AWS CDK.
- Task Management: Add, view, and complete tasks with titles and descriptions
- Responsive UI: Bootstrap-powered interface that works on all devices
- Secure Architecture: Private subnets, security groups, and encrypted storage
- Health Monitoring: Built-in health checks and ALB integration
- Database Integration: MySQL RDS with automatic schema creation
- Secrets Management: AWS Secrets Manager for secure credential handling
Internet → ALB → EC2 (Flask App) → RDS MySQL
↓
S3 Bucket (Assets)
↓
Secrets Manager (DB Credentials)
- VPC: Multi-AZ setup with public and private subnets
- EC2: t3.micro instance running Flask application in private subnet
- RDS: MySQL 8.0 database with encryption at rest
- ALB: Application Load Balancer for high availability
- S3: Encrypted bucket for application assets
- Secrets Manager: Secure database credential storage
- Security Groups: Restrictive network access controls
- AWS CLI configured with appropriate permissions
- Node.js 16+ (for AWS CDK CLI)
- Python 3.7+
- Git
Your AWS user/role needs permissions for:
- EC2, RDS, VPC, ALB, S3, Secrets Manager
- IAM role creation and policy attachment
- CloudFormation stack operations
-
Clone the Repository
git clone https://github.com/yourusername/taskchecklist.git cd taskchecklist -
Install AWS CDK CLI
npm install -g aws-cdk
-
Install Python Dependencies
pip install -r requirements.txt
-
Bootstrap CDK (first time only)
cdk bootstrap
-
Deploy the Stack
cdk deploy
The deployment will output the ALB DNS name for accessing your application.
taskchecklist/
├── assets/
│ ├── app.py # Flask application
│ └── templates/
│ └── index.html # Frontend interface
├── taskchecklist/
│ ├── __init__.py
│ └── taskchecklist_stack.py # CDK infrastructure definition
├── tests/
│ └── unit/
│ └── test_*.py # Unit tests
├── app.py # CDK app entry point
├── cdk.json # CDK configuration
├── requirements.txt # Python dependencies
└── README.md # This file
DB_SECRET_NAME: ARN of the database secret in Secrets ManagerDB_HOST: RDS endpoint addressDB_NAME: Database name (taskchecklist)AWS_REGION: AWS region (us-east-1)
The application automatically creates the following table:
CREATE TABLE tasks (
id INT AUTO_INCREMENT PRIMARY KEY,
title VARCHAR(255) NOT NULL,
description TEXT,
status ENUM('pending','completed') DEFAULT 'pending',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);GET /- Main application interfaceGET /health- Health check endpoint (used by ALB)GET /tasks- Retrieve all tasks (JSON)POST /tasks- Create a new taskPOST /tasks/<id>/complete- Mark task as completed
- Network Security: Resources deployed in private subnets
- Encryption: RDS and S3 encryption at rest
- Access Control: Security groups with minimal required access
- Secrets Management: Database credentials never stored in plain text
- IAM Roles: Principle of least privilege for EC2 instance
The ALB performs health checks on /health endpoint every 30 seconds.
- Application Logs:
/var/log/flask-start.logon EC2 instance - System Logs:
/var/log/cloud-init-output.logfor deployment issues - CloudWatch: EC2 and RDS metrics available in AWS console
- Instance Unhealthy: Check Flask app logs and ensure port 80 is accessible
- Database Connection: Verify RDS security group allows EC2 access
- Deployment Failures: Check CloudFormation events in AWS console
Run unit tests:
python -m pytest tests/- Assets Upload: Flask app files uploaded to S3
- Infrastructure: VPC, security groups, and networking created
- Database: RDS MySQL instance provisioned with encryption
- Compute: EC2 instance launched with user data script
- Application: Flask app downloaded, configured, and started
- Load Balancer: ALB configured with health checks
To update the application:
- Make changes to your code
- Run
cdk deployto update infrastructure - For app-only changes, the EC2 instance will automatically pull updates
To remove all resources:
cdk destroyCurrent setup is designed for development/small-scale use. For production:
- Use Auto Scaling Groups for EC2 instances
- Implement Multi-AZ RDS deployment
- Add CloudFront for content delivery
- Use ECS/Fargate for containerized deployment
- Implement CI/CD pipeline
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- AWS CDK team for excellent Infrastructure as Code tools
- Flask community for the lightweight web framework
- Bootstrap for responsive UI components
Questions? Open an issue or contact the maintainers.