innovatech-labs / congni-easy-service

0 stars 0 forks source link

Create CI/CD pipeline for deployment to AWS Lambda #7

Open HSKPeter opened 1 year ago

HSKPeter commented 1 year ago

https://www.eliasbrange.dev/posts/deploy-fastapi-on-aws-part-2-fargate-alb/

HSKPeter commented 1 year ago

Create an AWS account: If you don't already have one, create an AWS account by visiting the AWS website and following the on-screen instructions.

Create a VPC and subnets: To create a Virtual Private Cloud (VPC) and its subnets, log into the AWS Management Console and navigate to the VPC dashboard. Create a new VPC, along with its subnets, to host your FastAPI app.

Create a Docker image of the FastAPI app: To build a Docker image of the FastAPI app, you will need to write a Dockerfile that specifies the image's dependencies and configuration. You can use the Docker CLI to build the image and push it to ECR.

Store the Docker image in Amazon Elastic Container Registry (ECR): To store the Docker image in Amazon Elastic Container Registry (ECR), log into the AWS Management Console and navigate to the ECR dashboard. Create a new repository to store your FastAPI app image, and use the Docker CLI to push the image to the repository.

Create a task definition for the Fargate service: To create a task definition for the Fargate service, log into the AWS Management Console and navigate to the ECS dashboard. Create a new task definition that specifies the Docker image and resource requirements for the FastAPI app.

Create a Fargate service and associated security groups: To create a Fargate service and its associated security groups, log into the AWS Management Console and navigate to the ECS dashboard. Create a new Fargate service, along with its associated security groups, to host your FastAPI app.

Configure a load balancer: To configure a load balancer for your FastAPI app, log into the AWS Management Console and navigate to the EC2 dashboard. Create a new Application Load Balancer, and associate it with the Fargate service. The load balancer will handle incoming traffic to the FastAPI app.