No description
Find a file
LEMOINE Baptiste - EXT-SAVANE CONSULTING GROUP (SAFRAN AIRCRAFT ENGINES) e31fdc2c02 up structure for tf
2025-09-19 10:09:31 +02:00
backend up structure for tf 2025-09-19 10:09:31 +02:00
docs up structure for tf 2025-09-19 10:09:31 +02:00
envs up structure for tf 2025-09-19 10:09:31 +02:00
gitlab-ci up structure for tf 2025-09-19 10:09:31 +02:00
src up structure for tf 2025-09-19 10:09:31 +02:00
.gitignore up structure for tf 2025-09-19 10:09:31 +02:00
.gitlab-ci.yml up structure for tf 2025-09-19 10:09:31 +02:00
.pre-commit-config.yaml up structure for tf 2025-09-19 10:09:31 +02:00
apigateway.tf up structure for tf 2025-09-19 10:09:31 +02:00
data.tf up structure for tf 2025-09-19 10:09:31 +02:00
ecs_autoscaling.tf up structure for tf 2025-09-19 10:09:31 +02:00
ecs_service_frontend.tf up structure for tf 2025-09-19 10:09:31 +02:00
ecs_task_definition_frontend.tf up structure for tf 2025-09-19 10:09:31 +02:00
iam.tf up structure for tf 2025-09-19 10:09:31 +02:00
lambda.tf up structure for tf 2025-09-19 10:09:31 +02:00
locals.tf up structure for tf 2025-09-19 10:09:31 +02:00
openapi.template.yaml up structure for tf 2025-09-19 10:09:31 +02:00
providers.tf up structure for tf 2025-09-19 10:09:31 +02:00
README.md up structure for tf 2025-09-19 10:09:31 +02:00
variables.tf up structure for tf 2025-09-19 10:09:31 +02:00
version.tf up structure for tf 2025-09-19 10:09:31 +02:00

RAG Pattern :: Backend

This repository hosts the code for the frontend application built with Streamlit. The deployment process involves building a Docker image, pushing it to Amazon Elastic Container Registry (ECR), and running it as an ECS task using Terraform for infrastructure management.

Deployment Workflow

  • 1 Docker Image Build and Push to ECR: The frontend application is containerized using Docker. The GitLab CI/CD pipeline builds the image and pushes it to an Amazon ECR repository.
  • 2 Infrastructure Provisioning with Terraform: The necessary AWS infrastructure, including the ECR repository, ECS cluster, and networking resources, is defined and managed using Terraform.
  • 3 ECS Task Deployment: The Docker image from ECR is deployed as an ECS task, running the Streamlit application in a containerized environment.

Detailed Steps

  1. Docker Image Build & Push:

    • The CI/CD pipeline builds the Streamlit application into a Docker image.
    • The image is tagged with the commit SHA for version control.
    • The image is pushed to Amazon ECR for storage.
  2. Terraform-Based Infrastructure Deployment:

    • The Terraform configuration provisions:
      • An ECR repository for storing images.
      • An ECS cluster with task definitions.
      • Security groups, IAM roles, and networking components.
    • The infrastructure is applied using GitLab CI/CD with terraform apply.
  3. Deploying the Application to ECS:

    • The ECS task definition is updated with the latest image.
    • The ECS service is restarted to apply the new task definition.
    • Load balancing and auto-scaling ensure availability and scalability.

ARCHITECTURE

In this architecture:

  • The frontend container runs on Amazon ECS with Fargate.
  • The container image is stored and retrieved from Amazon ECR.
  • Network access is managed through security groups and, optionally, an Application Load Balancer.
  • Terraform automates AWS infrastructure provisioning.

This setup ensures an automated, scalable, and reliable deployment pipeline for the frontend application.

Architecture

DEPLOYEMENT

Requirements

The saeiagendocuref infrastructure should be deployed in your AWS account