Deploying a Flask and React Microservice to AWS ECS
Learn how to deploy microservices to Amazon ECS powered by Flask, React, and Docker.
Learning Objectives
By the end of this course, you will be able to:
- Explain what container orchestration is and why you may need to use an orchestration tool to manage deployments
- Discuss the pros and cons of using Elastic Container Service (ECS) over other orchestration tools like Kubernetes, Mesos, and Docker Swarm
- Set up an IAM user
- Create a production Dockerfile that uses multistage Docker builds
- Utilize Amazon Elastic Container Registry (ECR) image registry to store built images
- Configure CodeBuild to run when code is checked in to GitHub
- Run unit and integrations tests and check code for quality and formatting issues on CodeBuild
- Configure RDS for data persistence
- Configure an Application Load Balancer (ALB) along with ECS to run a set of microservices
- Send container logs to CloudWatch
- Update a running container via a zero-downtime deployment strategy to not disrupt the current users or your application
- Explain the types of scaling that are available to you within ECS
- Use AWS Fargate with ECS to deploy a microservice
- Spin up AWS infrastructure via Terraform
Tools and Technologies
Back-end
- Python
- Flask
- Postgres
- pytest
- Flask-RESTX
- Flask-SQLAlchemy
- Flask-CORS
- Flask-Bcrypt
- PyJWT
- Gunicorn
- Coverage.py
- flake8
- Black
- isort
- Swagger/OpenAPI
Front-end
- JavaScript
- Node
- React
- Formik
- Jest
- React Testing Library
- Axios
- React Router
- ESLint
- Prettier
- Formik
- Yup
Tools
- Create React App
- Docker
- Nginx
- HTTPie
- Terraform
AWS Services
- IAM
- Elastic Container Registry (ECR)
- CodeBuild
- CloudWatch
- Elastic Container Service (ECS)
- Elastic Load Balancing (ELB)
- RDS
- Fargate
Prerequisites
This is not a beginner course. It's designed for the advanced-beginner -- someone with at least six months of web development experience. Before beginning, you should have some familiarity with the following topics. Refer to these resources for more info:
Topic | Resource |
---|---|
Docker | Get started with Docker |
Docker Compose | Get started with Docker Compose |
AWS | What is AWS? |
It will also be helpful to have experience with Flask and React. Check out the Test-Driven Development with Python, Flask, and Docker and Authentication with Flask, React, and Docker courses for more.
Demo
Info
- Current version: 1.3.0
- Last updated: November 25th, 2020
- Author: Michael Herman
Table of Contents
- Introduction
- Changelog
- Microservices
- Getting Started
- Container Orchestration
- AWS Setup
- Elastic Container Registry
- Production Docker
- CodeBuild
- Elastic Load Balancer
- Setting up RDS
- Elastic Container Service
- ECS CodeBuild
- CodeBuild Workflow
- Fargate
- Workflow
- Structure
- Next Steps
Join our mailing list to be notified about course updates and new tutorials.