Skip to content

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 AWS Cloud-Integrated Flask Project (End-to-End)

This project is designed to help you complete your AWS Week 30 & 31 modules. It integrates several core AWS services into a single, functional application.

🛠️ Integrated Services

  • DynamoDB: Real-time visitor counter.
  • SQS: Task queuing for background processing.
  • SNS: Critical security alert notifications.
  • Secrets Manager: Securely fetching API keys/config.
  • AppConfig: Dynamic "Maintenance Mode" toggles.
  • CodeBuild: Automatic Docker image builds via buildspec.yml.
  • ECR/ECS: Containerization and orchestration.

📋 Step-by-Step AWS Setup Guide

Follow these steps in your AWS Console to make the application fully functional:

1. DynamoDB (Week 31)

  • Create a table named VisitorCount.
  • Partition Key: id (String).
  • Once created, add an item: { "id": "global_stats", "visitor_count": 0 }.

2. SQS (Week 30)

  • Create a Standard Queue named MyOrderQueue.
  • Copy its URL and add it to your environment variables.

3. SNS (Week 30)

  • Create a Standard Topic named MyAlerts.
  • Create a Subscription (Protocol: Email) and confirm the link in your inbox.
  • Copy the Topic ARN for your configuration.

4. Secrets Manager (Week 30)

  • Create a secret named AppSecretKeys.
  • Select "Other type of secret" and add key-value pairs (e.g., api_key: sample_key).

5. AppConfig (Week 30)

  • Application: MyFlaskConfig
  • Environment: Production
  • Configuration Profile: MaintenanceMode
  • Add a JSON configuration: { "maintenance_mode": false }.

🏃 How to Run the Project

Local Development (with venv)

  1. python3 -m venv venv
  2. source venv/bin/activate
  3. pip install -r requirements.txt
  4. Set your environment variables in a .env file or export them:
    export AWS_REGION="us-east-1"
    export DYNAMODB_TABLE="VisitorLogs"
    export SQS_QUEUE_URL="https://sqs.us-east-1.amazonaws.com/246005668592/MyOrderQueue"
    export SNS_TOPIC_ARN="arn:aws:sns:us-east-1:246005668592:MyAlerts"
  5. python app.py

Docker Deployment (Week 31)

  1. docker build -t aws-flask-app .
  2. docker run -p 8080:8080 -e AWS_ACCESS_KEY_ID=XXX -e AWS_SECRET_ACCESS_KEY=XXX aws-flask-app

🚢 CI/CD with CodeBuild (Week 30)

The provided buildspec.yml is ready!

  1. Create a project in AWS CodeBuild.
  2. Connect it to your GitHub repository.
  3. Select "Docker" as the environment and enable the "Privileged" flag.
  4. Add environment variables: AWS_ACCOUNT_ID, IMAGE_REPO_NAME, and CONTAINER_NAME.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages