AWS FastAPI CDK deployment on top of ALB and ECS with Docker containers implementing ECS as the orchestration tool for an AWS-managed infrastructure.
- Deployed on AWS with Infrastructure as Code on CDK-TypeScript.
- API developed with FastAPI.
- Unit and Integration Tests for the source code with PyTest.
- Containerized solution with Docker orchestrated by Amazon ECS (Fargate).
- Load Balancing managed with ELB - Application Load Balancer with listener ECS Service as target group.
- Public DNS records on top of Route 53 with Certificates on AWS Certificate Manager.
The AWS infrastructure solution is deployed with CDK-TypeScript with the resources defined on the cdk
folder:
This repository consists of multiple folders/files, which are explained as follows:
- Infrastructure as Code (
./cdk/
). - Source Code (
./src/app/
). - Tests (
./tests/
) - Docker containerization (
./src/Dockerfile
).
Follow these steps to configure the project locally:
First, clone the repository:
git clone https://github.com/san99tiago/aws-cdk-ecs-api
cd aws-cdk-ecs-api
Review the step by step commands for the source code (Python) development and testing at:
Note: python dependencies for this project are managed by Poetry. Review
./pyproject.toml
for details.
Review the step by step commands for configuring the CDK at:
Note: for deploying or destroying the solution, see ("part 3") inside
./commands_cdk.sh
.
-
Visual Studio Code
Visual Studio Code is my main code editor for high-level programming. This is not absolutely necessary, but from my experience, it gives us a great performance and we can link it with Git and GitHub easily. -
NodeJs
NodeJs is a JavaScript runtime built on Chrome's V8 JavaScript engine programming language. The community is amazing and lets us handle async functionalities in elegant ways. -
Python
Python is an amazing dynamic programming language that let us work fast, with easy and powerful integration of different software solutions.
-
CDK CLI (Toolkit)
To work with the CDK, it is important to install the main toolkit as a NodeJs global dependency. Please refer to the official AWS Getting started with the AWS CDK -
AWS CLI
The AWS Command Line Interface (AWS CLI) is a unified tool to manage your AWS services. We will use it for connecting to our AWS account from the terminal (authentication and authorization towards AWS).
- I am grateful to the talented individuals who have dedicated their time and effort to develop the exceptional open-source projects that have been used in the creation of this solution.
Santiago Garcia Arango
As a curious DevOps Engineer, I am deeply passionate about implementing cutting-edge cloud-based solutions on AWS. |
Copyright 2023 Santiago Garcia Arango